diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2014-10-01 10:38:07 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@digia.com> | 2014-10-01 15:27:52 +0200 |
commit | f4ef7e57f2209c3ff3389f07bc67461c2d547119 (patch) | |
tree | e637c72685378d810c2e4fe5b8737192e40520ce /examples | |
parent | cc174637dd75da1e759a058648dac9cc9fb5ba2c (diff) | |
download | qtquickcontrols-f4ef7e57f2209c3ff3389f07bc67461c2d547119.tar.gz |
gallery: cleanup the main
It's not a good example to rely on instances "somewhere in the outer
context" => move things where they are used so they can be referenced
via IDs that are in the scope.
Change-Id: I352dca270de92590b5d620e529e84b9d18105082
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/quick/controls/gallery/content/Controls.qml | 61 | ||||
-rw-r--r-- | examples/quick/controls/gallery/main.qml | 61 |
2 files changed, 61 insertions, 61 deletions
diff --git a/examples/quick/controls/gallery/content/Controls.qml b/examples/quick/controls/gallery/content/Controls.qml index a8adf8a5..a738d85a 100644 --- a/examples/quick/controls/gallery/content/Controls.qml +++ b/examples/quick/controls/gallery/content/Controls.qml @@ -54,6 +54,20 @@ Item { property int tabPosition: tabPositionGroup.current === r2 ? Qt.BottomEdge : Qt.TopEdge + property string loremIpsum: + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+ + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+ + "incididunt ut labore et dolore magna aliqua.\n Ut enim ad minim veniam, quis nostrud "+ + "exercitation ullamco laboris nisi ut aliquip ex ea commodo cosnsequat. "; + + ListModel { + id: choices + ListElement { text: "Banana" } + ListElement { text: "Orange" } + ListElement { text: "Apple" } + ListElement { text: "Coconut" } + } + RowLayout { id: contentRow anchors.fill:parent @@ -220,4 +234,51 @@ Item { } } } + + ExclusiveGroup { + id: textFormatGroup + + Action { + id: a1 + text: "Align &Left" + checkable: true + Component.onCompleted: checked = true + } + + Action { + id: a2 + text: "&Center" + checkable: true + } + + Action { + id: a3 + text: "Align &Right" + checkable: true + } + } + + Component { + id: editmenu + Menu { + MenuItem { action: cutAction } + MenuItem { action: copyAction } + MenuItem { action: pasteAction } + MenuSeparator {} + Menu { + title: "Text &Format" + MenuItem { action: a1 } + MenuItem { action: a2 } + MenuItem { action: a3 } + MenuSeparator { } + MenuItem { text: "Allow &Hyphenation"; checkable: true } + } + Menu { + title: "Font &Style" + MenuItem { text: "&Bold"; checkable: true } + MenuItem { text: "&Italic"; checkable: true } + MenuItem { text: "&Underline"; checkable: true } + } + } + } } diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml index 8b89d80d..143a8cb1 100644 --- a/examples/quick/controls/gallery/main.qml +++ b/examples/quick/controls/gallery/main.qml @@ -57,12 +57,6 @@ ApplicationWindow { minimumHeight: 400 minimumWidth: 600 - property string loremIpsum: - "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+ - "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+ - "incididunt ut labore et dolore magna aliqua.\n Ut enim ad minim veniam, quis nostrud "+ - "exercitation ullamco laboris nisi ut aliquip ex ea commodo cosnsequat. "; - ImageViewer { id: imageViewer } FileDialog { @@ -115,55 +109,8 @@ ApplicationWindow { onTriggered: aboutDialog.open() } - ExclusiveGroup { - id: textFormatGroup - - Action { - id: a1 - text: "Align &Left" - checkable: true - Component.onCompleted: checked = true - } - - Action { - id: a2 - text: "&Center" - checkable: true - } - - Action { - id: a3 - text: "Align &Right" - checkable: true - } - } - ChildWindow { id: window1 } - Component { - id: editmenu - Menu { - MenuItem { action: cutAction } - MenuItem { action: copyAction } - MenuItem { action: pasteAction } - MenuSeparator {} - Menu { - title: "Text &Format" - MenuItem { action: a1 } - MenuItem { action: a2 } - MenuItem { action: a3 } - MenuSeparator { } - MenuItem { text: "Allow &Hyphenation"; checkable: true } - } - Menu { - title: "Font &Style" - MenuItem { text: "&Bold"; checkable: true } - MenuItem { text: "&Italic"; checkable: true } - MenuItem { text: "&Underline"; checkable: true } - } - } - } - toolBar: ToolBar { id: toolbar RowLayout { @@ -228,14 +175,6 @@ ApplicationWindow { } } - ListModel { - id: choices - ListElement { text: "Banana" } - ListElement { text: "Orange" } - ListElement { text: "Apple" } - ListElement { text: "Coconut" } - } - TabView { id:frame enabled: enabledCheck.checked |