From 5805fa6ade79e9591e9870350e375ea9cfb39ce4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 14 Dec 2015 19:06:53 +0100 Subject: Add Gallery example Task-number: QTBUG-49941 Change-Id: I7bd6b25e12a6e90ba637231790b9a2c7a92bb821 Reviewed-by: Mitch Curtis --- .gitignore | 2 + examples/controls/controls.pro | 3 + examples/controls/gallery/gallery.cpp | 83 +++++ examples/controls/gallery/gallery.pro | 15 + examples/controls/gallery/gallery.qml | 339 +++++++++++++++++++++ examples/controls/gallery/gallery.qrc | 55 ++++ examples/controls/gallery/images/arrow.png | Bin 0 -> 568 bytes examples/controls/gallery/images/arrow@2x.png | Bin 0 -> 1011 bytes examples/controls/gallery/images/arrow@3x.png | Bin 0 -> 1471 bytes examples/controls/gallery/images/arrow@4x.png | Bin 0 -> 1922 bytes examples/controls/gallery/images/arrows.png | Bin 0 -> 658 bytes examples/controls/gallery/images/arrows@2x.png | Bin 0 -> 1077 bytes examples/controls/gallery/images/arrows@3x.png | Bin 0 -> 1595 bytes examples/controls/gallery/images/arrows@4x.png | Bin 0 -> 1994 bytes examples/controls/gallery/images/drawer.png | Bin 0 -> 2839 bytes examples/controls/gallery/images/drawer@2x.png | Bin 0 -> 2868 bytes examples/controls/gallery/images/drawer@3x.png | Bin 0 -> 2906 bytes examples/controls/gallery/images/drawer@4x.png | Bin 0 -> 2951 bytes examples/controls/gallery/images/menu.png | Bin 0 -> 2876 bytes examples/controls/gallery/images/menu@2x.png | Bin 0 -> 2952 bytes examples/controls/gallery/images/menu@3x.png | Bin 0 -> 3105 bytes examples/controls/gallery/images/menu@4x.png | Bin 0 -> 3183 bytes examples/controls/gallery/images/qt-logo.png | Bin 0 -> 5914 bytes examples/controls/gallery/images/qt-logo@2x.png | Bin 0 -> 9158 bytes examples/controls/gallery/images/qt-logo@3x.png | Bin 0 -> 12452 bytes examples/controls/gallery/images/qt-logo@4x.png | Bin 0 -> 16461 bytes .../controls/gallery/pages/BusyIndicatorPage.qml | 65 ++++ examples/controls/gallery/pages/ButtonPage.qml | 89 ++++++ examples/controls/gallery/pages/CheckBoxPage.qml | 91 ++++++ examples/controls/gallery/pages/ComboBoxPage.qml | 64 ++++ examples/controls/gallery/pages/DialPage.qml | 63 ++++ examples/controls/gallery/pages/DrawerPage.qml | 72 +++++ examples/controls/gallery/pages/FramePage.qml | 80 +++++ examples/controls/gallery/pages/GroupBoxPage.qml | 81 +++++ .../controls/gallery/pages/ItemDelegatePage.qml | 88 ++++++ examples/controls/gallery/pages/LabelPage.qml | 65 ++++ examples/controls/gallery/pages/MenuPage.qml | 66 ++++ .../controls/gallery/pages/PageIndicatorPage.qml | 63 ++++ examples/controls/gallery/pages/PanePage.qml | 53 ++++ examples/controls/gallery/pages/PopupPage.qml | 67 ++++ .../controls/gallery/pages/ProgressBarPage.qml | 73 +++++ .../controls/gallery/pages/RadioButtonPage.qml | 90 ++++++ .../controls/gallery/pages/RangeSliderPage.qml | 67 ++++ examples/controls/gallery/pages/ScrollBarPage.qml | 76 +++++ .../controls/gallery/pages/ScrollIndicatorPage.qml | 76 +++++ examples/controls/gallery/pages/SliderPage.qml | 66 ++++ examples/controls/gallery/pages/SpinBoxPage.qml | 67 ++++ examples/controls/gallery/pages/StackViewPage.qml | 83 +++++ examples/controls/gallery/pages/SwipeViewPage.qml | 84 +++++ examples/controls/gallery/pages/SwitchPage.qml | 90 ++++++ examples/controls/gallery/pages/TabBarPage.qml | 96 ++++++ examples/controls/gallery/pages/TextAreaPage.qml | 61 ++++ examples/controls/gallery/pages/TextFieldPage.qml | 66 ++++ examples/controls/gallery/pages/ToolBarPage.qml | 55 ++++ examples/controls/gallery/pages/TumblerPage.qml | 63 ++++ examples/controls/gallery/qtlabscontrols.conf | 10 + examples/examples.pro | 3 + 57 files changed, 2630 insertions(+) create mode 100644 examples/controls/controls.pro create mode 100644 examples/controls/gallery/gallery.cpp create mode 100644 examples/controls/gallery/gallery.pro create mode 100644 examples/controls/gallery/gallery.qml create mode 100644 examples/controls/gallery/gallery.qrc create mode 100644 examples/controls/gallery/images/arrow.png create mode 100644 examples/controls/gallery/images/arrow@2x.png create mode 100644 examples/controls/gallery/images/arrow@3x.png create mode 100644 examples/controls/gallery/images/arrow@4x.png create mode 100644 examples/controls/gallery/images/arrows.png create mode 100644 examples/controls/gallery/images/arrows@2x.png create mode 100644 examples/controls/gallery/images/arrows@3x.png create mode 100644 examples/controls/gallery/images/arrows@4x.png create mode 100644 examples/controls/gallery/images/drawer.png create mode 100644 examples/controls/gallery/images/drawer@2x.png create mode 100644 examples/controls/gallery/images/drawer@3x.png create mode 100644 examples/controls/gallery/images/drawer@4x.png create mode 100644 examples/controls/gallery/images/menu.png create mode 100644 examples/controls/gallery/images/menu@2x.png create mode 100644 examples/controls/gallery/images/menu@3x.png create mode 100644 examples/controls/gallery/images/menu@4x.png create mode 100644 examples/controls/gallery/images/qt-logo.png create mode 100644 examples/controls/gallery/images/qt-logo@2x.png create mode 100644 examples/controls/gallery/images/qt-logo@3x.png create mode 100644 examples/controls/gallery/images/qt-logo@4x.png create mode 100644 examples/controls/gallery/pages/BusyIndicatorPage.qml create mode 100644 examples/controls/gallery/pages/ButtonPage.qml create mode 100644 examples/controls/gallery/pages/CheckBoxPage.qml create mode 100644 examples/controls/gallery/pages/ComboBoxPage.qml create mode 100644 examples/controls/gallery/pages/DialPage.qml create mode 100644 examples/controls/gallery/pages/DrawerPage.qml create mode 100644 examples/controls/gallery/pages/FramePage.qml create mode 100644 examples/controls/gallery/pages/GroupBoxPage.qml create mode 100644 examples/controls/gallery/pages/ItemDelegatePage.qml create mode 100644 examples/controls/gallery/pages/LabelPage.qml create mode 100644 examples/controls/gallery/pages/MenuPage.qml create mode 100644 examples/controls/gallery/pages/PageIndicatorPage.qml create mode 100644 examples/controls/gallery/pages/PanePage.qml create mode 100644 examples/controls/gallery/pages/PopupPage.qml create mode 100644 examples/controls/gallery/pages/ProgressBarPage.qml create mode 100644 examples/controls/gallery/pages/RadioButtonPage.qml create mode 100644 examples/controls/gallery/pages/RangeSliderPage.qml create mode 100644 examples/controls/gallery/pages/ScrollBarPage.qml create mode 100644 examples/controls/gallery/pages/ScrollIndicatorPage.qml create mode 100644 examples/controls/gallery/pages/SliderPage.qml create mode 100644 examples/controls/gallery/pages/SpinBoxPage.qml create mode 100644 examples/controls/gallery/pages/StackViewPage.qml create mode 100644 examples/controls/gallery/pages/SwipeViewPage.qml create mode 100644 examples/controls/gallery/pages/SwitchPage.qml create mode 100644 examples/controls/gallery/pages/TabBarPage.qml create mode 100644 examples/controls/gallery/pages/TextAreaPage.qml create mode 100644 examples/controls/gallery/pages/TextFieldPage.qml create mode 100644 examples/controls/gallery/pages/ToolBarPage.qml create mode 100644 examples/controls/gallery/pages/TumblerPage.qml create mode 100644 examples/controls/gallery/qtlabscontrols.conf create mode 100644 examples/examples.pro diff --git a/.gitignore b/.gitignore index ae1ff1aa..93854f17 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ /lib /mkspecs +/examples/controls/gallery/gallery + /tests/auto/accessibility/tst_accessibility /tests/auto/activeFocusOnTab/tst_activeFocusOnTab /tests/auto/applicationwindow/tst_applicationwindow diff --git a/examples/controls/controls.pro b/examples/controls/controls.pro new file mode 100644 index 00000000..889077f2 --- /dev/null +++ b/examples/controls/controls.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +SUBDIRS += \ + gallery diff --git a/examples/controls/gallery/gallery.cpp b/examples/controls/gallery/gallery.cpp new file mode 100644 index 00000000..5b28a6ce --- /dev/null +++ b/examples/controls/gallery/gallery.cpp @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include + +class GalleryApplication : public QGuiApplication +{ + Q_OBJECT + +public: + GalleryApplication(int &argc, char *argv[]) : QGuiApplication(argc, argv) + { + setApplicationName("Gallery"); + setOrganizationName("QtProject"); + } + +public slots: + void restart() + { + QProcess::startDetached(applicationFilePath()); + quit(); + } +}; + +int main(int argc, char *argv[]) +{ + QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + GalleryApplication app(argc, argv); + + QSettings settings; + qputenv("QT_LABS_CONTROLS_STYLE", settings.value("style").toByteArray()); + + QQmlApplicationEngine engine; + engine.rootContext()->setContextProperty("app", &app); + engine.load(QUrl("qrc:/gallery.qml")); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); +} + +#include "gallery.moc" diff --git a/examples/controls/gallery/gallery.pro b/examples/controls/gallery/gallery.pro new file mode 100644 index 00000000..c31529b7 --- /dev/null +++ b/examples/controls/gallery/gallery.pro @@ -0,0 +1,15 @@ +TEMPLATE = app +TARGET = gallery +QT += quick + +SOURCES += \ + gallery.cpp + +OTHER_FILES += \ + gallery.qml + +RESOURCES += \ + gallery.qrc + +target.path = $$[QT_INSTALL_EXAMPLES]/qtlabscontrols/gallery +INSTALLS += target diff --git a/examples/controls/gallery/gallery.qml b/examples/controls/gallery/gallery.qml new file mode 100644 index 00000000..8007390d --- /dev/null +++ b/examples/controls/gallery/gallery.qml @@ -0,0 +1,339 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import QtQuick.Layouts 1.3 +import Qt.labs.controls 1.0 +import Qt.labs.controls.material 1.0 +import Qt.labs.controls.universal 1.0 +import Qt.labs.settings 1.0 + +ApplicationWindow { + id: window + width: 360 + height: 520 + visible: true + title: "Qt Labs Controls" + + Settings { + id: settings + property string style: "Universal" + } + + header: ToolBar { + RowLayout { + spacing: 20 + anchors.fill: parent + + ToolButton { + label: Image { + anchors.centerIn: parent + source: "qrc:/images/drawer.png" + } + onClicked: drawer.open() + } + + Label { + id: titleLabel + text: "Gallery" + font.pixelSize: 20 + elide: Label.ElideRight + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + Layout.fillWidth: true + } + + ToolButton { + label: Image { + anchors.centerIn: parent + source: "qrc:/images/menu.png" + } + onClicked: optionsMenu.open() + } + } + } + + Drawer { + id: drawer + + Pane { + padding: 0 + width: window.width / 3 * 2 + height: window.height + + 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() + } + } + + 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: "Drawer"; source: "qrc:/pages/DrawerPage.qml" } + ListElement { title: "Frame"; source: "qrc:/pages/FramePage.qml" } + ListElement { title: "GroupBox"; source: "qrc:/pages/GroupBoxPage.qml" } + ListElement { title: "ItemDelegate"; source: "qrc:/pages/ItemDelegatePage.qml" } + ListElement { title: "Label"; source: "qrc:/pages/LabelPage.qml" } + ListElement { title: "Menu"; source: "qrc:/pages/MenuPage.qml" } + ListElement { title: "PageIndicator"; source: "qrc:/pages/PageIndicatorPage.qml" } + ListElement { title: "Pane"; source: "qrc:/pages/PanePage.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: "ToolBar"; source: "qrc:/pages/ToolBarPage.qml" } + ListElement { title: "Tumbler"; source: "qrc:/pages/TumblerPage.qml" } + } + + ScrollIndicator.vertical: ScrollIndicator { } + } + } + onClicked: close() + } + + StackView { + id: stackView + anchors.fill: parent + + initialItem: Pane { + id: pane + anchors.fill: parent + + Image { + id: logo + width: pane.availableWidth / 2 + height: pane.availableHeight / 2 + anchors.centerIn: parent + anchors.verticalCenterOffset: -50 + fillMode: Image.PreserveAspectFit + source: "qrc:/images/qt-logo.png" + } + + Label { + color: "#26282a" + text: "Qt Labs Controls provides a set of controls that can be used to build complete interfaces in Qt Quick." + anchors.margins: 20 + anchors.top: logo.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: arrow.top + horizontalAlignment: Label.AlignHCenter + verticalAlignment: Label.AlignVCenter + wrapMode: Label.Wrap + } + + Image { + id: arrow + source: "qrc:/images/arrow.png" + anchors.left: parent.left + anchors.bottom: parent.bottom + } + } + } + + Popup { + id: settingsPopup + modal: true + focus: true + onPressedOutside: close() + + contentItem: Pane { + x: (window.width - width) / 2 + y: window.height / 6 + width: window.width / 3 * 2 + contentHeight: settingsColumn.implicitHeight + + Keys.onEscapePressed: settingsPopup.close() + + + ColumnLayout { + id: settingsColumn + spacing: 20 + anchors.fill: parent + + Label { + text: "Settings" + font.bold: true + } + + RowLayout { + spacing: 10 + + Label { + text: "Style:" + } + + ComboBox { + id: styleBox + property int styleIndex: -1 + model: ["Default", "Material", "Universal"] + Component.onCompleted: { + styleIndex = find(settings.style) + if (styleIndex !== -1) + currentIndex = styleIndex + } + Layout.fillWidth: true + } + } + + Label { + text: "Restart required" + opacity: restartButton.opacity + horizontalAlignment: Label.AlignHCenter + verticalAlignment: Label.AlignVCenter + Layout.fillWidth: true + Layout.fillHeight: true + } + + RowLayout { + spacing: 20 + + Button { + id: restartButton + text: "Restart" + opacity: styleBox.currentIndex !== styleBox.styleIndex ? 1.0 : 0.0 + onClicked: { + settings.style = styleBox.displayText + app.restart() + } + Layout.preferredWidth: 0 + Layout.fillWidth: true + } + + Button { + id: cancelButton + text: "Cancel" + onClicked: { + styleBox.currentIndex = styleBox.styleIndex + settingsPopup.close() + } + Layout.preferredWidth: 0 + Layout.fillWidth: true + } + } + } + } + } + + Popup { + id: aboutDialog + modal: true + focus: true + onPressedOutside: close() + + contentItem: Pane { + x: (window.width - width) / 2 + y: (window.height - height) / 2 + width: window.width / 3 * 2 + contentHeight: aboutColumn.implicitHeight + + Keys.onEscapePressed: aboutDialog.close() + + Column { + id: aboutColumn + + spacing: 20 + anchors.fill: parent + + Label { + text: "About" + font.bold: true + } + + Label { + width: parent.width + text: "The Qt Labs Controls module is a technology preview of the next generation user interface controls based on Qt Quick." + wrapMode: Label.Wrap + font.pixelSize: 12 + } + + Label { + width: parent.width + text: "In comparison to the desktop oriented Qt Quick Controls 1, the experimental Qt Labs " + + "Controls are an order of magnitude simpler, lighter and faster, and are primarily targeting embedded " + + "and mobile platforms." + wrapMode: Label.Wrap + font.pixelSize: 12 + } + } + } + } + + Menu { + id: optionsMenu + contentItem.x: contentItem.parent ? (contentItem.parent.width - contentItem.width) : 0 + + MenuItem { + text: "Settings" + onTriggered: settingsPopup.open() + } + MenuItem { + text: "About" + onTriggered: aboutDialog.open() + } + } +} diff --git a/examples/controls/gallery/gallery.qrc b/examples/controls/gallery/gallery.qrc new file mode 100644 index 00000000..def31294 --- /dev/null +++ b/examples/controls/gallery/gallery.qrc @@ -0,0 +1,55 @@ + + + gallery.qml + qtlabscontrols.conf + images/arrow.png + images/arrow@2x.png + images/arrow@3x.png + images/arrow@4x.png + images/arrows.png + images/arrows@2x.png + images/arrows@3x.png + images/arrows@4x.png + images/drawer.png + images/drawer@2x.png + images/drawer@3x.png + images/drawer@4x.png + images/menu.png + images/menu@2x.png + images/menu@3x.png + images/menu@4x.png + images/qt-logo.png + images/qt-logo@2x.png + images/qt-logo@3x.png + images/qt-logo@4x.png + pages/BusyIndicatorPage.qml + pages/ButtonPage.qml + pages/CheckBoxPage.qml + pages/ComboBoxPage.qml + pages/DialPage.qml + pages/DrawerPage.qml + pages/FramePage.qml + pages/GroupBoxPage.qml + pages/ItemDelegatePage.qml + pages/LabelPage.qml + pages/MenuPage.qml + pages/PageIndicatorPage.qml + pages/PanePage.qml + pages/PopupPage.qml + pages/ProgressBarPage.qml + pages/RadioButtonPage.qml + pages/RangeSliderPage.qml + pages/ScrollBarPage.qml + pages/ScrollIndicatorPage.qml + pages/SliderPage.qml + pages/SpinBoxPage.qml + pages/StackViewPage.qml + pages/SwipeViewPage.qml + pages/SwitchPage.qml + pages/TabBarPage.qml + pages/TextAreaPage.qml + pages/TextFieldPage.qml + pages/ToolBarPage.qml + pages/TumblerPage.qml + + diff --git a/examples/controls/gallery/images/arrow.png b/examples/controls/gallery/images/arrow.png new file mode 100644 index 00000000..f70788ad Binary files /dev/null and b/examples/controls/gallery/images/arrow.png differ diff --git a/examples/controls/gallery/images/arrow@2x.png b/examples/controls/gallery/images/arrow@2x.png new file mode 100644 index 00000000..c198b9e2 Binary files /dev/null and b/examples/controls/gallery/images/arrow@2x.png differ diff --git a/examples/controls/gallery/images/arrow@3x.png b/examples/controls/gallery/images/arrow@3x.png new file mode 100644 index 00000000..a3faf3c9 Binary files /dev/null and b/examples/controls/gallery/images/arrow@3x.png differ diff --git a/examples/controls/gallery/images/arrow@4x.png b/examples/controls/gallery/images/arrow@4x.png new file mode 100644 index 00000000..b628aa85 Binary files /dev/null and b/examples/controls/gallery/images/arrow@4x.png differ diff --git a/examples/controls/gallery/images/arrows.png b/examples/controls/gallery/images/arrows.png new file mode 100644 index 00000000..b9c9c1ae Binary files /dev/null and b/examples/controls/gallery/images/arrows.png differ diff --git a/examples/controls/gallery/images/arrows@2x.png b/examples/controls/gallery/images/arrows@2x.png new file mode 100644 index 00000000..898a495e Binary files /dev/null and b/examples/controls/gallery/images/arrows@2x.png differ diff --git a/examples/controls/gallery/images/arrows@3x.png b/examples/controls/gallery/images/arrows@3x.png new file mode 100644 index 00000000..960c7ed7 Binary files /dev/null and b/examples/controls/gallery/images/arrows@3x.png differ diff --git a/examples/controls/gallery/images/arrows@4x.png b/examples/controls/gallery/images/arrows@4x.png new file mode 100644 index 00000000..c57b88aa Binary files /dev/null and b/examples/controls/gallery/images/arrows@4x.png differ diff --git a/examples/controls/gallery/images/drawer.png b/examples/controls/gallery/images/drawer.png new file mode 100644 index 00000000..21ab51eb Binary files /dev/null and b/examples/controls/gallery/images/drawer.png differ diff --git a/examples/controls/gallery/images/drawer@2x.png b/examples/controls/gallery/images/drawer@2x.png new file mode 100644 index 00000000..8e23bf9e Binary files /dev/null and b/examples/controls/gallery/images/drawer@2x.png differ diff --git a/examples/controls/gallery/images/drawer@3x.png b/examples/controls/gallery/images/drawer@3x.png new file mode 100644 index 00000000..7f258dc9 Binary files /dev/null and b/examples/controls/gallery/images/drawer@3x.png differ diff --git a/examples/controls/gallery/images/drawer@4x.png b/examples/controls/gallery/images/drawer@4x.png new file mode 100644 index 00000000..826156f6 Binary files /dev/null and b/examples/controls/gallery/images/drawer@4x.png differ diff --git a/examples/controls/gallery/images/menu.png b/examples/controls/gallery/images/menu.png new file mode 100644 index 00000000..9852926f Binary files /dev/null and b/examples/controls/gallery/images/menu.png differ diff --git a/examples/controls/gallery/images/menu@2x.png b/examples/controls/gallery/images/menu@2x.png new file mode 100644 index 00000000..6c178701 Binary files /dev/null and b/examples/controls/gallery/images/menu@2x.png differ diff --git a/examples/controls/gallery/images/menu@3x.png b/examples/controls/gallery/images/menu@3x.png new file mode 100644 index 00000000..f5694751 Binary files /dev/null and b/examples/controls/gallery/images/menu@3x.png differ diff --git a/examples/controls/gallery/images/menu@4x.png b/examples/controls/gallery/images/menu@4x.png new file mode 100644 index 00000000..3fb8b7d4 Binary files /dev/null and b/examples/controls/gallery/images/menu@4x.png differ diff --git a/examples/controls/gallery/images/qt-logo.png b/examples/controls/gallery/images/qt-logo.png new file mode 100644 index 00000000..82aa59f3 Binary files /dev/null and b/examples/controls/gallery/images/qt-logo.png differ diff --git a/examples/controls/gallery/images/qt-logo@2x.png b/examples/controls/gallery/images/qt-logo@2x.png new file mode 100644 index 00000000..6aaef1d6 Binary files /dev/null and b/examples/controls/gallery/images/qt-logo@2x.png differ diff --git a/examples/controls/gallery/images/qt-logo@3x.png b/examples/controls/gallery/images/qt-logo@3x.png new file mode 100644 index 00000000..822c9a1e Binary files /dev/null and b/examples/controls/gallery/images/qt-logo@3x.png differ diff --git a/examples/controls/gallery/images/qt-logo@4x.png b/examples/controls/gallery/images/qt-logo@4x.png new file mode 100644 index 00000000..1d323845 Binary files /dev/null and b/examples/controls/gallery/images/qt-logo@4x.png differ diff --git a/examples/controls/gallery/pages/BusyIndicatorPage.qml b/examples/controls/gallery/pages/BusyIndicatorPage.qml new file mode 100644 index 00000000..5ee1cd63 --- /dev/null +++ b/examples/controls/gallery/pages/BusyIndicatorPage.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "BusyIndicator is used to indicate activity while content is being loaded," + + " or the UI is blocked waiting for a resource to become available." + } + + BusyIndicator { + readonly property int size: Math.min(pane.availableWidth, pane.availableHeight) / 5 + width: size + height: size + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/pages/ButtonPage.qml b/examples/controls/gallery/pages/ButtonPage.qml new file mode 100644 index 00000000..e251a346 --- /dev/null +++ b/examples/controls/gallery/pages/ButtonPage.qml @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Flickable { + id: flickable + contentHeight: pane.height + + readonly property int itemWidth: Math.max(button.implicitWidth, pane.availableWidth / 3) + + Pane { + id: pane + width: parent.width + + Column { + id: column + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "Button presents a push-button that can be pushed or clicked by the user. " + + "Buttons are normally used to perform an action, or to answer a question." + } + + Column { + spacing: 20 + anchors.horizontalCenter: parent.horizontalCenter + + Button { + text: "First" + width: itemWidth + } + Button { + id: button + text: "Second" + width: itemWidth + } + Button { + text: "Third" + enabled: false + width: itemWidth + } + } + } + } + + ScrollIndicator.vertical: ScrollIndicator { } +} diff --git a/examples/controls/gallery/pages/CheckBoxPage.qml b/examples/controls/gallery/pages/CheckBoxPage.qml new file mode 100644 index 00000000..65a70086 --- /dev/null +++ b/examples/controls/gallery/pages/CheckBoxPage.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Flickable { + id: flickable + contentHeight: pane.height + + readonly property int itemWidth: Math.max(box.implicitWidth, pane.availableWidth / 3) + + Pane { + id: pane + width: parent.width + + Column { + id: column + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "CheckBox presents an option button that can be toggled on or off. " + + "Check boxes are typically used to select one or more options from a set of options." + } + + Column { + spacing: 20 + anchors.horizontalCenter: parent.horizontalCenter + + CheckBox { + text: "First" + checked: true + width: itemWidth + } + CheckBox { + id: box + text: "Second" + width: itemWidth + } + CheckBox { + text: "Third" + checked: true + enabled: false + width: itemWidth + } + } + } + } + + ScrollIndicator.vertical: ScrollIndicator { } +} diff --git a/examples/controls/gallery/pages/ComboBoxPage.qml b/examples/controls/gallery/pages/ComboBoxPage.qml new file mode 100644 index 00000000..44295450 --- /dev/null +++ b/examples/controls/gallery/pages/ComboBoxPage.qml @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "ComboBox is a combined button and popup list. It provides means of presenting a " + + "list of options to the user in a way that takes up the minimum amount of screen space." + } + + ComboBox { + model: ["First", "Second", "Third"] + width: Math.max(implicitWidth, pane.availableWidth / 3) + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/pages/DialPage.qml b/examples/controls/gallery/pages/DialPage.qml new file mode 100644 index 00000000..8db5f08f --- /dev/null +++ b/examples/controls/gallery/pages/DialPage.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "The Dial is similar to a traditional dial knob that is found on devices such as " + + "stereos or industrial equipment. It allows the user to specify a value within a range." + } + + Dial { + value: 0.5 + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/pages/DrawerPage.qml b/examples/controls/gallery/pages/DrawerPage.qml new file mode 100644 index 00000000..fe6e07d3 --- /dev/null +++ b/examples/controls/gallery/pages/DrawerPage.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "Drawer provides a swipe-based side panel, similar to those often used " + + "in touch interfaces to provide a central location for navigation." + } + + Button { + text: "Open" + anchors.horizontalCenter: parent.horizontalCenter + width: Math.max(implicitWidth, pane.availableWidth / 3) + + onClicked: drawer.open() + } + } + + Image { + source: "qrc:/images/arrow.png" + anchors.left: parent.left + anchors.bottom: parent.bottom + } +} diff --git a/examples/controls/gallery/pages/FramePage.qml b/examples/controls/gallery/pages/FramePage.qml new file mode 100644 index 00000000..5c613fb5 --- /dev/null +++ b/examples/controls/gallery/pages/FramePage.qml @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "Frame is used to layout a logical group of controls together, within a visual frame." + } + + Frame { + width: parent.width + + Column { + spacing: 20 + anchors.fill: parent + + RadioButton { + text: "First" + checked: true + width: parent.width + } + RadioButton { + text: "Second" + width: parent.width + } + RadioButton { + text: "Third" + width: parent.width + } + } + } + } +} diff --git a/examples/controls/gallery/pages/GroupBoxPage.qml b/examples/controls/gallery/pages/GroupBoxPage.qml new file mode 100644 index 00000000..0d81418f --- /dev/null +++ b/examples/controls/gallery/pages/GroupBoxPage.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "GroupBox is used to layout a logical group of controls together, within a titled visual frame." + } + + GroupBox { + title: "Title" + width: parent.width + + Column { + spacing: 20 + anchors.fill: parent + + RadioButton { + text: "First" + checked: true + width: parent.width + } + RadioButton { + text: "Second" + width: parent.width + } + RadioButton { + text: "Third" + width: parent.width + } + } + } + } +} diff --git a/examples/controls/gallery/pages/ItemDelegatePage.qml b/examples/controls/gallery/pages/ItemDelegatePage.qml new file mode 100644 index 00000000..4837ceb7 --- /dev/null +++ b/examples/controls/gallery/pages/ItemDelegatePage.qml @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Flickable { + id: flickable + contentHeight: pane.height + + readonly property int itemWidth: Math.max(delegate.implicitWidth, pane.availableWidth / 3 * 2) + + Pane { + id: pane + width: parent.width + + Column { + id: column + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "ItemDelegate presents a standard view item. It can be used as a delegate in " + + "various views and controls, such as ListView and ComboBox." + } + + Column { + spacing: 20 + anchors.horizontalCenter: parent.horizontalCenter + + ItemDelegate { + text: "First" + width: itemWidth + } + ItemDelegate { + id: delegate + text: "Second" + width: itemWidth + } + ItemDelegate { + text: "Third" + width: itemWidth + } + } + } + } + + ScrollIndicator.vertical: ScrollIndicator { } +} diff --git a/examples/controls/gallery/pages/LabelPage.qml b/examples/controls/gallery/pages/LabelPage.qml new file mode 100644 index 00000000..1c9db20b --- /dev/null +++ b/examples/controls/gallery/pages/LabelPage.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "Label is an extended text label that has style-specific default colors " + + "and font. Like all other controls, Label supports also font inheritance " + + "and can have a visual background item." + } + + Label { + text: "Label" + font.pixelSize: 20 + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/pages/MenuPage.qml b/examples/controls/gallery/pages/MenuPage.qml new file mode 100644 index 00000000..a892ca7a --- /dev/null +++ b/examples/controls/gallery/pages/MenuPage.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "Menu can be used either as a context menu, or as a popup menu." + } + + Button { + id: button + text: "Open" + anchors.horizontalCenter: parent.horizontalCenter + width: Math.max(implicitWidth, pane.availableWidth / 3) + + onClicked: optionsMenu.open() + } + } +} diff --git a/examples/controls/gallery/pages/PageIndicatorPage.qml b/examples/controls/gallery/pages/PageIndicatorPage.qml new file mode 100644 index 00000000..ac24ba61 --- /dev/null +++ b/examples/controls/gallery/pages/PageIndicatorPage.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "PageIndicator is used to indicate the currently active page in a container of pages." + } + + PageIndicator { + count: 5 + currentIndex: 2 + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/pages/PanePage.qml b/examples/controls/gallery/pages/PanePage.qml new file mode 100644 index 00000000..cb73d155 --- /dev/null +++ b/examples/controls/gallery/pages/PanePage.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "Pane provides a background color that matches with the application style and theme. " + + "For example, this content is in a pane." + } +} diff --git a/examples/controls/gallery/pages/PopupPage.qml b/examples/controls/gallery/pages/PopupPage.qml new file mode 100644 index 00000000..19bd3ba0 --- /dev/null +++ b/examples/controls/gallery/pages/PopupPage.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "Popup is used to display modal or modeless content that overlays other " + + "application content. In this example, the settings are shown in a popup." + } + + Button { + id: button + text: "Open" + anchors.horizontalCenter: parent.horizontalCenter + width: Math.max(implicitWidth, pane.availableWidth / 3) + + onClicked: settingsPopup.open() + } + } +} diff --git a/examples/controls/gallery/pages/ProgressBarPage.qml b/examples/controls/gallery/pages/ProgressBarPage.qml new file mode 100644 index 00000000..946760e6 --- /dev/null +++ b/examples/controls/gallery/pages/ProgressBarPage.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + readonly property int itemWidth: Math.max(bar.implicitWidth, pane.availableWidth / 3) + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "ProgressBar indicates the progress of an operation. It can be set in an " + + "indeterminate mode to indicate that the length of the operation is unknown." + } + + ProgressBar { + id: bar + value: 0.5 + width: itemWidth + anchors.horizontalCenter: parent.horizontalCenter + } + + ProgressBar { + indeterminate: true + width: itemWidth + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/pages/RadioButtonPage.qml b/examples/controls/gallery/pages/RadioButtonPage.qml new file mode 100644 index 00000000..7141137d --- /dev/null +++ b/examples/controls/gallery/pages/RadioButtonPage.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Flickable { + id: flickable + contentHeight: pane.height + + readonly property int itemWidth: Math.max(button.implicitWidth, pane.availableWidth / 3) + + Pane { + id: pane + width: parent.width + + Column { + id: column + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "RadioButton presents an option button that can be toggled on or off. " + + "Radio buttons are typically used to select one option from a set of options." + } + + Column { + spacing: 20 + anchors.horizontalCenter: parent.horizontalCenter + + RadioButton { + text: "First" + width: itemWidth + } + RadioButton { + id: button + text: "Second" + checked: true + width: itemWidth + } + RadioButton { + text: "Third" + enabled: false + width: itemWidth + } + } + } + } + + ScrollIndicator.vertical: ScrollIndicator { } +} diff --git a/examples/controls/gallery/pages/RangeSliderPage.qml b/examples/controls/gallery/pages/RangeSliderPage.qml new file mode 100644 index 00000000..6eb6d5fb --- /dev/null +++ b/examples/controls/gallery/pages/RangeSliderPage.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + readonly property int itemWidth: Math.max(slider.implicitWidth, pane.availableWidth / 3) + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "RangeSlider is used to select a range specified by two values, by sliding each handle along a track." + } + + RangeSlider { + id: slider + first.value: 0.25 + second.value: 0.75 + width: itemWidth + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/pages/ScrollBarPage.qml b/examples/controls/gallery/pages/ScrollBarPage.qml new file mode 100644 index 00000000..8fa2e7c5 --- /dev/null +++ b/examples/controls/gallery/pages/ScrollBarPage.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Flickable { + id: flickable + + contentHeight: pane.height + + Pane { + id: pane + width: flickable.width + height: flickable.height * 1.25 + + Column { + id: column + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "ScrollBar is an interactive bar that can be used to scroll to a specific position. " + + "A scroll bar can be either vertical or horizontal, and can be attached to any Flickable, " + + "such as ListView and GridView." + } + + Image { + rotation: 90 + source: "qrc:/images/arrows.png" + anchors.horizontalCenter: parent.horizontalCenter + } + } + } + + ScrollBar.vertical: ScrollBar { } +} diff --git a/examples/controls/gallery/pages/ScrollIndicatorPage.qml b/examples/controls/gallery/pages/ScrollIndicatorPage.qml new file mode 100644 index 00000000..61cb0f62 --- /dev/null +++ b/examples/controls/gallery/pages/ScrollIndicatorPage.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Flickable { + id: flickable + + contentHeight: pane.height + + Pane { + id: pane + width: flickable.width + height: flickable.height * 1.25 + + Column { + id: column + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "ScrollIndicator is a non-interactive indicator that indicates the current scroll position. " + + "A scroll indicator can be either vertical or horizontal, and can be attached to any Flickable, " + + "such as ListView and GridView." + } + + Image { + rotation: 90 + source: "qrc:/images/arrows.png" + anchors.horizontalCenter: parent.horizontalCenter + } + } + } + + ScrollIndicator.vertical: ScrollIndicator { } +} diff --git a/examples/controls/gallery/pages/SliderPage.qml b/examples/controls/gallery/pages/SliderPage.qml new file mode 100644 index 00000000..bbe09a3e --- /dev/null +++ b/examples/controls/gallery/pages/SliderPage.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + readonly property int itemWidth: Math.max(slider.implicitWidth, pane.availableWidth / 3) + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "Slider is used to select a value by sliding a handle along a track." + } + + Slider { + id: slider + value: 0.5 + width: itemWidth + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/pages/SpinBoxPage.qml b/examples/controls/gallery/pages/SpinBoxPage.qml new file mode 100644 index 00000000..325b6ce7 --- /dev/null +++ b/examples/controls/gallery/pages/SpinBoxPage.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + readonly property int itemWidth: Math.max(box.implicitWidth, pane.availableWidth / 3) + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "SpinBox allows the user to choose an integer value by clicking the up or down indicator buttons, " + + "by pressing up or down on the keyboard, or by entering a text value in the input field." + } + + SpinBox { + id: box + value: 50 + width: itemWidth + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/pages/StackViewPage.qml b/examples/controls/gallery/pages/StackViewPage.qml new file mode 100644 index 00000000..d8ac093e --- /dev/null +++ b/examples/controls/gallery/pages/StackViewPage.qml @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +StackView { + id: stackView + initialItem: page + + Component { + id: page + + Pane { + id: pane + width: parent ? parent.width : 0 // TODO: fix null parent on destruction + + Column { + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "StackView provides a stack-based navigation model." + } + + Button { + id: button + text: "Push" + anchors.horizontalCenter: parent.horizontalCenter + width: Math.max(button.implicitWidth, pane.availableWidth / 3) + onClicked: stackView.push(page) + } + + Button { + text: "Pop" + enabled: stackView.depth > 1 + width: Math.max(button.implicitWidth, pane.availableWidth / 3) + anchors.horizontalCenter: parent.horizontalCenter + onClicked: stackView.pop() + } + } + } + } +} diff --git a/examples/controls/gallery/pages/SwipeViewPage.qml b/examples/controls/gallery/pages/SwipeViewPage.qml new file mode 100644 index 00000000..9036a22a --- /dev/null +++ b/examples/controls/gallery/pages/SwipeViewPage.qml @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + SwipeView { + id: view + currentIndex: 1 + anchors.fill: parent + + Repeater { + model: 3 + + Pane { + width: view.width + height: view.height + + Column { + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "SwipeView provides a swipe-based navigation model." + } + + Image { + source: "qrc:/images/arrows.png" + anchors.horizontalCenter: parent.horizontalCenter + } + } + } + } + } + + PageIndicator { + count: view.count + currentIndex: view.currentIndex + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + } +} diff --git a/examples/controls/gallery/pages/SwitchPage.qml b/examples/controls/gallery/pages/SwitchPage.qml new file mode 100644 index 00000000..72bd93e6 --- /dev/null +++ b/examples/controls/gallery/pages/SwitchPage.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Flickable { + id: flickable + contentHeight: pane.height + + readonly property int itemWidth: Math.max(swtch.implicitWidth, pane.availableWidth / 3) + + Pane { + id: pane + width: parent.width + + Column { + id: column + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "Switch is an option button that can be dragged or toggled on or off. " + + "Switches are typically used to select between two states." + } + + Column { + spacing: 20 + anchors.horizontalCenter: parent.horizontalCenter + + Switch { + text: "First" + width: itemWidth + } + Switch { + id: swtch + text: "Second" + checked: true + width: itemWidth + } + Switch { + text: "Third" + enabled: false + width: itemWidth + } + } + } + } + + ScrollIndicator.vertical: ScrollIndicator { } +} diff --git a/examples/controls/gallery/pages/TabBarPage.qml b/examples/controls/gallery/pages/TabBarPage.qml new file mode 100644 index 00000000..6cf2c584 --- /dev/null +++ b/examples/controls/gallery/pages/TabBarPage.qml @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + padding: 0 + + SwipeView { + id: swipeView + anchors.fill: parent + anchors.bottomMargin: tabBar.height + currentIndex: tabBar.currentIndex + + Repeater { + model: 3 + + Pane { + width: swipeView.width + height: swipeView.height + + Column { + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "TabBar provides a tab-based navigation model." + } + + Image { + source: "qrc:/images/arrows.png" + anchors.horizontalCenter: parent.horizontalCenter + } + } + } + } + } + + TabBar { + id: tabBar + width: parent.width + anchors.bottom: parent.bottom + currentIndex: swipeView.currentIndex + + TabButton { + text: "First" + } + TabButton { + text: "Second" + } + TabButton { + text: "Third" + } + } +} diff --git a/examples/controls/gallery/pages/TextAreaPage.qml b/examples/controls/gallery/pages/TextAreaPage.qml new file mode 100644 index 00000000..f69e0cd5 --- /dev/null +++ b/examples/controls/gallery/pages/TextAreaPage.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Flickable { + id: flickable + contentHeight: pane.height + + Pane { + id: pane + width: parent.width + + TextArea { + anchors.fill: parent + + wrapMode: TextArea.Wrap + text: "TextArea is a multi-line text editor." + } + } + + ScrollIndicator.vertical: ScrollIndicator { } +} diff --git a/examples/controls/gallery/pages/TextFieldPage.qml b/examples/controls/gallery/pages/TextFieldPage.qml new file mode 100644 index 00000000..ed4799bb --- /dev/null +++ b/examples/controls/gallery/pages/TextFieldPage.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + readonly property int itemWidth: Math.max(field.implicitWidth, pane.availableWidth / 3) + + Column { + spacing: 40 + anchors.fill: parent + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "TextField is a single-line text editor." + } + + TextField { + id: field + placeholderText: "TextField" + width: itemWidth + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/pages/ToolBarPage.qml b/examples/controls/gallery/pages/ToolBarPage.qml new file mode 100644 index 00000000..3267a709 --- /dev/null +++ b/examples/controls/gallery/pages/ToolBarPage.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import QtQuick.Layouts 1.3 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "ToolBar is a container of application-wide and context sensitive actions and " + + "controls, such as navigation buttons and search fields. The toolbar above is " + + "placed as the header of the application's window." + } +} diff --git a/examples/controls/gallery/pages/TumblerPage.qml b/examples/controls/gallery/pages/TumblerPage.qml new file mode 100644 index 00000000..205ae5aa --- /dev/null +++ b/examples/controls/gallery/pages/TumblerPage.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import Qt.labs.controls 1.0 + +Pane { + id: pane + + Column { + spacing: 40 + width: parent.width + + Label { + width: parent.width + wrapMode: Label.Wrap + text: "Tumbler is used to select a value by spinning a wheel." + } + + Tumbler { + model: 10 + visibleItemCount: 5 + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/controls/gallery/qtlabscontrols.conf b/examples/controls/gallery/qtlabscontrols.conf new file mode 100644 index 00000000..80041052 --- /dev/null +++ b/examples/controls/gallery/qtlabscontrols.conf @@ -0,0 +1,10 @@ +[Controls] +Style=Universal + +[Material] +Accent=LightGreen +Theme=Light + +[Universal] +Accent=Green +Theme=Light diff --git a/examples/examples.pro b/examples/examples.pro new file mode 100644 index 00000000..ab3cd2b2 --- /dev/null +++ b/examples/examples.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +SUBDIRS += \ + controls -- cgit v1.2.3