diff options
Diffstat (limited to 'tests/manual')
28 files changed, 494 insertions, 107 deletions
diff --git a/tests/manual/buttons/ButtonLoader.qml b/tests/manual/buttons/ButtonLoader.qml new file mode 100644 index 00000000..8793d98f --- /dev/null +++ b/tests/manual/buttons/ButtonLoader.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite 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.8 +import QtQuick.Controls 2.1 + +Item { + id: root + implicitWidth: activeButton.implicitWidth + implicitHeight: activeButton.implicitHeight + + property bool round: false + + property string text + property bool flat + property bool hoverEnabled + property bool highlighted + property bool checked + property var down: undefined + + property AbstractButton activeButton: round ? roundButton : button + + Button { + id: button + visible: !round + text: root.text + flat: root.flat + hoverEnabled: root.hoverEnabled + highlighted: root.highlighted + checked: root.checked + down: root.down + enabled: root.enabled + } + + RoundButton { + id: roundButton + visible: round + text: "\u2713" + flat: root.flat + hoverEnabled: root.hoverEnabled + highlighted: root.highlighted + checked: root.checked + down: root.down + enabled: root.enabled + + Label { + text: root.text + font.pixelSize: roundButton.contentItem.font.pixelSize * 0.5 + anchors.top: parent.bottom + anchors.topMargin: 2 + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/tests/manual/buttons/buttons.cpp b/tests/manual/buttons/buttons.cpp new file mode 100644 index 00000000..2f73e3d2 --- /dev/null +++ b/tests/manual/buttons/buttons.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite 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 <QGuiApplication> +#include <QQmlApplicationEngine> + +int main(int argc, char *argv[]) +{ + QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl("qrc:/buttons.qml")); + + return app.exec(); +} diff --git a/tests/manual/buttons/buttons.pro b/tests/manual/buttons/buttons.pro new file mode 100644 index 00000000..2cb1c14c --- /dev/null +++ b/tests/manual/buttons/buttons.pro @@ -0,0 +1,6 @@ +TEMPLATE = app +TARGET = buttons +QT += qml quickcontrols2 + +SOURCES += buttons.cpp +RESOURCES += $$files(*.qml) diff --git a/tests/manual/buttons/buttons.qml b/tests/manual/buttons/buttons.qml new file mode 100644 index 00000000..b3aba775 --- /dev/null +++ b/tests/manual/buttons/buttons.qml @@ -0,0 +1,140 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite 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.Controls 2.1 +import QtQuick.Controls.Material 2.1 +import QtQuick.Controls.Universal 2.1 + +ApplicationWindow { + id: window + visible: true + title: "Buttons" + + Component.onCompleted: { + var pane = repeater.itemAt(0) + width = pane.implicitWidth * 2 + flickable.leftMargin + flickable.rightMargin + flow.spacing + height = header.height + pane.implicitHeight * 2 + flickable.topMargin + flickable.bottomMargin + flow.spacing + } + + header: ToolBar { + Row { + spacing: 20 + anchors.right: parent.right + CheckBox { + id: hoverBox + text: "Hover" + checked: true + } + CheckBox { + id: roundBox + text: "Round" + checked: false + } + } + } + + Flickable { + id: flickable + anchors.fill: parent + + topMargin: 40 + leftMargin: 40 + rightMargin: 40 + bottomMargin: 40 + + contentHeight: flow.implicitHeight + + Flow { + id: flow + spacing: 40 + width: flickable.width - flickable.leftMargin - flickable.rightMargin + + Repeater { + id: repeater + + model: [ + { title: "Normal", theme: Material.Light, flat: false }, + { title: "Flat", theme: Material.Light, flat: true }, + { title: "Normal", theme: Material.Dark, flat: false }, + { title: "Flat", theme: Material.Dark, flat: true } + ] + + Pane { + Material.elevation: 8 + Material.theme: modelData.theme + Universal.theme: modelData.theme + + GroupBox { + title: modelData.title + background.visible: false + + Grid { + columns: 4 + spacing: 20 + padding: 20 + + ButtonLoader { text: "Normal"; flat: modelData.flat; hoverEnabled: hoverBox.checked; round: roundBox.checked } + ButtonLoader { text: "Disabled"; flat: modelData.flat; hoverEnabled: hoverBox.checked; enabled: false; round: roundBox.checked } + ButtonLoader { text: "Down"; flat: modelData.flat; hoverEnabled: hoverBox.checked; down: true; round: roundBox.checked } + ButtonLoader { text: "Disabled"; flat: modelData.flat; hoverEnabled: hoverBox.checked; down: true; enabled: false; round: roundBox.checked } + + ButtonLoader { text: "Checked"; flat: modelData.flat; hoverEnabled: hoverBox.checked; checked: true; round: roundBox.checked } + ButtonLoader { text: "Disabled"; flat: modelData.flat; hoverEnabled: hoverBox.checked; checked: true; enabled: false; round: roundBox.checked } + ButtonLoader { text: "Down"; flat: modelData.flat; hoverEnabled: hoverBox.checked; checked: true; down: true; round: roundBox.checked } + ButtonLoader { text: "Disabled"; flat: modelData.flat; hoverEnabled: hoverBox.checked; checked: true; down: true; enabled: false; round: roundBox.checked } + + ButtonLoader { text: "Highlighted"; flat: modelData.flat; hoverEnabled: hoverBox.checked; highlighted: true; round: roundBox.checked } + ButtonLoader { text: "Disabled"; flat: modelData.flat; hoverEnabled: hoverBox.checked; highlighted: true; enabled: false; round: roundBox.checked } + ButtonLoader { text: "Down"; flat: modelData.flat; hoverEnabled: hoverBox.checked; highlighted: true; down: true; round: roundBox.checked } + ButtonLoader { text: "Disabled"; flat: modelData.flat; hoverEnabled: hoverBox.checked; highlighted: true; down: true; enabled: false; round: roundBox.checked } + + ButtonLoader { text: "Hi-checked"; flat: modelData.flat; hoverEnabled: hoverBox.checked; highlighted: true; checked: true; round: roundBox.checked } + ButtonLoader { text: "Disabled"; flat: modelData.flat; hoverEnabled: hoverBox.checked; highlighted: true; checked: true; enabled: false; round: roundBox.checked } + ButtonLoader { text: "Down"; flat: modelData.flat; hoverEnabled: hoverBox.checked; highlighted: true; checked: true; down: true; round: roundBox.checked } + ButtonLoader { text: "Disabled"; flat: modelData.flat; hoverEnabled: hoverBox.checked; highlighted: true; checked: true; down: true; enabled: false; round: roundBox.checked } + } + } + } + } + } + + ScrollIndicator.vertical: ScrollIndicator { } + } +} diff --git a/tests/manual/fonts/main.qml b/tests/manual/fonts/main.qml index 883226a7..089906ee 100644 --- a/tests/manual/fonts/main.qml +++ b/tests/manual/fonts/main.qml @@ -39,8 +39,8 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 -import QtQuick.Templates 2.0 as T +import QtQuick.Controls 2.1 +import QtQuick.Templates 2.1 as T import QtQuick.Layouts 1.2 ApplicationWindow { diff --git a/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml b/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml index f4a51afb..3054fe22 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: busyIndicator.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-button.qml b/tests/manual/gifs/data/qtquickcontrols2-button.qml index 31b8da47..65262589 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-button.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-button.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: button.width diff --git a/tests/manual/gifs/data/qtquickcontrols2-checkdelegate.qml b/tests/manual/gifs/data/qtquickcontrols2-checkdelegate.qml index df80a417..184ab339 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-checkdelegate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-checkdelegate.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-dial-no-wrap.qml b/tests/manual/gifs/data/qtquickcontrols2-dial-no-wrap.qml index b280b385..98ce78a1 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-dial-no-wrap.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-dial-no-wrap.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: dial.implicitWidth + 20 diff --git a/tests/manual/gifs/data/qtquickcontrols2-dial-wrap.qml b/tests/manual/gifs/data/qtquickcontrols2-dial-wrap.qml index 7ecda085..d5065f6d 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-dial-wrap.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-dial-wrap.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: dial.implicitWidth + 20 diff --git a/tests/manual/gifs/data/qtquickcontrols2-itemdelegate.qml b/tests/manual/gifs/data/qtquickcontrols2-itemdelegate.qml index 18bf942c..6aab7fc7 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-itemdelegate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-itemdelegate.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-menu.qml b/tests/manual/gifs/data/qtquickcontrols2-menu.qml index 332e4d2b..60850a28 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-menu.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-menu.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 // TODO: restore and finish https://codereview.qt-project.org/#/c/123948/ ApplicationWindow { diff --git a/tests/manual/gifs/data/qtquickcontrols2-radiodelegate.qml b/tests/manual/gifs/data/qtquickcontrols2-radiodelegate.qml index 60a0424f..77480ef0 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-radiodelegate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-radiodelegate.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-rangeslider.qml b/tests/manual/gifs/data/qtquickcontrols2-rangeslider.qml index 4f764f8a..ece806d7 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-rangeslider.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-rangeslider.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: slider.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-slider.qml b/tests/manual/gifs/data/qtquickcontrols2-slider.qml index d109b1d2..412ce307 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-slider.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-slider.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: slider.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-behind.qml b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-behind.qml index d019368e..7d6da848 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-behind.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-behind.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: swipeDelegate.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-leading-trailing.qml b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-leading-trailing.qml index ecc7924e..74b69773 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-leading-trailing.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-leading-trailing.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: swipeDelegate.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate.qml b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate.qml index 9dfee7f5..76c65e32 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: swipeDelegate.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-switch.qml b/tests/manual/gifs/data/qtquickcontrols2-switch.qml index 44d07e24..7bdaf102 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-switch.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-switch.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: 100 diff --git a/tests/manual/gifs/data/qtquickcontrols2-switchdelegate.qml b/tests/manual/gifs/data/qtquickcontrols2-switchdelegate.qml index a0ee4e03..e65890a1 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-switchdelegate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-switchdelegate.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-tabbar.qml b/tests/manual/gifs/data/qtquickcontrols2-tabbar.qml index 3d0568e1..ff38277b 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-tabbar.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-tabbar.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Window { width: 300 diff --git a/tests/manual/gifs/data/qtquickcontrols2-tumbler-wrap.qml b/tests/manual/gifs/data/qtquickcontrols2-tumbler-wrap.qml index e1139177..b610d099 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-tumbler-wrap.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-tumbler-wrap.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -38,37 +38,35 @@ ** ****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.0 +import QtQuick 2.8 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.1 Window { - width: 200 - height: 200 + width: frame.implicitWidth + 10 + height: frame.implicitHeight + 10 visible: true - Frame { - padding: 0 - anchors.centerIn: parent - width: row.implicitWidth - height: row.implicitHeight - - FontMetrics { - id: fontMetrics - } + function formatText(count, modelData) { + var data = count === 12 ? modelData + 1 : modelData; + return data.toString().length < 2 ? "0" + data : data; + } - Component { - id: delegateComponent + Component { + id: delegateComponent - Text { - text: modelData.toString().length < 2 ? "0" + modelData : modelData - color: "#666666" - opacity: 0.4 + Math.max(0, 1 - Math.abs(Tumbler.displacement)) * 0.6 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - font.pixelSize: fontMetrics.font.pixelSize * 1.25 - } + Label { + text: formatText(Tumbler.tumbler.count, modelData) + opacity: 1.0 - Math.abs(Tumbler.displacement) / (Tumbler.tumbler.visibleItemCount / 2) + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter } + } + + Frame { + id: frame + padding: 0 + anchors.centerIn: parent Row { id: row @@ -76,44 +74,20 @@ Window { Tumbler { id: hoursTumbler model: 12 - delegate: Text { - text: (modelData.toString().length < 2 ? "0" : "") + (modelData + 1) - color: "#666666" - opacity: 0.4 + Math.max(0, 1 - Math.abs(Tumbler.displacement)) * 0.6 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - font.pixelSize: fontMetrics.font.pixelSize * 1.25 - } - width: 50 - height: 150 + delegate: delegateComponent } Tumbler { id: minutesTumbler - currentIndex: 6 model: 60 delegate: delegateComponent - width: 50 - height: 150 } Tumbler { id: amPmTumbler + wrap: false model: ["AM", "PM"] delegate: delegateComponent - width: 50 - height: 150 - contentItem: ListView { - anchors.fill: parent - model: amPmTumbler.model - delegate: amPmTumbler.delegate - - snapMode: ListView.SnapToItem - highlightRangeMode: ListView.StrictlyEnforceRange - preferredHighlightBegin: height / 2 - (height / 3 / 2) - preferredHighlightEnd: height / 2 + (height / 3 / 2) - clip: true - } } } } diff --git a/tests/manual/gifs/gifrecorder.cpp b/tests/manual/gifs/gifrecorder.cpp index 1e3f141f..5a2ebdca 100644 --- a/tests/manual/gifs/gifrecorder.cpp +++ b/tests/manual/gifs/gifrecorder.cpp @@ -243,7 +243,7 @@ void GifRecorder::waitForFinish() if (mHighQuality) { // Indicate the end of recording and the beginning of conversion. QQmlComponent busyComponent(&mEngine); - busyComponent.setData("import QtQuick 2.6; import QtQuick.Controls 2.0; Rectangle { anchors.fill: parent; " \ + busyComponent.setData("import QtQuick 2.6; import QtQuick.Controls 2.1; Rectangle { anchors.fill: parent; " \ "BusyIndicator { width: 32; height: 32; anchors.centerIn: parent } }", QUrl()); QCOMPARE(busyComponent.status(), QQmlComponent::Ready); QQuickItem *busyRect = qobject_cast<QQuickItem*>(busyComponent.create()); diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp index b64d3573..9de401cb 100644 --- a/tests/manual/gifs/tst_gifs.cpp +++ b/tests/manual/gifs/tst_gifs.cpp @@ -139,7 +139,7 @@ void tst_Gifs::tumblerWrap() GifRecorder gifRecorder; gifRecorder.setDataDirPath(dataDirPath); gifRecorder.setOutputDir(outputDir); - gifRecorder.setRecordingDuration(4); + gifRecorder.setRecordingDuration(5); gifRecorder.setQmlFileName("qtquickcontrols2-tumbler-wrap.qml"); gifRecorder.start(); @@ -164,37 +164,40 @@ void tst_Gifs::tumblerWrap() QTest::mouseMove(window, QPoint(105, 158), 10); QTest::mouseMove(window, QPoint(105, 162), 13); QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, QPoint(105, 162), 0); - QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, QPoint(154, 130), 1098); - QTest::mouseMove(window, QPoint(154, 129), 50); - QTest::mouseMove(window, QPoint(153, 128), 0); - QTest::mouseMove(window, QPoint(153, 125), 16); - QTest::mouseMove(window, QPoint(152, 121), 0); - QTest::mouseMove(window, QPoint(152, 117), 17); - QTest::mouseMove(window, QPoint(151, 113), 0); - QTest::mouseMove(window, QPoint(151, 106), 16); - QTest::mouseMove(window, QPoint(150, 99), 1); - QTest::mouseMove(window, QPoint(148, 93), 16); - QTest::mouseMove(window, QPoint(148, 88), 0); - QTest::mouseMove(window, QPoint(148, 84), 17); - QTest::mouseMove(window, QPoint(147, 81), 0); - QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, QPoint(147, 81), 0); - QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, QPoint(147, 74), 550); - QTest::mouseMove(window, QPoint(147, 75), 17); - QTest::mouseMove(window, QPoint(147, 76), 17); - QTest::mouseMove(window, QPoint(147, 80), 0); - QTest::mouseMove(window, QPoint(148, 85), 16); - QTest::mouseMove(window, QPoint(148, 92), 0); - QTest::mouseMove(window, QPoint(148, 103), 17); - QTest::mouseMove(window, QPoint(150, 119), 17); - QTest::mouseMove(window, QPoint(151, 138), 16); - QTest::mouseMove(window, QPoint(151, 145), 1); - QTest::mouseMove(window, QPoint(153, 151), 16); - QTest::mouseMove(window, QPoint(153, 157), 0); - QTest::mouseMove(window, QPoint(153, 163), 17); - QTest::mouseMove(window, QPoint(153, 167), 0); - QTest::mouseMove(window, QPoint(155, 171), 17); - QTest::mouseMove(window, QPoint(155, 175), 0); - QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, QPoint(155, 175), 0); + QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, QPoint(154, 100), 1098); + QTest::mouseMove(window, QPoint(154, 99), 16); + QTest::mouseMove(window, QPoint(153, 98), 16); + QTest::mouseMove(window, QPoint(153, 95), 16); + QTest::mouseMove(window, QPoint(152, 91), 15); + QTest::mouseMove(window, QPoint(152, 87), 14); + QTest::mouseMove(window, QPoint(151, 83), 13); + QTest::mouseMove(window, QPoint(151, 86), 13); + QTest::mouseMove(window, QPoint(150, 79), 12); + QTest::mouseMove(window, QPoint(148, 73), 12); + QTest::mouseMove(window, QPoint(148, 68), 12); + QTest::mouseMove(window, QPoint(148, 60), 10); + QTest::mouseMove(window, QPoint(147, 50), 10); + QTest::mouseMove(window, QPoint(147, 40), 9); + QTest::mouseMove(window, QPoint(147, 30), 8); + QTest::mouseMove(window, QPoint(147, 20), 7); + QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, QPoint(147, 20), 0); + QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, QPoint(154, 100), 1000); + QTest::mouseMove(window, QPoint(147, 101), 16); + QTest::mouseMove(window, QPoint(147, 102), 16); + QTest::mouseMove(window, QPoint(147, 105), 16); + QTest::mouseMove(window, QPoint(148, 109), 15); + QTest::mouseMove(window, QPoint(148, 115), 14); + QTest::mouseMove(window, QPoint(148, 120), 13); + QTest::mouseMove(window, QPoint(150, 125), 13); + QTest::mouseMove(window, QPoint(151, 130), 12); + QTest::mouseMove(window, QPoint(151, 135), 12); + QTest::mouseMove(window, QPoint(153, 140), 12); + QTest::mouseMove(window, QPoint(153, 150), 10); + QTest::mouseMove(window, QPoint(153, 160), 10); + QTest::mouseMove(window, QPoint(153, 170), 9); + QTest::mouseMove(window, QPoint(155, 180), 8); + QTest::mouseMove(window, QPoint(155, 188), 7); + QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, QPoint(20, 188), 0); #endif gifRecorder.waitForFinish(); diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro index 5c648cea..d81ea32f 100644 --- a/tests/manual/manual.pro +++ b/tests/manual/manual.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs SUBDIRS += \ + buttons \ gifs \ fonts \ screenshots \ diff --git a/tests/manual/styles/styles.qml b/tests/manual/styles/styles.qml index 277604eb..4655aec6 100644 --- a/tests/manual/styles/styles.qml +++ b/tests/manual/styles/styles.qml @@ -40,7 +40,7 @@ import QtQuick 2.6 import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 ApplicationWindow { id: window diff --git a/tests/manual/testbench/main.qml b/tests/manual/testbench/main.qml index 2fdc52af..ea59d5b5 100644 --- a/tests/manual/testbench/main.qml +++ b/tests/manual/testbench/main.qml @@ -41,9 +41,9 @@ import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Layouts 1.0 -import QtQuick.Controls 2.0 -import QtQuick.Controls.Material 2.0 -import QtQuick.Controls.Universal 2.0 +import QtQuick.Controls 2.1 +import QtQuick.Controls.Material 2.1 +import QtQuick.Controls.Universal 2.1 ApplicationWindow { id: window @@ -97,6 +97,12 @@ ApplicationWindow { text: "Option 3" checkable: true } + + MenuSeparator {} + + MenuItem { + text: "Option A" + } } } ToolButton { @@ -128,6 +134,18 @@ ApplicationWindow { text: "Disabled" enabled: false } + + ToolSeparator {} + + ToolButton { + text: "1" + } + ToolButton { + text: "2" + } + + ToolSeparator {} + Item { Layout.fillWidth: true } @@ -233,6 +251,108 @@ ApplicationWindow { } RowLayout { + spacing: window.controlSpacing * 2 + + Button { + text: "Normal" + } + Button { + text: "Pressed" + down: true + } + Button { + text: "Checked" + checked: true + } + Button { + text: "CH + PR" + checked: true + down: true + } + Button { + text: "Disabled" + enabled: false + } + Button { + text: "CH + DIS" + enabled: false + checked: true + } + } + + RowLayout { + spacing: window.controlSpacing * 2 + + ColumnLayout { + RoundButton { + highlighted: true + Layout.alignment: Qt.AlignHCenter + } + Label { + text: "HI" + Layout.alignment: Qt.AlignHCenter + } + } + ColumnLayout { + RoundButton { + highlighted: true + down: true + Layout.alignment: Qt.AlignHCenter + } + Label { + text: "HI + PR" + Layout.alignment: Qt.AlignHCenter + } + } + ColumnLayout { + RoundButton { + highlighted: true + checked: true + Layout.alignment: Qt.AlignHCenter + } + Label { + text: "HI + CH" + Layout.alignment: Qt.AlignHCenter + } + } + ColumnLayout { + RoundButton { + highlighted: true + down: true + checked: true + Layout.alignment: Qt.AlignHCenter + } + Label { + text: "HI+CH+PR" + Layout.alignment: Qt.AlignHCenter + } + } + ColumnLayout { + RoundButton { + highlighted: true + enabled: false + Layout.alignment: Qt.AlignHCenter + } + Label { + text: "HI + DIS" + Layout.alignment: Qt.AlignHCenter + } + } + ColumnLayout { + RoundButton { + highlighted: true + enabled: false + checked: true + Layout.alignment: Qt.AlignHCenter + } + Label { + text: "HI+CH+DIS" + Layout.alignment: Qt.AlignHCenter + } + } + } + + RowLayout { CheckBox { text: "Normal" } diff --git a/tests/manual/viewinqwidget/main.qml b/tests/manual/viewinqwidget/main.qml index 5ad52d83..f90a6972 100644 --- a/tests/manual/viewinqwidget/main.qml +++ b/tests/manual/viewinqwidget/main.qml @@ -35,7 +35,7 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 Item { visible: true |