2014-12-01 21:02:33 +01:00
|
|
|
import QtQuick 2.2
|
|
|
|
import QtQuick.Controls 1.2
|
2014-12-24 14:30:41 +01:00
|
|
|
import QtQuick.Layouts 1.1
|
2014-12-01 21:02:33 +01:00
|
|
|
import QtQuick.Window 2.1
|
|
|
|
|
|
|
|
ApplicationWindow
|
|
|
|
{
|
|
|
|
width: 400
|
|
|
|
height: 300
|
2014-12-24 14:30:41 +01:00
|
|
|
|
|
|
|
Component.onCompleted: visible = true
|
2014-12-10 22:50:56 +01:00
|
|
|
|
2014-12-24 14:30:41 +01:00
|
|
|
ColumnLayout
|
2014-12-01 21:02:33 +01:00
|
|
|
{
|
2014-12-24 14:30:41 +01:00
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
Label
|
|
|
|
{
|
|
|
|
text: "Current name is:" + myQObject.name
|
|
|
|
}
|
|
|
|
|
|
|
|
TextField
|
|
|
|
{
|
|
|
|
id: textField
|
|
|
|
}
|
|
|
|
|
|
|
|
Button
|
|
|
|
{
|
|
|
|
text: "Change Name"
|
|
|
|
onClicked: {
|
|
|
|
console.log("QML:", textField.text)
|
|
|
|
myQObject.name = textField.text
|
|
|
|
}
|
|
|
|
}
|
2014-12-01 21:02:33 +01:00
|
|
|
}
|
|
|
|
}
|