diff options
Diffstat (limited to 'examples/quickcontrols2/gallery')
31 files changed, 66 insertions, 163 deletions
diff --git a/examples/quickcontrols2/gallery/gallery.pro b/examples/quickcontrols2/gallery/gallery.pro index cb0736fd..45496a35 100644 --- a/examples/quickcontrols2/gallery/gallery.pro +++ b/examples/quickcontrols2/gallery/gallery.pro @@ -5,12 +5,12 @@ QT += quick quickcontrols2 SOURCES += \ gallery.cpp -OTHER_FILES += \ - gallery.qml \ - pages/*.qml - RESOURCES += \ - gallery.qrc + gallery.qml \ + qtquickcontrols2.conf \ + $$files(images/*.png) \ + $$files(images/+material/*.png) \ + $$files(pages/*.qml) target.path = $$[QT_INSTALL_EXAMPLES]/quickcontrols2/gallery INSTALLS += target diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml index cc818abd..5fabe77f 100644 --- a/examples/quickcontrols2/gallery/gallery.qml +++ b/examples/quickcontrols2/gallery/gallery.qml @@ -40,9 +40,9 @@ import QtQuick 2.6 import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtQuick.Controls.Material 2.0 -import QtQuick.Controls.Universal 2.0 +import QtQuick.Controls 2.1 +import QtQuick.Controls.Material 2.1 +import QtQuick.Controls.Universal 2.1 import Qt.labs.settings 1.0 ApplicationWindow { @@ -96,7 +96,7 @@ ApplicationWindow { fillMode: Image.Pad horizontalAlignment: Image.AlignHCenter verticalAlignment: Image.AlignVCenter - source: "qrc:/images/menu.png" + source: "images/menu.png" } onClicked: optionsMenu.open() @@ -107,7 +107,7 @@ ApplicationWindow { MenuItem { text: "Settings" - onTriggered: settingsPopup.open() + onTriggered: settingsDialog.open() } MenuItem { text: "About" @@ -190,7 +190,7 @@ ApplicationWindow { anchors.centerIn: parent anchors.verticalCenterOffset: -50 fillMode: Image.PreserveAspectFit - source: "qrc:/images/qt-logo.png" + source: "images/qt-logo.png" } Label { @@ -207,22 +207,31 @@ ApplicationWindow { Image { id: arrow - source: "qrc:/images/arrow.png" + source: "images/arrow.png" anchors.left: parent.left anchors.bottom: parent.bottom } } } - Popup { - id: settingsPopup - x: (window.width - width) / 2 - y: window.height / 6 - width: Math.min(window.width, window.height) / 3 * 2 - height: settingsColumn.implicitHeight + topPadding + bottomPadding + Dialog { + id: settingsDialog + x: Math.round((window.width - width) / 2) + y: Math.round(window.height / 6) + width: Math.round(Math.min(window.width, window.height) / 3 * 2) modal: true focus: true + standardButtons: Dialog.Ok | Dialog.Cancel + onAccepted: { + settings.style = styleBox.displayText + settingsDialog.close() + } + onRejected: { + styleBox.currentIndex = styleBox.styleIndex + settingsDialog.close() + } + contentItem: ColumnLayout { id: settingsColumn spacing: 20 @@ -261,45 +270,10 @@ ApplicationWindow { Layout.fillWidth: true Layout.fillHeight: true } - - RowLayout { - spacing: 10 - - Button { - id: okButton - text: "Ok" - onClicked: { - settings.style = styleBox.displayText - settingsPopup.close() - } - - Material.foreground: Material.primary - Material.background: "transparent" - Material.elevation: 0 - - Layout.preferredWidth: 0 - Layout.fillWidth: true - } - - Button { - id: cancelButton - text: "Cancel" - onClicked: { - styleBox.currentIndex = styleBox.styleIndex - settingsPopup.close() - } - - Material.background: "transparent" - Material.elevation: 0 - - Layout.preferredWidth: 0 - Layout.fillWidth: true - } - } } } - Popup { + Dialog { id: aboutDialog modal: true focus: true diff --git a/examples/quickcontrols2/gallery/gallery.qrc b/examples/quickcontrols2/gallery/gallery.qrc deleted file mode 100644 index 2dc78732..00000000 --- a/examples/quickcontrols2/gallery/gallery.qrc +++ /dev/null @@ -1,70 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>gallery.qml</file> - <file>qtquickcontrols2.conf</file> - <file>images/arrow.png</file> - <file>images/arrow@2x.png</file> - <file>images/arrow@3x.png</file> - <file>images/arrow@4x.png</file> - <file>images/arrows.png</file> - <file>images/arrows@2x.png</file> - <file>images/arrows@3x.png</file> - <file>images/arrows@4x.png</file> - <file>images/back.png</file> - <file>images/back@2x.png</file> - <file>images/back@3x.png</file> - <file>images/back@4x.png</file> - <file>images/drawer.png</file> - <file>images/drawer@2x.png</file> - <file>images/drawer@3x.png</file> - <file>images/drawer@4x.png</file> - <file>images/menu.png</file> - <file>images/menu@2x.png</file> - <file>images/menu@3x.png</file> - <file>images/menu@4x.png</file> - <file>images/+material/back.png</file> - <file>images/+material/back@2x.png</file> - <file>images/+material/back@3x.png</file> - <file>images/+material/back@4x.png</file> - <file>images/+material/drawer.png</file> - <file>images/+material/drawer@2x.png</file> - <file>images/+material/drawer@3x.png</file> - <file>images/+material/drawer@4x.png</file> - <file>images/+material/menu.png</file> - <file>images/+material/menu@2x.png</file> - <file>images/+material/menu@3x.png</file> - <file>images/+material/menu@4x.png</file> - <file>images/qt-logo.png</file> - <file>images/qt-logo@2x.png</file> - <file>images/qt-logo@3x.png</file> - <file>images/qt-logo@4x.png</file> - <file>pages/BusyIndicatorPage.qml</file> - <file>pages/ButtonPage.qml</file> - <file>pages/CheckBoxPage.qml</file> - <file>pages/ComboBoxPage.qml</file> - <file>pages/DialPage.qml</file> - <file>pages/DrawerPage.qml</file> - <file>pages/FramePage.qml</file> - <file>pages/GroupBoxPage.qml</file> - <file>pages/MenuPage.qml</file> - <file>pages/PageIndicatorPage.qml</file> - <file>pages/PopupPage.qml</file> - <file>pages/ProgressBarPage.qml</file> - <file>pages/RadioButtonPage.qml</file> - <file>pages/RangeSliderPage.qml</file> - <file>pages/ScrollablePage.qml</file> - <file>pages/ScrollBarPage.qml</file> - <file>pages/ScrollIndicatorPage.qml</file> - <file>pages/SliderPage.qml</file> - <file>pages/SpinBoxPage.qml</file> - <file>pages/StackViewPage.qml</file> - <file>pages/SwipeViewPage.qml</file> - <file>pages/SwitchPage.qml</file> - <file>pages/TabBarPage.qml</file> - <file>pages/TextAreaPage.qml</file> - <file>pages/TextFieldPage.qml</file> - <file>pages/ToolTipPage.qml</file> - <file>pages/TumblerPage.qml</file> - <file>pages/DelegatePage.qml</file> - </qresource> -</RCC> diff --git a/examples/quickcontrols2/gallery/pages/BusyIndicatorPage.qml b/examples/quickcontrols2/gallery/pages/BusyIndicatorPage.qml index 26950555..d9e5f788 100644 --- a/examples/quickcontrols2/gallery/pages/BusyIndicatorPage.qml +++ b/examples/quickcontrols2/gallery/pages/BusyIndicatorPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/ButtonPage.qml b/examples/quickcontrols2/gallery/pages/ButtonPage.qml index add29e83..7e945fa1 100644 --- a/examples/quickcontrols2/gallery/pages/ButtonPage.qml +++ b/examples/quickcontrols2/gallery/pages/ButtonPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/CheckBoxPage.qml b/examples/quickcontrols2/gallery/pages/CheckBoxPage.qml index ee8b14dc..8d48d32d 100644 --- a/examples/quickcontrols2/gallery/pages/CheckBoxPage.qml +++ b/examples/quickcontrols2/gallery/pages/CheckBoxPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/ComboBoxPage.qml b/examples/quickcontrols2/gallery/pages/ComboBoxPage.qml index 66fb10dd..c800ba73 100644 --- a/examples/quickcontrols2/gallery/pages/ComboBoxPage.qml +++ b/examples/quickcontrols2/gallery/pages/ComboBoxPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/DelegatePage.qml b/examples/quickcontrols2/gallery/pages/DelegatePage.qml index 3d175fd8..525487d1 100644 --- a/examples/quickcontrols2/gallery/pages/DelegatePage.qml +++ b/examples/quickcontrols2/gallery/pages/DelegatePage.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Pane { padding: 0 @@ -70,17 +70,17 @@ Pane { text: labelText width: parent.width - onClicked: if (swipe.complete) view.model.remove(ourIndex) - Component { id: removeComponent Rectangle { - color: swipeDelegate.swipe.complete && swipeDelegate.pressed ? "#333" : "#444" + color: SwipeDelegate.pressed ? "#333" : "#444" width: parent.width height: parent.height clip: true + SwipeDelegate.onClicked: view.model.remove(ourIndex) + Label { font.pixelSize: swipeDelegate.font.pixelSize text: "Remove" diff --git a/examples/quickcontrols2/gallery/pages/DialPage.qml b/examples/quickcontrols2/gallery/pages/DialPage.qml index 9f07c11e..b60fa032 100644 --- a/examples/quickcontrols2/gallery/pages/DialPage.qml +++ b/examples/quickcontrols2/gallery/pages/DialPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/DrawerPage.qml b/examples/quickcontrols2/gallery/pages/DrawerPage.qml index f4a7d272..9e77223c 100644 --- a/examples/quickcontrols2/gallery/pages/DrawerPage.qml +++ b/examples/quickcontrols2/gallery/pages/DrawerPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Pane { id: pane @@ -66,7 +66,7 @@ Pane { } Image { - source: "qrc:/images/arrow.png" + source: "../images/arrow.png" anchors.left: parent.left anchors.bottom: parent.bottom } diff --git a/examples/quickcontrols2/gallery/pages/FramePage.qml b/examples/quickcontrols2/gallery/pages/FramePage.qml index 51b640c1..b2d24dff 100644 --- a/examples/quickcontrols2/gallery/pages/FramePage.qml +++ b/examples/quickcontrols2/gallery/pages/FramePage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/GroupBoxPage.qml b/examples/quickcontrols2/gallery/pages/GroupBoxPage.qml index b0db5374..c4ceb45d 100644 --- a/examples/quickcontrols2/gallery/pages/GroupBoxPage.qml +++ b/examples/quickcontrols2/gallery/pages/GroupBoxPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/MenuPage.qml b/examples/quickcontrols2/gallery/pages/MenuPage.qml index 1e975bd0..49e6da07 100644 --- a/examples/quickcontrols2/gallery/pages/MenuPage.qml +++ b/examples/quickcontrols2/gallery/pages/MenuPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/PageIndicatorPage.qml b/examples/quickcontrols2/gallery/pages/PageIndicatorPage.qml index e7f7e251..43982b43 100644 --- a/examples/quickcontrols2/gallery/pages/PageIndicatorPage.qml +++ b/examples/quickcontrols2/gallery/pages/PageIndicatorPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/PopupPage.qml b/examples/quickcontrols2/gallery/pages/PopupPage.qml index 66c46143..ac3b02b7 100644 --- a/examples/quickcontrols2/gallery/pages/PopupPage.qml +++ b/examples/quickcontrols2/gallery/pages/PopupPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page @@ -62,7 +62,7 @@ ScrollablePage { anchors.horizontalCenter: parent.horizontalCenter width: Math.max(implicitWidth, Math.min(implicitWidth * 2, page.availableWidth / 3)) - onClicked: settingsPopup.open() + onClicked: settingsDialog.open() } } } diff --git a/examples/quickcontrols2/gallery/pages/ProgressBarPage.qml b/examples/quickcontrols2/gallery/pages/ProgressBarPage.qml index 92f26dd0..1548192f 100644 --- a/examples/quickcontrols2/gallery/pages/ProgressBarPage.qml +++ b/examples/quickcontrols2/gallery/pages/ProgressBarPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/RadioButtonPage.qml b/examples/quickcontrols2/gallery/pages/RadioButtonPage.qml index 0cc1f0bd..452d0425 100644 --- a/examples/quickcontrols2/gallery/pages/RadioButtonPage.qml +++ b/examples/quickcontrols2/gallery/pages/RadioButtonPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/RangeSliderPage.qml b/examples/quickcontrols2/gallery/pages/RangeSliderPage.qml index 62cbeb88..6a74e348 100644 --- a/examples/quickcontrols2/gallery/pages/RangeSliderPage.qml +++ b/examples/quickcontrols2/gallery/pages/RangeSliderPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/ScrollBarPage.qml b/examples/quickcontrols2/gallery/pages/ScrollBarPage.qml index f8f617d7..17be84e6 100644 --- a/examples/quickcontrols2/gallery/pages/ScrollBarPage.qml +++ b/examples/quickcontrols2/gallery/pages/ScrollBarPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Flickable { id: flickable @@ -67,7 +67,7 @@ Flickable { Image { rotation: 90 - source: "qrc:/images/arrows.png" + source: "../images/arrows.png" anchors.horizontalCenter: parent.horizontalCenter } } diff --git a/examples/quickcontrols2/gallery/pages/ScrollIndicatorPage.qml b/examples/quickcontrols2/gallery/pages/ScrollIndicatorPage.qml index d76d2de3..f7c23a06 100644 --- a/examples/quickcontrols2/gallery/pages/ScrollIndicatorPage.qml +++ b/examples/quickcontrols2/gallery/pages/ScrollIndicatorPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Flickable { id: flickable @@ -67,7 +67,7 @@ Flickable { Image { rotation: 90 - source: "qrc:/images/arrows.png" + source: "../images/arrows.png" anchors.horizontalCenter: parent.horizontalCenter } } diff --git a/examples/quickcontrols2/gallery/pages/SliderPage.qml b/examples/quickcontrols2/gallery/pages/SliderPage.qml index d9853c22..03cb7696 100644 --- a/examples/quickcontrols2/gallery/pages/SliderPage.qml +++ b/examples/quickcontrols2/gallery/pages/SliderPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/SpinBoxPage.qml b/examples/quickcontrols2/gallery/pages/SpinBoxPage.qml index 2b3664cf..c75982c2 100644 --- a/examples/quickcontrols2/gallery/pages/SpinBoxPage.qml +++ b/examples/quickcontrols2/gallery/pages/SpinBoxPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/StackViewPage.qml b/examples/quickcontrols2/gallery/pages/StackViewPage.qml index 4e44c3c8..d99a4b93 100644 --- a/examples/quickcontrols2/gallery/pages/StackViewPage.qml +++ b/examples/quickcontrols2/gallery/pages/StackViewPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 StackView { id: stackView diff --git a/examples/quickcontrols2/gallery/pages/SwipeViewPage.qml b/examples/quickcontrols2/gallery/pages/SwipeViewPage.qml index d0b0486c..dedacac4 100644 --- a/examples/quickcontrols2/gallery/pages/SwipeViewPage.qml +++ b/examples/quickcontrols2/gallery/pages/SwipeViewPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Pane { id: pane @@ -69,7 +69,7 @@ Pane { } Image { - source: "qrc:/images/arrows.png" + source: "../images/arrows.png" anchors.horizontalCenter: parent.horizontalCenter } } diff --git a/examples/quickcontrols2/gallery/pages/SwitchPage.qml b/examples/quickcontrols2/gallery/pages/SwitchPage.qml index 1315268d..ccaa4e1e 100644 --- a/examples/quickcontrols2/gallery/pages/SwitchPage.qml +++ b/examples/quickcontrols2/gallery/pages/SwitchPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/TabBarPage.qml b/examples/quickcontrols2/gallery/pages/TabBarPage.qml index 1b5bdb9b..818cccef 100644 --- a/examples/quickcontrols2/gallery/pages/TabBarPage.qml +++ b/examples/quickcontrols2/gallery/pages/TabBarPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Page { id: page @@ -69,7 +69,7 @@ Page { } Image { - source: "qrc:/images/arrows.png" + source: "../images/arrows.png" anchors.horizontalCenter: parent.horizontalCenter } } diff --git a/examples/quickcontrols2/gallery/pages/TextAreaPage.qml b/examples/quickcontrols2/gallery/pages/TextAreaPage.qml index ca28e2b7..97669f2f 100644 --- a/examples/quickcontrols2/gallery/pages/TextAreaPage.qml +++ b/examples/quickcontrols2/gallery/pages/TextAreaPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/TextFieldPage.qml b/examples/quickcontrols2/gallery/pages/TextFieldPage.qml index 9092e10d..9917da33 100644 --- a/examples/quickcontrols2/gallery/pages/TextFieldPage.qml +++ b/examples/quickcontrols2/gallery/pages/TextFieldPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/ToolTipPage.qml b/examples/quickcontrols2/gallery/pages/ToolTipPage.qml index e0f769eb..98ecd92e 100644 --- a/examples/quickcontrols2/gallery/pages/ToolTipPage.qml +++ b/examples/quickcontrols2/gallery/pages/ToolTipPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page diff --git a/examples/quickcontrols2/gallery/pages/TumblerPage.qml b/examples/quickcontrols2/gallery/pages/TumblerPage.qml index d12cc999..3b290dcb 100644 --- a/examples/quickcontrols2/gallery/pages/TumblerPage.qml +++ b/examples/quickcontrols2/gallery/pages/TumblerPage.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ScrollablePage { id: page @@ -57,7 +57,6 @@ ScrollablePage { Tumbler { model: 10 - visibleItemCount: 5 anchors.horizontalCenter: parent.horizontalCenter } } diff --git a/examples/quickcontrols2/gallery/qtquickcontrols2.conf b/examples/quickcontrols2/gallery/qtquickcontrols2.conf index ce348f2e..da1a8f41 100644 --- a/examples/quickcontrols2/gallery/qtquickcontrols2.conf +++ b/examples/quickcontrols2/gallery/qtquickcontrols2.conf @@ -1,8 +1,8 @@ [Material] Primary=#41cd52 Accent=#41cd52 -Theme=Light +Theme=System [Universal] Accent=#41cd52 -Theme=Light +Theme=System |