on xenial help sign in
Use aliases for labels instead of defining new properties
commit1dbd9171eeb137f75c59ef138fd0dc2b8414636a authorMichael Terry <michael.terry@canonical.com> dateThu 22 Aug 2013, 10:17 (13 years ago) parent408540a
1 file changed+4−6
Components/DemoOverlay.qml+4−6
Components/DemoOverlay.qml+4−6
@@ -31,17 +31,17 @@ Showable {
3131 /*
3232 * This is the header displayed, like "Right edge".
3333 */
34− property string title
34+ property alias title: titleLabel.text
3535
3636 /*
3737 * This is the block of text displayed below the header.
3838 */
39− property string text
39+ property alias text: textLabel.text
4040
4141 /*
4242 * This is the text for the skip button.
4343 */
44− property string skipText: i18n.tr("Skip intro")
44+ property alias skipText: skipLabel.text
4545
4646 /*
4747 * Whether this demo is running currently.
@@ -118,7 +118,6 @@ Showable {
118118
119119 Label {
120120 id: titleLabel
121− text: overlay.title
122121 fontSize: "x-large"
123122 width: units.gu(25)
124123 wrapMode: Text.WordWrap
@@ -126,7 +125,6 @@ Showable {
126125
127126 Label {
128127 id: textLabel
129− text: overlay.text
130128 width: units.gu(25)
131129 wrapMode: Text.WordWrap
132130 }
@@ -134,7 +132,7 @@ Showable {
134132 Label {
135133 id: skipLabel
136134 objectName: "skipLabel"
137− text: overlay.skipText
135+ text: i18n.tr("Skip intro")
138136 color: overlay.__orange
139137 fontSize: "small"
140138 font.underline: true