qt-quick-for-designers-1:components
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
qt-quick-for-designers-1:components [2013/06/22 03:20] – created mithat | qt-quick-for-designers-1:components [2013/06/22 04:03] – mithat | ||
---|---|---|---|
Line 46: | Line 46: | ||
</ | </ | ||
* '' | * '' | ||
+ | |||
+ | ===== Properties ===== | ||
+ | * You can declare a '' | ||
+ | <file javascript ButtonSimple2.qml> | ||
+ | import QtQuick 1.0 | ||
+ | |||
+ | Image { | ||
+ | id: button | ||
+ | source: " | ||
+ | |||
+ | property string labelText | ||
+ | |||
+ | Text { | ||
+ | id: label | ||
+ | text: labelText | ||
+ | color: " | ||
+ | anchors.horizontalCenter: | ||
+ | anchors.top: | ||
+ | anchors.topMargin: | ||
+ | } | ||
+ | }</ | ||
+ | |||
+ | <file javascript reusing-buttonsimple2.qml> | ||
+ | import QtQuick 1.0 | ||
+ | |||
+ | Item { | ||
+ | id: myItem | ||
+ | width: 400 | ||
+ | height: 400 | ||
+ | |||
+ | ButtonSimple2 { | ||
+ | id: myButton | ||
+ | labelText: "Hey you!" | ||
+ | anchors.horizontalCenter: | ||
+ | anchors.bottom: | ||
+ | anchors.bottomMargin: | ||
+ | | ||
+ | MouseArea { | ||
+ | anchors.fill: | ||
+ | onClicked: { | ||
+ | parent.labelText = " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }</ | ||
+ | * Note that the MouseArea has been moved out of '' |
qt-quick-for-designers-1/components.txt · Last modified: 2013/07/06 22:53 by mithat