qt-quick-for-designers-1:components
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
qt-quick-for-designers-1:components [2013/06/22 04:03] – mithat | qt-quick-for-designers-1:components [2013/07/06 22:53] (current) – [Resources] mithat | ||
---|---|---|---|
Line 48: | Line 48: | ||
===== Properties ===== | ===== Properties ===== | ||
- | * You can declare a '' | + | * You can declare a '' |
<file javascript ButtonSimple2.qml> | <file javascript ButtonSimple2.qml> | ||
import QtQuick 1.0 | import QtQuick 1.0 | ||
Line 66: | Line 66: | ||
anchors.topMargin: | anchors.topMargin: | ||
} | } | ||
+ | |||
+ | MouseArea { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
}</ | }</ | ||
Line 82: | Line 89: | ||
anchors.bottom: | anchors.bottom: | ||
anchors.bottomMargin: | anchors.bottomMargin: | ||
- | | ||
- | MouseArea { | ||
- | anchors.fill: | ||
- | onClicked: { | ||
- | parent.labelText = " | ||
- | } | ||
- | } | ||
} | } | ||
}</ | }</ | ||
- | | + | |
+ | ===== Signals ===== | ||
+ | | ||
+ | * In the Button below, | ||
+ | <file javascript Button.qml> | ||
+ | import QtQuick 1.0 | ||
+ | |||
+ | Image { | ||
+ | id: button | ||
+ | source: " | ||
+ | |||
+ | property string labelText | ||
+ | signal buttonClicked() | ||
+ | |||
+ | Text { | ||
+ | id: label | ||
+ | text: labelText | ||
+ | color: " | ||
+ | anchors.horizontalCenter: | ||
+ | anchors.top: | ||
+ | anchors.topMargin: | ||
+ | } | ||
+ | |||
+ | MouseArea { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | }</ | ||
+ | * The actual behavior is defined in the file where Button is used (as '' | ||
+ | <file javascript resuing-button.qml> | ||
+ | import QtQuick 1.0 | ||
+ | |||
+ | Item { | ||
+ | id: myItem | ||
+ | width: 400 | ||
+ | height: 400 | ||
+ | |||
+ | Button { | ||
+ | id: button | ||
+ | labelText: " | ||
+ | anchors.horizontalCenter: | ||
+ | anchors.bottom: | ||
+ | anchors.bottomMargin: | ||
+ | |||
+ | onButtonClicked: | ||
+ | button.labelText=" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | -------------------------------------------------------------- | ||
+ | ====== Resources ====== | ||
+ | * {{: | ||
+ | * All source code is subject to this [[copyright header|copyright]]. |
qt-quick-for-designers-1/components.1371873807.txt.gz · Last modified: 2013/06/22 04:03 by mithat