From 33ce8219fd1a6c26e4918012cd00376c386497c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Wed, 17 Jun 2020 16:44:32 +0200 Subject: Let macOS have TabFocus focus policy This is how the macOS platform behaves. This will cause a slight behavior change for all Qt Quick Controls 2 styles on macOS, as reflected by the change in autotests. Change-Id: I9ea744737d0d157ee8c83955f718c1cd889a8c1d Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_switch.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_switch.qml b/tests/auto/controls/data/tst_switch.qml index b3fab41c..8ec8ffb4 100644 --- a/tests/auto/controls/data/tst_switch.qml +++ b/tests/auto/controls/data/tst_switch.qml @@ -606,6 +606,7 @@ TestCase { verify(!control.activeFocus) mouseClick(control.indicator) - verify(control.activeFocus) + // should not get activeFocus on mouseClick on macOS + compare(control.activeFocus, Qt.platform.os !== "osx" && Qt.platform.os !== "macos") } } -- cgit v1.2.3 From a4ce44f42602171c216cf59c53c5c537e699ee99 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 25 Aug 2020 16:56:01 +0200 Subject: Native style: move DesktopGallery to manual tests, and rename to nativestyle This should not be shipped as an example in it's current state. But the app is needed for now as a manual test while we develop the styles. Change-Id: I719ec629789bc4c8b51d14c97afd7b91b822e89b Reviewed-by: Mitch Curtis --- tests/manual/nativestyle/.gitignore | 73 ++++++++++ tests/manual/nativestyle/Buttons.qml | 100 ++++++++++++++ tests/manual/nativestyle/CMakeLists.txt | 80 +++++++++++ tests/manual/nativestyle/CheckBoxes.qml | 76 +++++++++++ tests/manual/nativestyle/ComboBoxes.qml | 94 +++++++++++++ tests/manual/nativestyle/ControlContainer.qml | 62 +++++++++ tests/manual/nativestyle/CustomButtons.qml | 96 +++++++++++++ tests/manual/nativestyle/CustomCheckBoxes.qml | 137 +++++++++++++++++++ tests/manual/nativestyle/CustomComboBoxes.qml | 122 +++++++++++++++++ tests/manual/nativestyle/CustomDials.qml | 87 ++++++++++++ tests/manual/nativestyle/CustomFrames.qml | 62 +++++++++ tests/manual/nativestyle/CustomProgressBars.qml | 115 ++++++++++++++++ tests/manual/nativestyle/CustomRadioButtons.qml | 121 +++++++++++++++++ tests/manual/nativestyle/CustomScrollBars.qml | 137 +++++++++++++++++++ tests/manual/nativestyle/CustomSliders.qml | 167 +++++++++++++++++++++++ tests/manual/nativestyle/CustomSpinBoxes.qml | 171 ++++++++++++++++++++++++ tests/manual/nativestyle/CustomTextAreas.qml | 71 ++++++++++ tests/manual/nativestyle/CustomTextFields.qml | 63 +++++++++ tests/manual/nativestyle/Dials.qml | 66 +++++++++ tests/manual/nativestyle/Frames.qml | 65 +++++++++ tests/manual/nativestyle/ProgressBars.qml | 102 ++++++++++++++ tests/manual/nativestyle/RadioButtons.qml | 111 +++++++++++++++ tests/manual/nativestyle/ScrollBars.qml | 99 ++++++++++++++ tests/manual/nativestyle/Sliders.qml | 132 ++++++++++++++++++ tests/manual/nativestyle/SlidersMini.qml | 140 +++++++++++++++++++ tests/manual/nativestyle/SlidersSmall.qml | 140 +++++++++++++++++++ tests/manual/nativestyle/SpinBoxes.qml | 73 ++++++++++ tests/manual/nativestyle/TextAreas.qml | 130 ++++++++++++++++++ tests/manual/nativestyle/TextFields.qml | 71 ++++++++++ tests/manual/nativestyle/checkbox-icon.png | Bin 0 -> 258 bytes tests/manual/nativestyle/checkbox-icon16.png | Bin 0 -> 230 bytes tests/manual/nativestyle/checkbox-icon@2x.png | Bin 0 -> 336 bytes tests/manual/nativestyle/main.cpp | 72 ++++++++++ tests/manual/nativestyle/main.qml | 125 +++++++++++++++++ tests/manual/nativestyle/nativestyle.pro | 39 ++++++ tests/manual/nativestyle/qml.qrc | 7 + 36 files changed, 3206 insertions(+) create mode 100644 tests/manual/nativestyle/.gitignore create mode 100644 tests/manual/nativestyle/Buttons.qml create mode 100644 tests/manual/nativestyle/CMakeLists.txt create mode 100644 tests/manual/nativestyle/CheckBoxes.qml create mode 100644 tests/manual/nativestyle/ComboBoxes.qml create mode 100644 tests/manual/nativestyle/ControlContainer.qml create mode 100644 tests/manual/nativestyle/CustomButtons.qml create mode 100644 tests/manual/nativestyle/CustomCheckBoxes.qml create mode 100644 tests/manual/nativestyle/CustomComboBoxes.qml create mode 100644 tests/manual/nativestyle/CustomDials.qml create mode 100644 tests/manual/nativestyle/CustomFrames.qml create mode 100644 tests/manual/nativestyle/CustomProgressBars.qml create mode 100644 tests/manual/nativestyle/CustomRadioButtons.qml create mode 100644 tests/manual/nativestyle/CustomScrollBars.qml create mode 100644 tests/manual/nativestyle/CustomSliders.qml create mode 100644 tests/manual/nativestyle/CustomSpinBoxes.qml create mode 100644 tests/manual/nativestyle/CustomTextAreas.qml create mode 100644 tests/manual/nativestyle/CustomTextFields.qml create mode 100644 tests/manual/nativestyle/Dials.qml create mode 100644 tests/manual/nativestyle/Frames.qml create mode 100644 tests/manual/nativestyle/ProgressBars.qml create mode 100644 tests/manual/nativestyle/RadioButtons.qml create mode 100644 tests/manual/nativestyle/ScrollBars.qml create mode 100644 tests/manual/nativestyle/Sliders.qml create mode 100644 tests/manual/nativestyle/SlidersMini.qml create mode 100644 tests/manual/nativestyle/SlidersSmall.qml create mode 100644 tests/manual/nativestyle/SpinBoxes.qml create mode 100644 tests/manual/nativestyle/TextAreas.qml create mode 100644 tests/manual/nativestyle/TextFields.qml create mode 100644 tests/manual/nativestyle/checkbox-icon.png create mode 100644 tests/manual/nativestyle/checkbox-icon16.png create mode 100644 tests/manual/nativestyle/checkbox-icon@2x.png create mode 100644 tests/manual/nativestyle/main.cpp create mode 100644 tests/manual/nativestyle/main.qml create mode 100644 tests/manual/nativestyle/nativestyle.pro create mode 100644 tests/manual/nativestyle/qml.qrc (limited to 'tests') diff --git a/tests/manual/nativestyle/.gitignore b/tests/manual/nativestyle/.gitignore new file mode 100644 index 00000000..fab7372d --- /dev/null +++ b/tests/manual/nativestyle/.gitignore @@ -0,0 +1,73 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + diff --git a/tests/manual/nativestyle/Buttons.qml b/tests/manual/nativestyle/Buttons.qml new file mode 100644 index 00000000..2a11dea3 --- /dev/null +++ b/tests/manual/nativestyle/Buttons.qml @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "Buttons" + + Row { + spacing: container.rowSpacing + + Button { + text: "Default" + } + + Button { + text: "Disabled" + enabled: false + } + + Button { + text: "Small" + property bool qqc2_style_small + } + + Button { + text: "Mini" + property bool qqc2_style_mini + } + } + + Row { + spacing: container.rowSpacing + + Button { + text: "Explicit height" + height: 50 + } + + Button { + text: "Explicit width" + width: 200 + } + } + + Row { + spacing: container.rowSpacing + + Button { + text: "Highlighted" + highlighted: true + } + + Button { + text: "Flat" + flat: true + } + + Button { + text: "Checkable" + checkable: true + } + } +} diff --git a/tests/manual/nativestyle/CMakeLists.txt b/tests/manual/nativestyle/CMakeLists.txt new file mode 100644 index 00000000..e4712a6e --- /dev/null +++ b/tests/manual/nativestyle/CMakeLists.txt @@ -0,0 +1,80 @@ +# Generated from desktopgallery.pro. + +cmake_minimum_required(VERSION 3.14) +project(desktopgallery LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") +endif() + +set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quickcontrols2/desktopgallery") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 COMPONENTS QuickControls2) + +add_qt_gui_executable(desktopgallery + main.cpp +) +target_link_libraries(desktopgallery PUBLIC + Qt::Core + Qt::Gui + Qt::Quick + Qt::QuickControls2 +) + + +# Resources: +set(qmake_immediate_resource_files + "Buttons.qml" + "CheckBoxes.qml" + "ComboBoxes.qml" + "ControlContainer.qml" + "CustomButtons.qml" + "CustomCheckBoxes.qml" + "CustomComboBoxes.qml" + "CustomDials.qml" + "CustomFrames.qml" + "CustomProgressBars.qml" + "CustomRadioButtons.qml" + "CustomScrollBars.qml" + "CustomSliders.qml" + "CustomSpinBoxes.qml" + "CustomTextAreas.qml" + "CustomTextFields.qml" + "Dials.qml" + "Frames.qml" + "ProgressBars.qml" + "RadioButtons.qml" + "ScrollBars.qml" + "Sliders.qml" + "SlidersMini.qml" + "SlidersSmall.qml" + "SpinBoxes.qml" + "TextAreas.qml" + "TextFields.qml" + "checkbox-icon.png" + "checkbox-icon16.png" + "checkbox-icon@2x.png" + "main.qml" +) + +qt6_add_resources(desktopgallery "qmake_immediate" + PREFIX + "/" + FILES + ${qmake_immediate_resource_files} +) + +install(TARGETS desktopgallery + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/tests/manual/nativestyle/CheckBoxes.qml b/tests/manual/nativestyle/CheckBoxes.qml new file mode 100644 index 00000000..50b81ec4 --- /dev/null +++ b/tests/manual/nativestyle/CheckBoxes.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 +import QtQuick.Controls.impl 2.12 + +ControlContainer { + id: container + title: "CheckBoxes" + + Row { + spacing: container.rowSpacing + + CheckBox { + text: "Default" + checked: true + } + + CheckBox { + text: "Disabled" + enabled: false + } + + CheckBox { + text: "Tri-state" + tristate: true + checkState: Qt.PartiallyChecked + } + + CheckBox { + text: "Small" + property bool qqc2_style_small + } + + CheckBox { + text: "Mini" + property bool qqc2_style_mini + checked: true + } + } +} diff --git a/tests/manual/nativestyle/ComboBoxes.qml b/tests/manual/nativestyle/ComboBoxes.qml new file mode 100644 index 00000000..37c6982c --- /dev/null +++ b/tests/manual/nativestyle/ComboBoxes.qml @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "ComboBoxes" + + Row { + spacing: container.rowSpacing + + ComboBox { + model: [ "Default", "Banana", "Apple", "Coconut" ] + } + + ComboBox { + model: [ "Disabled", "Banana", "Apple", "Coconut" ] + enabled: false + } + + ComboBox { + model: [ "Small", "Banana", "Apple", "Coconut" ] + property bool qqc2_style_small + } + + ComboBox { + model: [ "Mini", "Banana", "Apple", "Coconut" ] + property bool qqc2_style_mini + } + } + + Row { + spacing: container.rowSpacing + + ComboBox { + model: [ "Default", "Banana", "Apple", "Coconut" ] + editable: true + } + + ComboBox { + model: [ "Disabled", "Banana", "Apple", "Coconut" ] + enabled: false + editable: true + } + + ComboBox { + model: [ "Small", "Banana", "Apple", "Coconut" ] + editable: true + property bool qqc2_style_small + } + + ComboBox { + model: [ "Mini", "Banana", "Apple", "Coconut" ] + editable: true + property bool qqc2_style_mini + } + } +} diff --git a/tests/manual/nativestyle/ControlContainer.qml b/tests/manual/nativestyle/ControlContainer.qml new file mode 100644 index 00000000..30022540 --- /dev/null +++ b/tests/manual/nativestyle/ControlContainer.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +Item { + anchors.left: parent.left + anchors.right: parent.right + anchors.rightMargin: 20 // make room for scrollbar + implicitHeight: groupBox.height + + property alias title: groupBox.title + property real rowSpacing: 20 + + default property alias data: layout.data + + GroupBox { + id: groupBox + anchors.left: parent.left + anchors.right: parent.right + + ColumnLayout { + id: layout + spacing: 15 + } + } +} diff --git a/tests/manual/nativestyle/CustomButtons.qml b/tests/manual/nativestyle/CustomButtons.qml new file mode 100644 index 00000000..edcdb086 --- /dev/null +++ b/tests/manual/nativestyle/CustomButtons.qml @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "Buttons" + + Row { + spacing: container.rowSpacing + + Button { + id: buttonWithCustomContentItem + text: "Custom contentItem" + contentItem: Rectangle { + implicitWidth: 120 + implicitHeight: il.implicitHeight + color: buttonWithCustomContentItem.pressed ? "green" : "lightGreen" + Text { + id: il + text: buttonWithCustomContentItem.text + anchors.centerIn: parent + } + } + } + + Button { + id: cb + text: "Custom background" + background: Rectangle { + implicitWidth: 200 + implicitHeight: 30 + radius: 5 + color: cb.pressed ? "LightGray" : "gray" + } + } + + Button { + id: cb2 + text: "All custom" + background: Rectangle { + implicitWidth: 200 + implicitHeight: 30 + radius: 5 + color: cb2.pressed ? "LightGray" : "gray" + } + contentItem: Rectangle { + implicitWidth: il2.implicitWidth + implicitHeight: il2.implicitHeight + radius: 3 + color: "lightgray" + Text { + id: il2 + text: cb2.text + anchors.centerIn: parent + } + } + } + } +} diff --git a/tests/manual/nativestyle/CustomCheckBoxes.qml b/tests/manual/nativestyle/CustomCheckBoxes.qml new file mode 100644 index 00000000..fcec932f --- /dev/null +++ b/tests/manual/nativestyle/CustomCheckBoxes.qml @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 +import QtQuick.Controls.impl 2.12 + +ControlContainer { + id: container + title: "CheckBoxes" + + Row { + spacing: container.rowSpacing + + CheckBox { + id: customContentItem + text: "Custom content item" + contentItem: Text { + text: customContentItem.text + color: "green" + leftPadding: customContentItem.indicator.width + customContentItem.spacing + } + } + + CheckBox { + id: customIndicator + text: "Custom indicator" + indicator: Rectangle { + implicitWidth: 15 + implicitHeight: 15 + + x: customIndicator.text ? customIndicator.leftPadding : customIndicator.leftPadding + (customIndicator.availableWidth - width) / 2 + y: customIndicator.topPadding + (customIndicator.availableHeight - height) / 2 + + color: customIndicator.down ? customIndicator.palette.light : customIndicator.palette.base + border.color: "green" + border.width: 2 + + ColorImage { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + defaultColor: "#353637" + scale: 0.5 + color: "green" + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" + visible: customIndicator.checkState === Qt.Checked + } + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 16 + height: 3 + color: customIndicator.palette.text + visible: customIndicator.checkState === Qt.PartiallyChecked + } + } + } + + CheckBox { + id: allCustom + text: "All custom" + + contentItem: Text { + text: allCustom.text + color: "green" + leftPadding: allCustom.indicator.width + allCustom.spacing + rightPadding: allCustom.indicator.width + allCustom.spacing + } + + indicator: Rectangle { + implicitWidth: 15 + implicitHeight: 15 + + x: allCustom.text ? allCustom.leftPadding : allCustom.leftPadding + (allCustom.availableWidth - width) / 2 + y: allCustom.topPadding + (allCustom.availableHeight - height) / 2 + + color: allCustom.down ? allCustom.palette.light : allCustom.palette.base + border.color: "green" + border.width: 2 + + ColorImage { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + defaultColor: "#353637" + scale: 0.5 + color: "green" + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" + visible: allCustom.checkState === Qt.Checked + } + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 16 + height: 3 + color: "green" + visible: allCustom.checkState === Qt.PartiallyChecked + } + } + } + } +} diff --git a/tests/manual/nativestyle/CustomComboBoxes.qml b/tests/manual/nativestyle/CustomComboBoxes.qml new file mode 100644 index 00000000..58793182 --- /dev/null +++ b/tests/manual/nativestyle/CustomComboBoxes.qml @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 +import QtQuick.Controls.impl 2.15 + +ControlContainer { + id: container + title: "ComboBoxes" + + Row { + spacing: container.rowSpacing + + ComboBox { + id: control + model: [ "Custom background", "Banana", "Apple", "Coconut" ] + background: Rectangle { + implicitWidth: 200 + implicitHeight: 20 + color: control.down ? control.palette.mid : control.palette.button + border.color: "green" + border.width: 1 + } + indicator: ColorImage { + x: control.mirrored ? control.padding : control.width - width - control.padding + y: control.topPadding + (control.availableHeight - height) / 2 + color: control.palette.dark + defaultColor: "#353637" + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/double-arrow.png" + opacity: enabled ? 1 : 0.3 + } + } + + ComboBox { + model: [ "Banana", "Apple", "Coconut" ] + contentItem: Rectangle { + implicitWidth: text.implicitWidth + color: "lightGreen" + Text { + id: text + text: "Custom content item" + anchors.centerIn: parent + } + } + } + + } + + Row { + spacing: container.rowSpacing + + ComboBox { + id: control2 + model: [ "Custom background", "Banana", "Apple", "Coconut" ] + editable: true + background: Rectangle { + implicitWidth: 200 + implicitHeight: 20 + color: control2.down ? control2.palette.mid : control2.palette.button + border.color: "green" + border.width: 1 + } + indicator: ColorImage { + x: control2.mirrored ? control2.padding : control2.width - width - control2.padding + y: control2.topPadding + (control2.availableHeight - height) / 2 + color: control2.palette.dark + defaultColor: "#353637" + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/double-arrow.png" + opacity: enabled ? 1 : 0.3 + } + } + + ComboBox { + model: [ "Banana", "Apple", "Coconut" ] + editable: true + contentItem: Rectangle { + implicitWidth: text2.implicitWidth + color: "lightGreen" + TextEdit { + id: text2 + text: "Custom content item" + anchors.centerIn: parent + } + } + } + } +} diff --git a/tests/manual/nativestyle/CustomDials.qml b/tests/manual/nativestyle/CustomDials.qml new file mode 100644 index 00000000..c1a0ac4e --- /dev/null +++ b/tests/manual/nativestyle/CustomDials.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick dial1s 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Controls.impl 2.12 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "Dials" + + Row { + spacing: container.rowSpacing + + Dial { + id: dial1 + width: 50 + height: 50 + from: 0 + to: 10 + value: 5 + + background: DialImpl { + implicitWidth: 184 + implicitHeight: 184 + color: "darkgray" + progress: dial1.position + opacity: dial1.enabled ? 1 : 0.3 + } + + handle: ColorImage { + x: dial1.background.x + dial1.background.width / 2 - width / 2 + y: dial1.background.y + dial1.background.height / 2 - height / 2 + width: 14 + height: 10 + color: "green" + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/dial-indicator.png" + antialiasing: true + opacity: dial1.enabled ? 1 : 0.3 + transform: [ + Translate { + y: -Math.min(dial1.background.width, dial1.background.height) * 0.4 + dial1.handle.height / 2 + }, + Rotation { + angle: dial1.angle + origin.x: dial1.handle.width / 2 + origin.y: dial1.handle.height / 2 + } + ] + } + } + } +} diff --git a/tests/manual/nativestyle/CustomFrames.qml b/tests/manual/nativestyle/CustomFrames.qml new file mode 100644 index 00000000..0b74b220 --- /dev/null +++ b/tests/manual/nativestyle/CustomFrames.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "Frames" + + Row { + spacing: container.rowSpacing + + Frame { + width: 200 + height: 50 + background: Rectangle { + border.width: 1 + border.color: "green" + Text { + anchors.centerIn: parent + color: "green" + text: "Custom background" + } + } + } + } +} diff --git a/tests/manual/nativestyle/CustomProgressBars.qml b/tests/manual/nativestyle/CustomProgressBars.qml new file mode 100644 index 00000000..93932a5e --- /dev/null +++ b/tests/manual/nativestyle/CustomProgressBars.qml @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 +import QtQuick.Controls.impl 2.12 + +ControlContainer { + id: container + title: "ProgressBars" + + property int time: 0 + Timer { + interval: 1000 + running: true + repeat: true + onTriggered: { + time++ + if (time > 10) + time = 0 + } + } + + Row { + spacing: container.rowSpacing + + ProgressBar { + id: c1 + width: 100 + from: 0 + to: 10 + value: time + indeterminate: false + padding: 5 + background: Rectangle { + implicitWidth: 100 + implicitHeight: 6 + color: "darkgray" + } + } + + ProgressBar { + id: c2 + width: 100 + from: 0 + to: 10 + value: time + indeterminate: false + padding: 5 + contentItem: ProgressBarImpl { + implicitHeight: 6 + implicitWidth: 100 + progress: c2.position + indeterminate: false + color: "lightgreen" + } + } + + ProgressBar { + id: c3 + width: 100 + from: 0 + to: 10 + value: time + indeterminate: false + padding: 5 + background: Rectangle { + implicitWidth: 100 + implicitHeight: 6 + color: "darkgray" + } + contentItem: ProgressBarImpl { + implicitHeight: 6 + implicitWidth: 100 + progress: c3.position + indeterminate: false + color: "lightgreen" + } + } + } +} diff --git a/tests/manual/nativestyle/CustomRadioButtons.qml b/tests/manual/nativestyle/CustomRadioButtons.qml new file mode 100644 index 00000000..9418b689 --- /dev/null +++ b/tests/manual/nativestyle/CustomRadioButtons.qml @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 +import QtQuick.Controls.impl 2.12 + +ControlContainer { + id: container + title: "RadioButtons" + + Row { + spacing: container.rowSpacing + + RadioButton { + id: customContentItem + text: "Custom content item" + contentItem: Text { + text: customContentItem.text + color: "green" + leftPadding: customContentItem.indicator.width + customContentItem.spacing + } + } + + RadioButton { + id: customIndicator + text: "Custom indicator" + indicator: Rectangle { + implicitWidth: 14 + implicitHeight: 14 + + x: customIndicator.text ? customIndicator.leftPadding : customIndicator.leftPadding + (customIndicator.availableWidth - width) / 2 + y: customIndicator.topPadding + (customIndicator.availableHeight - height) / 2 + + radius: width / 2 + color: customIndicator.down ? customIndicator.palette.light : customIndicator.palette.base + border.width: 2 + border.color: "green" + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 5 + height: 5 + radius: width / 2 + color: "green" + visible: customIndicator.checked + } + } + } + + RadioButton { + id: allCustom + text: "All custom" + + contentItem: Text { + text: allCustom.text + color: "green" + leftPadding: allCustom.indicator.width + allCustom.spacing + } + + indicator: Rectangle { + implicitWidth: 14 + implicitHeight: 14 + + x: allCustom.text ? allCustom.leftPadding : allCustom.leftPadding + (allCustom.availableWidth - width) / 2 + y: allCustom.topPadding + (allCustom.availableHeight - height) / 2 + + radius: width / 2 + color: allCustom.down ? allCustom.palette.light : allCustom.palette.base + border.width: 2 + border.color: "green" + + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 5 + height: 5 + radius: width / 2 + color: "green" + visible: allCustom.checked + } + } + } + } + +} diff --git a/tests/manual/nativestyle/CustomScrollBars.qml b/tests/manual/nativestyle/CustomScrollBars.qml new file mode 100644 index 00000000..fcac2eaf --- /dev/null +++ b/tests/manual/nativestyle/CustomScrollBars.qml @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "ScrollBars" + + Row { + spacing: container.rowSpacing + + ScrollBar { + height: 200 + orientation: Qt.Vertical + size: 0.2 + policy: ScrollBar.AlwaysOn + background: Rectangle { + color: "lightgray" + border.color: "gray" + border.width: 1 + } + } + + ScrollBar { + height: 200 + orientation: Qt.Vertical + size: 0.2 + policy: ScrollBar.AlwaysOn + contentItem: Rectangle { + color: "lightgreen" + border.color: "green" + border.width: 1 + } + } + + ScrollBar { + height: 200 + orientation: Qt.Vertical + size: 0.2 + policy: ScrollBar.AlwaysOn + background: Rectangle { + color: "lightgray" + border.color: "gray" + border.width: 1 + } + contentItem: Rectangle { + implicitWidth: 15 + color: "lightgreen" + border.color: "green" + border.width: 1 + } + } + + Column { + spacing: container.rowSpacing + + ScrollBar { + width: 300 + orientation: Qt.Horizontal + size: 0.2 + policy: ScrollBar.AlwaysOn + background: Rectangle { + color: "lightgray" + border.color: "gray" + border.width: 1 + } + } + + ScrollBar { + width: 300 + orientation: Qt.Horizontal + size: 0.2 + policy: ScrollBar.AlwaysOn + contentItem: Rectangle { + color: "lightgray" + border.color: "gray" + border.width: 1 + } + } + + ScrollBar { + width: 300 + orientation: Qt.Horizontal + size: 0.2 + policy: ScrollBar.AlwaysOn + background: Rectangle { + color: "lightgray" + border.color: "gray" + border.width: 1 + } + contentItem: Rectangle { + implicitHeight: 15 + color: "lightgreen" + border.color: "green" + border.width: 1 + } + } + } + } + +} diff --git a/tests/manual/nativestyle/CustomSliders.qml b/tests/manual/nativestyle/CustomSliders.qml new file mode 100644 index 00000000..38cdf0a2 --- /dev/null +++ b/tests/manual/nativestyle/CustomSliders.qml @@ -0,0 +1,167 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "Sliders" + property int sliderWidth: 300 + property int sliderHeight: 140 + + Row { + spacing: 40 + + Column { + spacing: 15 + + Slider { + id: customHandle + width: sliderWidth + height: 20 + from: 0 + to: 10 + value: 5 + handle: Rectangle { + id: handle + width: 12 + height: customHandle.height + color: "white" + border.width: 2 + + x: customHandle.visualPosition * (customHandle.availableWidth - width) + y: (customHandle.availableHeight - height) / 2 + } + } + + Slider { + id: customBackground + width: sliderWidth + from: 0 + to: 10 + background: Rectangle { + implicitHeight: 5 + color: "lightgray" + border.width: 1 + } + } + + Slider { + id: customAll + width: sliderWidth + height: 20 + from: 0 + to: 10 + background: Rectangle { + implicitHeight: customAll.height + color: "lightgray" + border.width: 1 + } + handle: Rectangle { + width: 12 + height: customAll.height + color: "white" + border.width: 2 + + x: customAll.visualPosition * (customAll.availableWidth - width) + y: (customAll.availableHeight - height) / 2 + } + } + } + + Row { + spacing: 20 + + Slider { + id: customVHandle + width: 20 + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 10 + value: 5 + handle: Rectangle { + height: 12 + width: customVHandle.width + color: "white" + border.width: 2 + + x: (customVHandle.availableWidth - width) / 2 + y: customVHandle.visualPosition * (customVHandle.availableHeight - height) + } + } + + Slider { + id: customVBackground + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 10 + background: Rectangle { + implicitWidth: 5 + color: "lightgray" + border.width: 1 + } + } + + Slider { + id: customVAll + width: 20 + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 10 + value: 5 + handle: Rectangle { + height: 12 + width: customVHandle.width + color: "white" + border.width: 2 + + x: (customVAll.availableWidth - width) / 2 + y: customVAll.visualPosition * (customVAll.availableHeight - height) + } + background: Rectangle { + implicitWidth: 5 + color: "lightgray" + border.width: 1 + } + } + } + } +} diff --git a/tests/manual/nativestyle/CustomSpinBoxes.qml b/tests/manual/nativestyle/CustomSpinBoxes.qml new file mode 100644 index 00000000..b632f311 --- /dev/null +++ b/tests/manual/nativestyle/CustomSpinBoxes.qml @@ -0,0 +1,171 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "SpinBoxes" + + Row { + spacing: container.rowSpacing + + SpinBox { + id: custombg + value: 1000 + to: 2000 + background: Rectangle { + border.color: "green" + implicitWidth: 50 + } + } + + SpinBox { + id: customIndicator + value: 500 + to: 2000 + + rightPadding: 17 + spacing: 0 + implicitWidth: 60 + implicitHeight: 25 + + up.indicator: Rectangle { + x: customIndicator.width - width - 4 + y: 4 + implicitWidth: customIndicator.rightPadding - 4 + implicitHeight: 8 + border.width: 1 + border.color: "green" + color: customIndicator.up.pressed ? "gray" : "transparent" + Text { + text: "+" + font.pixelSize: 8 + font.bold: true + anchors.centerIn: parent + } + } + + down.indicator: Rectangle { + x: customIndicator.width - width - 4 + y: height + 6 + implicitWidth: customIndicator.rightPadding - 4 + implicitHeight: 8 + border.width: 1 + border.color: "green" + color: customIndicator.down.pressed ? "gray" : "transparent" + Text { + text: "-" + font.pixelSize: 10 + font.bold: true + anchors.centerIn: parent + } + } + } + + SpinBox { + id: allCustom + value: 500 + to: 2000 + + rightPadding: 17 + spacing: 0 + implicitWidth: 60 + implicitHeight: 25 + + background: Rectangle { + border.color: "green" + implicitWidth: 50 + } + + up.indicator: Rectangle { + x: allCustom.width - width - 4 + y: 4 + implicitWidth: allCustom.rightPadding - 4 + implicitHeight: 8 + border.width: 1 + border.color: "green" + color: allCustom.up.pressed ? "gray" : "transparent" + Text { + text: "+" + font.pixelSize: 8 + font.bold: true + anchors.centerIn: parent + } + } + + down.indicator: Rectangle { + x: allCustom.width - width - 4 + y: height + 6 + implicitWidth: allCustom.rightPadding - 4 + implicitHeight: 8 + border.width: 1 + border.color: "green" + color: allCustom.down.pressed ? "gray" : "transparent" + Text { + text: "-" + font.pixelSize: 10 + font.bold: true + anchors.centerIn: parent + } + } + + contentItem: TextInput { + text: allCustom.displayText + font: allCustom.font + color: "green" + selectionColor: allCustom.palette.highlight + selectedTextColor: allCustom.palette.highlightedText + horizontalAlignment: Qt.AlignLeft + verticalAlignment: Qt.AlignVCenter + + topPadding: 2 + bottomPadding: 2 + leftPadding: 10 + rightPadding: 10 + + readOnly: !allCustom.editable + validator: allCustom.validator + inputMethodHints: allCustom.inputMethodHints + } + + } + + } + +} diff --git a/tests/manual/nativestyle/CustomTextAreas.qml b/tests/manual/nativestyle/CustomTextAreas.qml new file mode 100644 index 00000000..a729ea10 --- /dev/null +++ b/tests/manual/nativestyle/CustomTextAreas.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "TextFields" + + Row { + spacing: container.rowSpacing + + TextArea { + id: customBackground + width: 200 + wrapMode: TextEdit.WordWrap + text: "Custom background - Lorem ipsum dolor sit amet, consectetur adipiscing elit, " + + "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + background: Rectangle { + implicitWidth: customBackground.contentWidth + implicitHeight: customBackground.contentHeight + border.width: customBackground.activeFocus ? 2 : 1 + color: control.palette.base + border.color: "green" + } + } + + TextArea { + width: 200 + placeholderText: "Large font" + font.pixelSize: 20 + wrapMode: TextEdit.WordWrap + text: "Large font - Lorem ipsum dolor sit amet, consectetur adipiscing elit" + } + } +} diff --git a/tests/manual/nativestyle/CustomTextFields.qml b/tests/manual/nativestyle/CustomTextFields.qml new file mode 100644 index 00000000..f781eb19 --- /dev/null +++ b/tests/manual/nativestyle/CustomTextFields.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "TextFields" + + Row { + spacing: container.rowSpacing + + TextField { + placeholderText: "Custom background" + background: Rectangle { + implicitWidth: 130 + implicitHeight: 20 + border.width: control.activeFocus ? 2 : 1 + color: control.palette.base + border.color: "green" + } + } + TextField { + placeholderText: "Large font" + font.pixelSize: 20 + } + } +} diff --git a/tests/manual/nativestyle/Dials.qml b/tests/manual/nativestyle/Dials.qml new file mode 100644 index 00000000..56dff2a4 --- /dev/null +++ b/tests/manual/nativestyle/Dials.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "Dials" + + Row { + spacing: container.rowSpacing + + Dial { + width: 50 + height: 50 + from: 0 + to: 10 + value: 5 + } + + Dial { + width: 50 + height: 50 + from: 0 + to: 10 + value: 5 + stepSize: 1 + property int qqc2_style_tickPosition: 1 + } + } +} diff --git a/tests/manual/nativestyle/Frames.qml b/tests/manual/nativestyle/Frames.qml new file mode 100644 index 00000000..91cbec6d --- /dev/null +++ b/tests/manual/nativestyle/Frames.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "Frames" + + Row { + spacing: container.rowSpacing + + Frame { + width: 100 + height: 50 + } + + Frame { + Rectangle { + implicitWidth: label.width + 50 + implicitHeight: 45 + Label { + id: label + anchors.centerIn: parent + text: "Frame with contents" + } + } + } + } +} diff --git a/tests/manual/nativestyle/ProgressBars.qml b/tests/manual/nativestyle/ProgressBars.qml new file mode 100644 index 00000000..f19c05bd --- /dev/null +++ b/tests/manual/nativestyle/ProgressBars.qml @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "ProgressBars" + + property int time: 0 + Timer { + interval: 1000 + running: true + repeat: true + onTriggered: { + time++ + if (time > 10) + time = 0 + } + } + + Row { + spacing: container.rowSpacing + + ProgressBar { + width: 100 + from: 0 + to: 10 + value: time + indeterminate: false + } + + ProgressBar { + width: 100 + from: 0 + to: 10 + value: time + enabled: false + indeterminate: false + } + + ProgressBar { + width: 100 + from: 0 + to: 10 + indeterminate: true + } + + ProgressBar { + width: 80 + from: 0 + to: 10 + value: time + indeterminate: false + property bool qqc2_style_small + } + + ProgressBar { + width: 60 + from: 0 + to: 10 + value: time + indeterminate: false + property bool qqc2_style_mini + } + } +} diff --git a/tests/manual/nativestyle/RadioButtons.qml b/tests/manual/nativestyle/RadioButtons.qml new file mode 100644 index 00000000..b9c49e7d --- /dev/null +++ b/tests/manual/nativestyle/RadioButtons.qml @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 +import QtQuick.Controls.impl 2.12 + +ControlContainer { + id: container + title: "RadioButtons" + + Row { + spacing: container.rowSpacing + + Column { + RadioButton { + text: "Default" + checked: true + } + RadioButton { + text: "Default" + } + RadioButton { + text: "Default" + } + } + + Column { + RadioButton { + text: "Disabled" + enabled: false + } + RadioButton { + text: "Disabled" + enabled: false + } + RadioButton { + text: "Disabled" + enabled: false + checked: true + } + } + + Column { + RadioButton { + text: "Small" + property bool qqc2_style_small + } + RadioButton { + text: "Small" + checked: true + property bool qqc2_style_small + } + RadioButton { + text: "Small" + property bool qqc2_style_small + } + } + + Column { + RadioButton { + text: "Mini" + property bool qqc2_style_mini + } + RadioButton { + text: "Mini" + property bool qqc2_style_mini + } + RadioButton { + text: "Mini" + checked: true + property bool qqc2_style_mini + } + } + } + +} diff --git a/tests/manual/nativestyle/ScrollBars.qml b/tests/manual/nativestyle/ScrollBars.qml new file mode 100644 index 00000000..f7b78f86 --- /dev/null +++ b/tests/manual/nativestyle/ScrollBars.qml @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "ScrollBars" + + Row { + spacing: container.rowSpacing + + ScrollBar { + height: 200 + orientation: Qt.Vertical + size: 0.2 + policy: ScrollBar.AlwaysOn + } + + ScrollBar { + height: 150 + orientation: Qt.Vertical + size: 0.2 + policy: ScrollBar.AlwaysOn + property bool qqc2_style_small + } + + ScrollBar { + height: 100 + orientation: Qt.Vertical + size: 0.2 + policy: ScrollBar.AlwaysOn + property bool qqc2_style_mini + } + + Column { + spacing: container.rowSpacing + + ScrollBar { + width: 300 + orientation: Qt.Horizontal + size: 0.2 + policy: ScrollBar.AlwaysOn + } + + ScrollBar { + width: 200 + orientation: Qt.Horizontal + size: 0.2 + policy: ScrollBar.AlwaysOn + property bool qqc2_style_small + } + + ScrollBar { + width: 100 + orientation: Qt.Horizontal + size: 0.2 + policy: ScrollBar.AlwaysOn + property bool qqc2_style_mini + } + } + } + +} diff --git a/tests/manual/nativestyle/Sliders.qml b/tests/manual/nativestyle/Sliders.qml new file mode 100644 index 00000000..dba0794b --- /dev/null +++ b/tests/manual/nativestyle/Sliders.qml @@ -0,0 +1,132 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "Sliders normal" + property int sliderWidth: 300 + property int sliderHeight: 140 + + Row { + spacing: 40 + + Column { + spacing: 15 + + Slider { + width: sliderWidth + from: 0 + to: 10 + value: 5 + } + + Slider { + width: sliderWidth + from: 0 + to: 10 + value: 5 + enabled: false + } + + Slider { + width: sliderWidth + from: 0 + to: 100 + value: 20 + stepSize: 20 + + property int qqc2_style_tickPosition: 1 + } + + Slider { + width: sliderWidth + from: 0 + to: 100 + stepSize: 5 + value: 65 + + property int qqc2_style_tickPosition: 2 + } + } + + Row { + spacing: 20 + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 10 + value: 5 + } + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 10 + value: 5 + enabled: false + } + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 100 + value: 20 + stepSize: 20 + + property int qqc2_style_tickPosition: 1 + } + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 100 + stepSize: 5 + value: 65 + + property int qqc2_style_tickPosition: 2 + } + } + } +} diff --git a/tests/manual/nativestyle/SlidersMini.qml b/tests/manual/nativestyle/SlidersMini.qml new file mode 100644 index 00000000..542719e9 --- /dev/null +++ b/tests/manual/nativestyle/SlidersMini.qml @@ -0,0 +1,140 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "Sliders mini" + property int sliderWidth: 100 + property int sliderHeight: 90 + + Row { + spacing: 40 + + Column { + spacing: 15 + + Slider { + width: sliderWidth + from: 0 + to: 10 + value: 5 + property bool qqc2_style_mini + } + + Slider { + width: sliderWidth + from: 0 + to: 10 + value: 5 + enabled: false + property bool qqc2_style_mini + } + + Slider { + width: sliderWidth + from: 0 + to: 100 + value: 20 + stepSize: 20 + + property bool qqc2_style_mini + property int qqc2_style_tickPosition: 1 + } + + Slider { + width: sliderWidth + from: 0 + to: 100 + stepSize: 5 + value: 65 + + property bool qqc2_style_mini + property int qqc2_style_tickPosition: 2 + } + } + + Row { + spacing: 20 + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 10 + value: 5 + property bool qqc2_style_mini + } + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 10 + value: 5 + enabled: false + property bool qqc2_style_mini + } + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 100 + value: 20 + stepSize: 20 + + property bool qqc2_style_mini + property int qqc2_style_tickPosition: 1 + } + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 100 + stepSize: 5 + value: 65 + + property bool qqc2_style_mini + property int qqc2_style_tickPosition: 2 + } + } + } +} diff --git a/tests/manual/nativestyle/SlidersSmall.qml b/tests/manual/nativestyle/SlidersSmall.qml new file mode 100644 index 00000000..bd1f85a6 --- /dev/null +++ b/tests/manual/nativestyle/SlidersSmall.qml @@ -0,0 +1,140 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "Sliders small" + property int sliderWidth: 200 + property int sliderHeight: 100 + + Row { + spacing: 40 + + Column { + spacing: 15 + + Slider { + width: sliderWidth + from: 0 + to: 10 + value: 5 + property bool qqc2_style_small + } + + Slider { + width: sliderWidth + from: 0 + to: 10 + value: 5 + enabled: false + property bool qqc2_style_small + } + + Slider { + width: sliderWidth + from: 0 + to: 100 + value: 20 + stepSize: 20 + + property bool qqc2_style_small + property int qqc2_style_tickPosition: 1 + } + + Slider { + width: sliderWidth + from: 0 + to: 100 + stepSize: 5 + value: 65 + + property bool qqc2_style_small + property int qqc2_style_tickPosition: 2 + } + } + + Row { + spacing: 20 + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 10 + value: 5 + property bool qqc2_style_small + } + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 10 + value: 5 + enabled: false + property bool qqc2_style_small + } + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 100 + value: 20 + stepSize: 20 + + property bool qqc2_style_small + property int qqc2_style_tickPosition: 1 + } + + Slider { + height: sliderHeight + orientation: Qt.Vertical + from: 0 + to: 100 + stepSize: 5 + value: 65 + + property bool qqc2_style_small + property int qqc2_style_tickPosition: 2 + } + } + } +} diff --git a/tests/manual/nativestyle/SpinBoxes.qml b/tests/manual/nativestyle/SpinBoxes.qml new file mode 100644 index 00000000..0b66e977 --- /dev/null +++ b/tests/manual/nativestyle/SpinBoxes.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "SpinBoxes" + + Row { + spacing: container.rowSpacing + + SpinBox { + value: 500 + to: 2000 + } + + SpinBox { + value: 0 + enabled: false + } + + SpinBox { + value: 5 + from: 0 + to: 9 + property bool qqc2_style_small + } + + SpinBox { + value: 0 + from: -9 + to: 9 + property bool qqc2_style_mini + } + } + +} diff --git a/tests/manual/nativestyle/TextAreas.qml b/tests/manual/nativestyle/TextAreas.qml new file mode 100644 index 00000000..f0406146 --- /dev/null +++ b/tests/manual/nativestyle/TextAreas.qml @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "TextAreas" + + Row { + spacing: container.rowSpacing + + TextArea { + id: defaultTextArea + width: 200 + wrapMode: TextEdit.WordWrap + selectByMouse: true + text: "Default - Lorem ipsum dolor sit amet, consectetur adipiscing elit, " + + "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + } + + TextArea { + enabled: false + width: 200 + wrapMode: TextEdit.WordWrap + selectByMouse: true + text: "Disabled - Lorem ipsum dolor sit amet, consectetur adipiscing elit, " + + "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + } + + ScrollView { + id: scrollView + width: 200 + height: defaultTextArea.height + ScrollBar.vertical.policy: ScrollBar.AlwaysOn + + TextArea { + text: "Inside ScrollView - Lorem ipsum dolor sit amet, consectetur adipiscing elit, " + + "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " + + "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi " + + "ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit " + + "in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur " + + "sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt " + + "mollit anim id est laborum." + wrapMode: TextEdit.WordWrap + selectByMouse: true + rightPadding: scrollView.ScrollBar.vertical.width + } + } + } + + Row { + spacing: container.rowSpacing + + Frame { + TextArea { + id: area1 + width: 200 + wrapMode: TextEdit.WrapAnywhere + selectByMouse: true + text: "Inside frame - Lorem ipsum dolor sit amet, consectetur adipiscing elit, " + + "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + } + } + + Frame { + contentWidth: 200 + contentHeight: 100 + ScrollView { + id: scrollView2 + anchors.fill: parent + ScrollBar.vertical.policy: ScrollBar.AlwaysOn + + TextArea { + id: area2 + text: "Inside Frame and ScrollView - Lorem ipsum dolor sit amet, consectetur adipiscing elit, " + + "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " + + "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi " + + "ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit " + + "in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur " + + "sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt " + + "mollit anim id est laborum." + wrapMode: TextEdit.WordWrap + selectByMouse: true + rightPadding: scrollView2.ScrollBar.vertical.width + } + } + } + + TextArea { + placeholderText: "Placeholder text" + selectByMouse: true + } + } +} diff --git a/tests/manual/nativestyle/TextFields.qml b/tests/manual/nativestyle/TextFields.qml new file mode 100644 index 00000000..75f2b720 --- /dev/null +++ b/tests/manual/nativestyle/TextFields.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ControlContainer { + id: container + title: "TextFields" + + Row { + spacing: container.rowSpacing + + TextField { + text: "Default" + } + + TextField { + enabled: false + text: "Disabled" + } + + TextField { + placeholderText: "Placeholder text" + } + + TextField { + text: "Small" + property bool qqc2_style_small + } + + TextField { + text: "Mini" + property bool qqc2_style_mini + } + } +} diff --git a/tests/manual/nativestyle/checkbox-icon.png b/tests/manual/nativestyle/checkbox-icon.png new file mode 100644 index 00000000..ee669b3a Binary files /dev/null and b/tests/manual/nativestyle/checkbox-icon.png differ diff --git a/tests/manual/nativestyle/checkbox-icon16.png b/tests/manual/nativestyle/checkbox-icon16.png new file mode 100644 index 00000000..8d89eab8 Binary files /dev/null and b/tests/manual/nativestyle/checkbox-icon16.png differ diff --git a/tests/manual/nativestyle/checkbox-icon@2x.png b/tests/manual/nativestyle/checkbox-icon@2x.png new file mode 100644 index 00000000..51c5601d Binary files /dev/null and b/tests/manual/nativestyle/checkbox-icon@2x.png differ diff --git a/tests/manual/nativestyle/main.cpp b/tests/manual/nativestyle/main.cpp new file mode 100644 index 00000000..aee43242 --- /dev/null +++ b/tests/manual/nativestyle/main.cpp @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QGuiApplication app(argc, argv); + + // Todo: rename the "default" style to e.g "simple" + // and use "default" as a phony style name instad + // to mean "get me the default style on the current + // platform". + const QString style = qEnvironmentVariable("DESKTOPGALLERY_STYLE"); + if (!style.isEmpty()) + QQuickStyle::setStyle(style); + else +#if defined(Q_OS_MACOS) + QQuickStyle::setStyle("macOS"); +#elif defined(Q_OS_WINDOWS) + QQuickStyle::setStyle("Windows"); +#else + QQuickStyle::setStyle("FusionDesktop"); +#endif + + QQmlApplicationEngine engine; + const QUrl url(QStringLiteral("qrc:/main.qml")); + QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, + &app, [url](QObject *obj, const QUrl &objUrl) { + if (!obj && url == objUrl) + QCoreApplication::exit(-1); + }, Qt::QueuedConnection); + engine.load(url); + + return app.exec(); +} diff --git a/tests/manual/nativestyle/main.qml b/tests/manual/nativestyle/main.qml new file mode 100644 index 00000000..6cf7a646 --- /dev/null +++ b/tests/manual/nativestyle/main.qml @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Window 2.13 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 + +ApplicationWindow { + visible: true + width: 800 + height: 600 + title: qsTr("Desktop Gallery") + + TabBar { + id: bar + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: 20 + anchors.rightMargin: 40 + + TabButton { + text: qsTr("Default controls") + } + + TabButton { + text: qsTr("Customized controls") + } + } + + StackLayout { + currentIndex: bar.currentIndex + anchors.top: bar.bottom + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: 20 + + ScrollView { + contentWidth: width + clip: true + ScrollBar.vertical.policy: ScrollBar.AlwaysOn + + Column { + anchors.left: parent.left + anchors.right: parent.right + spacing: 20 + + Buttons { } + CheckBoxes { } + RadioButtons { } + SpinBoxes { } + TextFields { } + TextAreas { } + ComboBoxes { } + Dials { } + Frames { } + ProgressBars { } + ScrollBars { } + Sliders { } + SlidersSmall { } + SlidersMini { } + } + } + + ScrollView { + contentWidth: width + clip: true + ScrollBar.vertical.policy: ScrollBar.AlwaysOn + + Column { + anchors.left: parent.left + anchors.right: parent.right + spacing: 20 + + CustomButtons { } + CustomCheckBoxes { } + CustomRadioButtons { } + CustomSpinBoxes { } + CustomTextFields { } + CustomTextAreas { } + CustomComboBoxes { } + CustomDials { } + CustomFrames { } + CustomProgressBars { } + CustomScrollBars { } + CustomSliders { } + } + } + } + +} diff --git a/tests/manual/nativestyle/nativestyle.pro b/tests/manual/nativestyle/nativestyle.pro new file mode 100644 index 00000000..9c700430 --- /dev/null +++ b/tests/manual/nativestyle/nativestyle.pro @@ -0,0 +1,39 @@ +QT += quick quickcontrols2 + +SOURCES += \ + main.cpp + +QML_FILES = \ + main.qml \ + ControlContainer.qml \ + Buttons.qml \ + CustomButtons.qml \ + Sliders.qml \ + SlidersSmall.qml \ + SlidersMini.qml \ + CustomSliders.qml \ + CheckBoxes.qml \ + CustomCheckBoxes.qml \ + RadioButtons.qml \ + CustomRadioButtons.qml \ + SpinBoxes.qml \ + CustomSpinBoxes.qml \ + TextFields.qml \ + CustomTextFields.qml \ + Frames.qml \ + CustomFrames.qml \ + TextAreas.qml \ + CustomTextAreas.qml \ + ComboBoxes.qml \ + CustomComboBoxes.qml \ + ScrollBars.qml \ + CustomScrollBars.qml \ + ProgressBars.qml \ + CustomProgressBars.qml \ + Dials.qml \ + CustomDials.qml \ + +OTHER_FILES += $$QML_FILES +RESOURCES += $$QML_FILES +RESOURCES += checkbox-icon.png checkbox-icon16.png checkbox-icon@2x.png + diff --git a/tests/manual/nativestyle/qml.qrc b/tests/manual/nativestyle/qml.qrc new file mode 100644 index 00000000..fba642e5 --- /dev/null +++ b/tests/manual/nativestyle/qml.qrc @@ -0,0 +1,7 @@ + + + main.qml + ButtonsTab.qml + SlidersTab.qml + + -- cgit v1.2.3 From eff6448667f4b8e9f3ccf871c708be5b66880115 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 27 Aug 2020 09:14:08 +0200 Subject: Native style: clean-up imports Change-Id: Id05edfccb617c72db902f5a7147ed8433be62e7c Reviewed-by: Mitch Curtis --- tests/manual/nativestyle/CheckBoxes.qml | 1 - tests/manual/nativestyle/CustomDials.qml | 2 +- tests/manual/nativestyle/CustomProgressBars.qml | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/manual/nativestyle/CheckBoxes.qml b/tests/manual/nativestyle/CheckBoxes.qml index 50b81ec4..6c27adab 100644 --- a/tests/manual/nativestyle/CheckBoxes.qml +++ b/tests/manual/nativestyle/CheckBoxes.qml @@ -37,7 +37,6 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 2.15 -import QtQuick.Controls.impl 2.12 ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomDials.qml b/tests/manual/nativestyle/CustomDials.qml index c1a0ac4e..e131548d 100644 --- a/tests/manual/nativestyle/CustomDials.qml +++ b/tests/manual/nativestyle/CustomDials.qml @@ -36,7 +36,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Default.impl 2.12 import QtQuick.Layouts 2.15 ControlContainer { diff --git a/tests/manual/nativestyle/CustomProgressBars.qml b/tests/manual/nativestyle/CustomProgressBars.qml index 93932a5e..c6cffa23 100644 --- a/tests/manual/nativestyle/CustomProgressBars.qml +++ b/tests/manual/nativestyle/CustomProgressBars.qml @@ -37,7 +37,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 2.15 -import QtQuick.Controls.impl 2.12 +import QtQuick.Controls.Default.impl 2.12 ControlContainer { id: container -- cgit v1.2.3 From 7e54b75b8660c794d5e5ed5e252b4a87fa105c2b Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 27 Aug 2020 17:36:45 +0200 Subject: Native style: remove versioning from imports Change-Id: I73319d18ca6540227ce6bf4bdcf217a3c279c64c Reviewed-by: Mitch Curtis --- tests/manual/nativestyle/Buttons.qml | 6 +++--- tests/manual/nativestyle/CheckBoxes.qml | 6 +++--- tests/manual/nativestyle/ComboBoxes.qml | 6 +++--- tests/manual/nativestyle/ControlContainer.qml | 6 +++--- tests/manual/nativestyle/CustomButtons.qml | 6 +++--- tests/manual/nativestyle/CustomCheckBoxes.qml | 8 ++++---- tests/manual/nativestyle/CustomComboBoxes.qml | 8 ++++---- tests/manual/nativestyle/CustomDials.qml | 8 ++++---- tests/manual/nativestyle/CustomFrames.qml | 6 +++--- tests/manual/nativestyle/CustomProgressBars.qml | 8 ++++---- tests/manual/nativestyle/CustomRadioButtons.qml | 8 ++++---- tests/manual/nativestyle/CustomScrollBars.qml | 6 +++--- tests/manual/nativestyle/CustomSliders.qml | 6 +++--- tests/manual/nativestyle/CustomSpinBoxes.qml | 6 +++--- tests/manual/nativestyle/CustomTextAreas.qml | 6 +++--- tests/manual/nativestyle/CustomTextFields.qml | 6 +++--- tests/manual/nativestyle/Dials.qml | 6 +++--- tests/manual/nativestyle/Frames.qml | 6 +++--- tests/manual/nativestyle/ProgressBars.qml | 6 +++--- tests/manual/nativestyle/RadioButtons.qml | 8 ++++---- tests/manual/nativestyle/ScrollBars.qml | 6 +++--- tests/manual/nativestyle/Sliders.qml | 6 +++--- tests/manual/nativestyle/SlidersMini.qml | 6 +++--- tests/manual/nativestyle/SlidersSmall.qml | 6 +++--- tests/manual/nativestyle/SpinBoxes.qml | 6 +++--- tests/manual/nativestyle/TextAreas.qml | 6 +++--- tests/manual/nativestyle/TextFields.qml | 6 +++--- tests/manual/nativestyle/main.qml | 8 ++++---- 28 files changed, 91 insertions(+), 91 deletions(-) (limited to 'tests') diff --git a/tests/manual/nativestyle/Buttons.qml b/tests/manual/nativestyle/Buttons.qml index 2a11dea3..d5eb2a9c 100644 --- a/tests/manual/nativestyle/Buttons.qml +++ b/tests/manual/nativestyle/Buttons.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/CheckBoxes.qml b/tests/manual/nativestyle/CheckBoxes.qml index 6c27adab..c24e9a54 100644 --- a/tests/manual/nativestyle/CheckBoxes.qml +++ b/tests/manual/nativestyle/CheckBoxes.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/ComboBoxes.qml b/tests/manual/nativestyle/ComboBoxes.qml index 37c6982c..21dd5b09 100644 --- a/tests/manual/nativestyle/ComboBoxes.qml +++ b/tests/manual/nativestyle/ComboBoxes.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/ControlContainer.qml b/tests/manual/nativestyle/ControlContainer.qml index 30022540..f528e994 100644 --- a/tests/manual/nativestyle/ControlContainer.qml +++ b/tests/manual/nativestyle/ControlContainer.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts Item { anchors.left: parent.left diff --git a/tests/manual/nativestyle/CustomButtons.qml b/tests/manual/nativestyle/CustomButtons.qml index edcdb086..6a01faed 100644 --- a/tests/manual/nativestyle/CustomButtons.qml +++ b/tests/manual/nativestyle/CustomButtons.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomCheckBoxes.qml b/tests/manual/nativestyle/CustomCheckBoxes.qml index fcec932f..3bcb05e9 100644 --- a/tests/manual/nativestyle/CustomCheckBoxes.qml +++ b/tests/manual/nativestyle/CustomCheckBoxes.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Controls.impl ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomComboBoxes.qml b/tests/manual/nativestyle/CustomComboBoxes.qml index 58793182..2308509d 100644 --- a/tests/manual/nativestyle/CustomComboBoxes.qml +++ b/tests/manual/nativestyle/CustomComboBoxes.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 -import QtQuick.Controls.impl 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Controls.impl ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomDials.qml b/tests/manual/nativestyle/CustomDials.qml index e131548d..b9c614c1 100644 --- a/tests/manual/nativestyle/CustomDials.qml +++ b/tests/manual/nativestyle/CustomDials.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.Default.impl 2.12 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Default.impl +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomFrames.qml b/tests/manual/nativestyle/CustomFrames.qml index 0b74b220..e2b045a5 100644 --- a/tests/manual/nativestyle/CustomFrames.qml +++ b/tests/manual/nativestyle/CustomFrames.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomProgressBars.qml b/tests/manual/nativestyle/CustomProgressBars.qml index c6cffa23..c920d243 100644 --- a/tests/manual/nativestyle/CustomProgressBars.qml +++ b/tests/manual/nativestyle/CustomProgressBars.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 -import QtQuick.Controls.Default.impl 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Controls.Default.impl ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomRadioButtons.qml b/tests/manual/nativestyle/CustomRadioButtons.qml index 9418b689..8a657cdd 100644 --- a/tests/manual/nativestyle/CustomRadioButtons.qml +++ b/tests/manual/nativestyle/CustomRadioButtons.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Controls.impl ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomScrollBars.qml b/tests/manual/nativestyle/CustomScrollBars.qml index fcac2eaf..07319952 100644 --- a/tests/manual/nativestyle/CustomScrollBars.qml +++ b/tests/manual/nativestyle/CustomScrollBars.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomSliders.qml b/tests/manual/nativestyle/CustomSliders.qml index 38cdf0a2..075c10d3 100644 --- a/tests/manual/nativestyle/CustomSliders.qml +++ b/tests/manual/nativestyle/CustomSliders.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomSpinBoxes.qml b/tests/manual/nativestyle/CustomSpinBoxes.qml index b632f311..b6de2b57 100644 --- a/tests/manual/nativestyle/CustomSpinBoxes.qml +++ b/tests/manual/nativestyle/CustomSpinBoxes.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomTextAreas.qml b/tests/manual/nativestyle/CustomTextAreas.qml index a729ea10..77e97b0c 100644 --- a/tests/manual/nativestyle/CustomTextAreas.qml +++ b/tests/manual/nativestyle/CustomTextAreas.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/CustomTextFields.qml b/tests/manual/nativestyle/CustomTextFields.qml index f781eb19..3e8ccd1e 100644 --- a/tests/manual/nativestyle/CustomTextFields.qml +++ b/tests/manual/nativestyle/CustomTextFields.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/Dials.qml b/tests/manual/nativestyle/Dials.qml index 56dff2a4..f0655f25 100644 --- a/tests/manual/nativestyle/Dials.qml +++ b/tests/manual/nativestyle/Dials.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/Frames.qml b/tests/manual/nativestyle/Frames.qml index 91cbec6d..220f8d03 100644 --- a/tests/manual/nativestyle/Frames.qml +++ b/tests/manual/nativestyle/Frames.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/ProgressBars.qml b/tests/manual/nativestyle/ProgressBars.qml index f19c05bd..8abd076d 100644 --- a/tests/manual/nativestyle/ProgressBars.qml +++ b/tests/manual/nativestyle/ProgressBars.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/RadioButtons.qml b/tests/manual/nativestyle/RadioButtons.qml index b9c49e7d..24a96b59 100644 --- a/tests/manual/nativestyle/RadioButtons.qml +++ b/tests/manual/nativestyle/RadioButtons.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 -import QtQuick.Controls.impl 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Controls.impl ControlContainer { id: container diff --git a/tests/manual/nativestyle/ScrollBars.qml b/tests/manual/nativestyle/ScrollBars.qml index f7b78f86..a5764c78 100644 --- a/tests/manual/nativestyle/ScrollBars.qml +++ b/tests/manual/nativestyle/ScrollBars.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/Sliders.qml b/tests/manual/nativestyle/Sliders.qml index dba0794b..dcc6c79c 100644 --- a/tests/manual/nativestyle/Sliders.qml +++ b/tests/manual/nativestyle/Sliders.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/SlidersMini.qml b/tests/manual/nativestyle/SlidersMini.qml index 542719e9..4c7610c4 100644 --- a/tests/manual/nativestyle/SlidersMini.qml +++ b/tests/manual/nativestyle/SlidersMini.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/SlidersSmall.qml b/tests/manual/nativestyle/SlidersSmall.qml index bd1f85a6..04c9cb24 100644 --- a/tests/manual/nativestyle/SlidersSmall.qml +++ b/tests/manual/nativestyle/SlidersSmall.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/SpinBoxes.qml b/tests/manual/nativestyle/SpinBoxes.qml index 0b66e977..60e2213b 100644 --- a/tests/manual/nativestyle/SpinBoxes.qml +++ b/tests/manual/nativestyle/SpinBoxes.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/TextAreas.qml b/tests/manual/nativestyle/TextAreas.qml index f0406146..0e1573b0 100644 --- a/tests/manual/nativestyle/TextAreas.qml +++ b/tests/manual/nativestyle/TextAreas.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/TextFields.qml b/tests/manual/nativestyle/TextFields.qml index 75f2b720..10e97da5 100644 --- a/tests/manual/nativestyle/TextFields.qml +++ b/tests/manual/nativestyle/TextFields.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ControlContainer { id: container diff --git a/tests/manual/nativestyle/main.qml b/tests/manual/nativestyle/main.qml index 6cf7a646..f0575820 100644 --- a/tests/manual/nativestyle/main.qml +++ b/tests/manual/nativestyle/main.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.15 -import QtQuick.Window 2.13 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts ApplicationWindow { visible: true -- cgit v1.2.3 From 8b3c28560426664f216f315d653e932f25baa610 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 28 Aug 2020 14:32:58 +0200 Subject: Native style, manual test: update location to Default style Change-Id: I3fb788ceba150664ed1c7b4040b73a0b7fdd7337 Reviewed-by: Mitch Curtis --- tests/manual/nativestyle/CustomCheckBoxes.qml | 4 ++-- tests/manual/nativestyle/CustomComboBoxes.qml | 4 ++-- tests/manual/nativestyle/CustomDials.qml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/manual/nativestyle/CustomCheckBoxes.qml b/tests/manual/nativestyle/CustomCheckBoxes.qml index 3bcb05e9..ce3a5543 100644 --- a/tests/manual/nativestyle/CustomCheckBoxes.qml +++ b/tests/manual/nativestyle/CustomCheckBoxes.qml @@ -76,7 +76,7 @@ ControlContainer { defaultColor: "#353637" scale: 0.5 color: "green" - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/check.png" visible: customIndicator.checkState === Qt.Checked } @@ -119,7 +119,7 @@ ControlContainer { defaultColor: "#353637" scale: 0.5 color: "green" - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/check.png" visible: allCustom.checkState === Qt.Checked } diff --git a/tests/manual/nativestyle/CustomComboBoxes.qml b/tests/manual/nativestyle/CustomComboBoxes.qml index 2308509d..bd793e28 100644 --- a/tests/manual/nativestyle/CustomComboBoxes.qml +++ b/tests/manual/nativestyle/CustomComboBoxes.qml @@ -61,7 +61,7 @@ ControlContainer { y: control.topPadding + (control.availableHeight - height) / 2 color: control.palette.dark defaultColor: "#353637" - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/double-arrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/double-arrow.png" opacity: enabled ? 1 : 0.3 } } @@ -100,7 +100,7 @@ ControlContainer { y: control2.topPadding + (control2.availableHeight - height) / 2 color: control2.palette.dark defaultColor: "#353637" - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/double-arrow.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/double-arrow.png" opacity: enabled ? 1 : 0.3 } } diff --git a/tests/manual/nativestyle/CustomDials.qml b/tests/manual/nativestyle/CustomDials.qml index b9c614c1..cc16e96f 100644 --- a/tests/manual/nativestyle/CustomDials.qml +++ b/tests/manual/nativestyle/CustomDials.qml @@ -68,7 +68,7 @@ ControlContainer { width: 14 height: 10 color: "green" - source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/dial-indicator.png" + source: "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/dial-indicator.png" antialiasing: true opacity: dial1.enabled ? 1 : 0.3 transform: [ -- cgit v1.2.3