aboutsummaryrefslogtreecommitdiffstats
path: root/examples/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-26 13:52:56 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-03-23 12:46:11 +0000
commit0dd8a34f3b454d516f75e9b4be7691f934d2e849 (patch)
tree1b176eb891ce675e653093da645acd25253ff776 /examples/controls
parente346ed6f6db3fc0751c02b4b289f344d415cfdc9 (diff)
Inherit QQuickDrawer from QQuickPopup
Change-Id: Icf71270e63aedd93ba975ab9743de68c3a54e849 Task-number: QTBUG-51007 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'examples/controls')
-rw-r--r--examples/controls/gallery/gallery.qml99
1 files changed, 47 insertions, 52 deletions
diff --git a/examples/controls/gallery/gallery.qml b/examples/controls/gallery/gallery.qml
index 8a2c38d4..cb549475 100644
--- a/examples/controls/gallery/gallery.qml
+++ b/examples/controls/gallery/gallery.qml
@@ -111,65 +111,60 @@ ApplicationWindow {
Drawer {
id: drawer
+ width: Math.min(window.width, window.height) / 3 * 2
+ height: window.height
- Pane {
- padding: 0
- width: Math.min(window.width, window.height) / 3 * 2
- height: window.height
-
- ListView {
- id: listView
- currentIndex: -1
- anchors.fill: parent
+ ListView {
+ id: listView
+ currentIndex: -1
+ anchors.fill: parent
- delegate: ItemDelegate {
- width: parent.width
- text: model.title
- highlighted: ListView.isCurrentItem
- onClicked: {
- if (listView.currentIndex != index) {
- listView.currentIndex = index
- titleLabel.text = model.title
- stackView.replace(model.source)
- }
- drawer.close()
+ delegate: ItemDelegate {
+ width: parent.width
+ text: model.title
+ highlighted: ListView.isCurrentItem
+ onClicked: {
+ if (listView.currentIndex != index) {
+ listView.currentIndex = index
+ titleLabel.text = model.title
+ stackView.replace(model.source)
}
+ drawer.close()
}
+ }
- model: ListModel {
- ListElement { title: "BusyIndicator"; source: "qrc:/pages/BusyIndicatorPage.qml" }
- ListElement { title: "Button"; source: "qrc:/pages/ButtonPage.qml" }
- ListElement { title: "CheckBox"; source: "qrc:/pages/CheckBoxPage.qml" }
- ListElement { title: "ComboBox"; source: "qrc:/pages/ComboBoxPage.qml" }
- ListElement { title: "Dial"; source: "qrc:/pages/DialPage.qml" }
- ListElement { title: "Delegates"; source: "qrc:/pages/DelegatePage.qml" }
- ListElement { title: "Drawer"; source: "qrc:/pages/DrawerPage.qml" }
- ListElement { title: "Frame"; source: "qrc:/pages/FramePage.qml" }
- ListElement { title: "GroupBox"; source: "qrc:/pages/GroupBoxPage.qml" }
- ListElement { title: "Menu"; source: "qrc:/pages/MenuPage.qml" }
- ListElement { title: "PageIndicator"; source: "qrc:/pages/PageIndicatorPage.qml" }
- ListElement { title: "Popup"; source: "qrc:/pages/PopupPage.qml" }
- ListElement { title: "ProgressBar"; source: "qrc:/pages/ProgressBarPage.qml" }
- ListElement { title: "RadioButton"; source: "qrc:/pages/RadioButtonPage.qml" }
- ListElement { title: "RangeSlider"; source: "qrc:/pages/RangeSliderPage.qml" }
- ListElement { title: "ScrollBar"; source: "qrc:/pages/ScrollBarPage.qml" }
- ListElement { title: "ScrollIndicator"; source: "qrc:/pages/ScrollIndicatorPage.qml" }
- ListElement { title: "Slider"; source: "qrc:/pages/SliderPage.qml" }
- ListElement { title: "SpinBox"; source: "qrc:/pages/SpinBoxPage.qml" }
- ListElement { title: "StackView"; source: "qrc:/pages/StackViewPage.qml" }
- ListElement { title: "SwipeView"; source: "qrc:/pages/SwipeViewPage.qml" }
- ListElement { title: "Switch"; source: "qrc:/pages/SwitchPage.qml" }
- ListElement { title: "TabBar"; source: "qrc:/pages/TabBarPage.qml" }
- ListElement { title: "TextArea"; source: "qrc:/pages/TextAreaPage.qml" }
- ListElement { title: "TextField"; source: "qrc:/pages/TextFieldPage.qml" }
- ListElement { title: "ToolTip"; source: "qrc:/pages/ToolTipPage.qml" }
- ListElement { title: "Tumbler"; source: "qrc:/pages/TumblerPage.qml" }
- }
-
- ScrollIndicator.vertical: ScrollIndicator { }
+ model: ListModel {
+ ListElement { title: "BusyIndicator"; source: "qrc:/pages/BusyIndicatorPage.qml" }
+ ListElement { title: "Button"; source: "qrc:/pages/ButtonPage.qml" }
+ ListElement { title: "CheckBox"; source: "qrc:/pages/CheckBoxPage.qml" }
+ ListElement { title: "ComboBox"; source: "qrc:/pages/ComboBoxPage.qml" }
+ ListElement { title: "Dial"; source: "qrc:/pages/DialPage.qml" }
+ ListElement { title: "Delegates"; source: "qrc:/pages/DelegatePage.qml" }
+ ListElement { title: "Drawer"; source: "qrc:/pages/DrawerPage.qml" }
+ ListElement { title: "Frame"; source: "qrc:/pages/FramePage.qml" }
+ ListElement { title: "GroupBox"; source: "qrc:/pages/GroupBoxPage.qml" }
+ ListElement { title: "Menu"; source: "qrc:/pages/MenuPage.qml" }
+ ListElement { title: "PageIndicator"; source: "qrc:/pages/PageIndicatorPage.qml" }
+ ListElement { title: "Popup"; source: "qrc:/pages/PopupPage.qml" }
+ ListElement { title: "ProgressBar"; source: "qrc:/pages/ProgressBarPage.qml" }
+ ListElement { title: "RadioButton"; source: "qrc:/pages/RadioButtonPage.qml" }
+ ListElement { title: "RangeSlider"; source: "qrc:/pages/RangeSliderPage.qml" }
+ ListElement { title: "ScrollBar"; source: "qrc:/pages/ScrollBarPage.qml" }
+ ListElement { title: "ScrollIndicator"; source: "qrc:/pages/ScrollIndicatorPage.qml" }
+ ListElement { title: "Slider"; source: "qrc:/pages/SliderPage.qml" }
+ ListElement { title: "SpinBox"; source: "qrc:/pages/SpinBoxPage.qml" }
+ ListElement { title: "StackView"; source: "qrc:/pages/StackViewPage.qml" }
+ ListElement { title: "SwipeView"; source: "qrc:/pages/SwipeViewPage.qml" }
+ ListElement { title: "Switch"; source: "qrc:/pages/SwitchPage.qml" }
+ ListElement { title: "TabBar"; source: "qrc:/pages/TabBarPage.qml" }
+ ListElement { title: "TextArea"; source: "qrc:/pages/TextAreaPage.qml" }
+ ListElement { title: "TextField"; source: "qrc:/pages/TextFieldPage.qml" }
+ ListElement { title: "ToolTip"; source: "qrc:/pages/ToolTipPage.qml" }
+ ListElement { title: "Tumbler"; source: "qrc:/pages/TumblerPage.qml" }
}
+
+ ScrollIndicator.vertical: ScrollIndicator { }
}
- onClicked: close()
}
StackView {