diff options
Diffstat (limited to 'tests/manual')
138 files changed, 3483 insertions, 277 deletions
diff --git a/tests/manual/buttons/ButtonLoader.qml b/tests/manual/buttons/ButtonLoader.qml index 574997e1..ecbf637b 100644 --- a/tests/manual/buttons/ButtonLoader.qml +++ b/tests/manual/buttons/ButtonLoader.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { id: root diff --git a/tests/manual/buttons/buttons.qml b/tests/manual/buttons/buttons.qml index 0848038d..26969440 100644 --- a/tests/manual/buttons/buttons.qml +++ b/tests/manual/buttons/buttons.qml @@ -47,10 +47,10 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Universal 2.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Material +import QtQuick.Controls.Universal ApplicationWindow { id: window diff --git a/tests/manual/dialogs/CustomDialog.qml b/tests/manual/dialogs/CustomDialog.qml index 0e86fbb8..fb191c9f 100644 --- a/tests/manual/dialogs/CustomDialog.qml +++ b/tests/manual/dialogs/CustomDialog.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick.Controls 2.12 +import QtQuick.Controls Dialog { id: root diff --git a/tests/manual/dialogs/DialogLabel.qml b/tests/manual/dialogs/DialogLabel.qml index c4775aea..3a1533eb 100644 --- a/tests/manual/dialogs/DialogLabel.qml +++ b/tests/manual/dialogs/DialogLabel.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick.Controls 2.12 +import QtQuick.Controls Label { x: dialog.x + (dialog.width - width) / 2 diff --git a/tests/manual/dialogs/Marker.qml b/tests/manual/dialogs/Marker.qml index 439b50f2..cd93d055 100644 --- a/tests/manual/dialogs/Marker.qml +++ b/tests/manual/dialogs/Marker.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick Rectangle { anchors.fill: parent diff --git a/tests/manual/dialogs/dialogs.qml b/tests/manual/dialogs/dialogs.qml index a3048c34..e7c8c2e1 100644 --- a/tests/manual/dialogs/dialogs.qml +++ b/tests/manual/dialogs/dialogs.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts ApplicationWindow { id: window diff --git a/tests/manual/fonts/main.qml b/tests/manual/fonts/main.qml index 4182a654..8d3464a0 100644 --- a/tests/manual/fonts/main.qml +++ b/tests/manual/fonts/main.qml @@ -48,10 +48,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Templates 2.12 as T -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T +import QtQuick.Layouts ApplicationWindow { visible: true diff --git a/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml b/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml index b0504cd7..37dc5c7f 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: busyIndicator.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-button-flat.qml b/tests/manual/gifs/data/qtquickcontrols2-button-flat.qml index c52c0391..dd07926f 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-button-flat.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-button-flat.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: button.width diff --git a/tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml b/tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml index 6398df50..4af50d6b 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: button.width diff --git a/tests/manual/gifs/data/qtquickcontrols2-button.qml b/tests/manual/gifs/data/qtquickcontrols2-button.qml index 6361174f..8336855c 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-button.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-button.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: button.width diff --git a/tests/manual/gifs/data/qtquickcontrols2-checkbox-tristate.qml b/tests/manual/gifs/data/qtquickcontrols2-checkbox-tristate.qml index b6f31682..b0bee6cd 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-checkbox-tristate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-checkbox-tristate.qml @@ -48,10 +48,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Window 2.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Window Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml b/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml index 1e1348f5..46cdc073 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml @@ -48,10 +48,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Window 2.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Window Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-checkdelegate-tristate.qml b/tests/manual/gifs/data/qtquickcontrols2-checkdelegate-tristate.qml index 767f80dc..585aea27 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-checkdelegate-tristate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-checkdelegate-tristate.qml @@ -48,10 +48,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Window 2.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Window Window { id: window diff --git a/tests/manual/gifs/data/qtquickcontrols2-checkdelegate.qml b/tests/manual/gifs/data/qtquickcontrols2-checkdelegate.qml index d222b21f..704a0601 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-checkdelegate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-checkdelegate.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-combobox.qml b/tests/manual/gifs/data/qtquickcontrols2-combobox.qml index bd46b54d..274f2efe 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-combobox.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-combobox.qml @@ -48,10 +48,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Window 2.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Window Window { width: 140 diff --git a/tests/manual/gifs/data/qtquickcontrols2-delaybutton.qml b/tests/manual/gifs/data/qtquickcontrols2-delaybutton.qml index b0feddcb..8eaa3df2 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-delaybutton.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-delaybutton.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: button.width diff --git a/tests/manual/gifs/data/qtquickcontrols2-dial-no-wrap.qml b/tests/manual/gifs/data/qtquickcontrols2-dial-no-wrap.qml index 04f167a2..3b9b1466 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-dial-no-wrap.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-dial-no-wrap.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: dial.implicitWidth + 20 diff --git a/tests/manual/gifs/data/qtquickcontrols2-dial-wrap.qml b/tests/manual/gifs/data/qtquickcontrols2-dial-wrap.qml index e00139f0..317d81d2 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-dial-wrap.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-dial-wrap.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: dial.implicitWidth + 20 diff --git a/tests/manual/gifs/data/qtquickcontrols2-drawer.qml b/tests/manual/gifs/data/qtquickcontrols2-drawer.qml index 690dfdc4..32efcba8 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-drawer.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-drawer.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Window 2.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Window ApplicationWindow { id: window diff --git a/tests/manual/gifs/data/qtquickcontrols2-itemdelegate.qml b/tests/manual/gifs/data/qtquickcontrols2-itemdelegate.qml index b0188edb..1ef9e2c0 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-itemdelegate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-itemdelegate.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-menu.qml b/tests/manual/gifs/data/qtquickcontrols2-menu.qml index 39403e06..80f2c86d 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-menu.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-menu.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls // TODO: restore and finish https://codereview.qt-project.org/#/c/123948/ ApplicationWindow { diff --git a/tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml b/tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml index 6d2c50b2..4679ea03 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: progressBar.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-progressbar.qml b/tests/manual/gifs/data/qtquickcontrols2-progressbar.qml index a8f751ce..994af450 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-progressbar.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-progressbar.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: progressBar.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-radiobutton.qml b/tests/manual/gifs/data/qtquickcontrols2-radiobutton.qml index 1e640ced..fec7ec9b 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-radiobutton.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-radiobutton.qml @@ -48,10 +48,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Window 2.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Window Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-radiodelegate.qml b/tests/manual/gifs/data/qtquickcontrols2-radiodelegate.qml index eaa1ff7a..a00f3209 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-radiodelegate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-radiodelegate.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-rangeslider.qml b/tests/manual/gifs/data/qtquickcontrols2-rangeslider.qml index b30711b4..c648f998 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-rangeslider.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-rangeslider.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: slider.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-scrollbar-snap.qml b/tests/manual/gifs/data/qtquickcontrols2-scrollbar-snap.qml index 27b6b280..cc4d6dc2 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-scrollbar-snap.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-scrollbar-snap.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: 100 diff --git a/tests/manual/gifs/data/qtquickcontrols2-scrollbar.qml b/tests/manual/gifs/data/qtquickcontrols2-scrollbar.qml index 573c408b..e838673a 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-scrollbar.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-scrollbar.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: 100 diff --git a/tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml b/tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml index 1cdd1b61..be23df3b 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: 100 diff --git a/tests/manual/gifs/data/qtquickcontrols2-slider-snap.qml b/tests/manual/gifs/data/qtquickcontrols2-slider-snap.qml index ff7dd780..26066770 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-slider-snap.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-slider-snap.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: slider.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-slider.qml b/tests/manual/gifs/data/qtquickcontrols2-slider.qml index 689e50f2..83f652aa 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-slider.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-slider.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: slider.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-stackview-pop.qml b/tests/manual/gifs/data/qtquickcontrols2-stackview-pop.qml index 9c3ad1f1..7ddd8db8 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-stackview-pop.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-stackview-pop.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls ApplicationWindow { width: 160 diff --git a/tests/manual/gifs/data/qtquickcontrols2-stackview-push.qml b/tests/manual/gifs/data/qtquickcontrols2-stackview-push.qml index cf3e8c3c..88229fce 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-stackview-push.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-stackview-push.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls ApplicationWindow { width: 160 diff --git a/tests/manual/gifs/data/qtquickcontrols2-stackview-replace.qml b/tests/manual/gifs/data/qtquickcontrols2-stackview-replace.qml index 2c68a3cb..59885745 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-stackview-replace.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-stackview-replace.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls ApplicationWindow { width: 160 diff --git a/tests/manual/gifs/data/qtquickcontrols2-stackview-unwind.qml b/tests/manual/gifs/data/qtquickcontrols2-stackview-unwind.qml index afb1f242..a7435d2a 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-stackview-unwind.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-stackview-unwind.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls ApplicationWindow { width: 160 diff --git a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-behind.qml b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-behind.qml index 6025b62b..0b18c6a3 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-behind.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-behind.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: swipeDelegate.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-leading-trailing.qml b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-leading-trailing.qml index da9d0fb5..789fb86f 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-leading-trailing.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate-leading-trailing.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: swipeDelegate.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate.qml b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate.qml index 745432cb..c78fc6d4 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-swipedelegate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-swipedelegate.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: swipeDelegate.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-swipeview.qml b/tests/manual/gifs/data/qtquickcontrols2-swipeview.qml index d7d8829a..9004ff18 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-swipeview.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-swipeview.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: 300 diff --git a/tests/manual/gifs/data/qtquickcontrols2-switch.qml b/tests/manual/gifs/data/qtquickcontrols2-switch.qml index 7e98d9db..a9497bde 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-switch.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-switch.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: 100 diff --git a/tests/manual/gifs/data/qtquickcontrols2-switchdelegate.qml b/tests/manual/gifs/data/qtquickcontrols2-switchdelegate.qml index 2a70e484..1caece5b 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-switchdelegate.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-switchdelegate.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: column.implicitWidth diff --git a/tests/manual/gifs/data/qtquickcontrols2-tabbar.qml b/tests/manual/gifs/data/qtquickcontrols2-tabbar.qml index e01c7665..a973cef8 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-tabbar.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-tabbar.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: 300 diff --git a/tests/manual/gifs/data/qtquickcontrols2-tumbler-wrap.qml b/tests/manual/gifs/data/qtquickcontrols2-tumbler-wrap.qml index 77d17f11..bfad311e 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-tumbler-wrap.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-tumbler-wrap.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Window +import QtQuick.Controls Window { width: frame.implicitWidth + 10 diff --git a/tests/manual/gifs/eventcapturer.cpp b/tests/manual/gifs/eventcapturer.cpp index b3bbd7c8..ad88b1db 100644 --- a/tests/manual/gifs/eventcapturer.cpp +++ b/tests/manual/gifs/eventcapturer.cpp @@ -124,7 +124,7 @@ void EventCapturer::setCapturedEventTypes(QSet<QEvent::Type> types) mCapturedEventTypes = types; } -QVector<CapturedEvent> EventCapturer::capturedEvents() const +QList<CapturedEvent> EventCapturer::capturedEvents() const { if (mMoveEventTrimFlags == TrimNone || mEvents.isEmpty()) return mEvents; @@ -167,7 +167,7 @@ QVector<CapturedEvent> EventCapturer::capturedEvents() const // the indices are still valid - we could be removing from the middle of // the commands next. Also, the function is const, so we can't remove from // mEvents anyway. :) - QVector<CapturedEvent> events = mEvents.mid(firstEventIndex, (lastEventIndex - firstEventIndex) + 1); + QList<CapturedEvent> events = mEvents.mid(firstEventIndex, (lastEventIndex - firstEventIndex) + 1); if (mMoveEventTrimFlags.testFlag(TrimAfterReleases)) { bool lastNonMoveEventWasRelease = false; diff --git a/tests/manual/gifs/eventcapturer.h b/tests/manual/gifs/eventcapturer.h index e2b8b3a4..ea01299f 100644 --- a/tests/manual/gifs/eventcapturer.h +++ b/tests/manual/gifs/eventcapturer.h @@ -40,9 +40,9 @@ #include <QObject> #include <QElapsedTimer> #include <QEvent> +#include <QList> #include <QPoint> #include <QSet> -#include <QVector> #include "capturedevent.h" @@ -72,7 +72,7 @@ public: QSet<QEvent::Type> capturedEventTypes(); void setCapturedEventTypes(QSet<QEvent::Type> types); - QVector<CapturedEvent> capturedEvents() const; + QList<CapturedEvent> capturedEvents() const; protected: bool eventFilter(QObject *object, QEvent *event) override; @@ -87,7 +87,7 @@ private: Qt::Key mStopCaptureKey; MoveEventTrimFlags mMoveEventTrimFlags; QElapsedTimer mDelayTimer; - QVector<CapturedEvent> mEvents; + QList<CapturedEvent> mEvents; int mDuration; int mLastCaptureTime; }; diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp index d7d8f98d..80c3fd9f 100644 --- a/tests/manual/gifs/tst_gifs.cpp +++ b/tests/manual/gifs/tst_gifs.cpp @@ -609,19 +609,19 @@ void tst_Gifs::swipeDelegateBehind() void tst_Gifs::delegates_data() { QTest::addColumn<QString>("name"); - QTest::addColumn<QVector<int> >("pressIndices"); + QTest::addColumn<QList<int> >("pressIndices"); QTest::addColumn<int>("duration"); - QTest::newRow("ItemDelegate") << "itemdelegate" << (QVector<int>() << 0 << 1 << 2) << 5; - QTest::newRow("CheckDelegate") << "checkdelegate" << (QVector<int>() << 0 << 0) << 5; - QTest::newRow("RadioDelegate") << "radiodelegate" << (QVector<int>() << 1 << 0) << 5; - QTest::newRow("SwitchDelegate") << "switchdelegate" << (QVector<int>() << 0 << 0) << 5; + QTest::newRow("ItemDelegate") << "itemdelegate" << (QList<int> { 0, 1, 2 }) << 5; + QTest::newRow("CheckDelegate") << "checkdelegate" << (QList<int> { 0, 0 }) << 5; + QTest::newRow("RadioDelegate") << "radiodelegate" << (QList<int> { 1, 0 }) << 5; + QTest::newRow("SwitchDelegate") << "switchdelegate" << (QList<int> { 0, 0 }) << 5; } void tst_Gifs::delegates() { QFETCH(QString, name); - QFETCH(QVector<int>, pressIndices); + QFETCH(QList<int>, pressIndices); QFETCH(int, duration); GifRecorder gifRecorder; @@ -710,16 +710,16 @@ void tst_Gifs::dial() void tst_Gifs::checkables_data() { QTest::addColumn<QString>("name"); - QTest::addColumn<QVector<int> >("pressIndices"); + QTest::addColumn<QList<int> >("pressIndices"); - QTest::newRow("checkbox") << "checkbox" << (QVector<int>() << 1 << 2 << 2 << 1); - QTest::newRow("radiobutton") << "radiobutton" << (QVector<int>() << 1 << 2 << 1 << 0); + QTest::newRow("checkbox") << "checkbox" << (QList<int> { 1, 2, 2, 1 }); + QTest::newRow("radiobutton") << "radiobutton" << (QList<int> { 1, 2, 1, 0 }); } void tst_Gifs::checkables() { QFETCH(QString, name); - QFETCH(QVector<int>, pressIndices); + QFETCH(QList<int>, pressIndices); GifRecorder gifRecorder; gifRecorder.setDataDirPath(dataDirPath); diff --git a/tests/manual/headerview/main.cpp b/tests/manual/headerview/main.cpp index 4c1e611c..b1573f08 100644 --- a/tests/manual/headerview/main.cpp +++ b/tests/manual/headerview/main.cpp @@ -199,7 +199,7 @@ public: } private: - QVector<QVariant> hData, vData; + QList<QVariant> hData, vData; }; int main(int argc, char *argv[]) diff --git a/tests/manual/headerview/main.qml b/tests/manual/headerview/main.qml index ab9c3dc5..abce1c00 100644 --- a/tests/manual/headerview/main.qml +++ b/tests/manual/headerview/main.qml @@ -48,13 +48,13 @@ ** ****************************************************************************/ -import QtQml.Models 2.15 -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Shapes 1.15 -import QtQuick.Window 2.15 -import Qt.labs.qmlmodels 1.0 -import TestTableModelWithHeader 0.1 +import QtQml.Models +import QtQuick +import QtQuick.Controls +import QtQuick.Shapes +import QtQuick.Window +import Qt.labs.qmlmodels +import TestTableModelWithHeader Window { visible: true 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..d5eb2a9c --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..c24e9a54 --- /dev/null +++ b/tests/manual/nativestyle/CheckBoxes.qml @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** 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 +import QtQuick.Controls +import QtQuick.Layouts + +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..21dd5b09 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..f528e994 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..6a01faed --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..ce3a5543 --- /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 +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Controls.impl + +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/Default/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/Default/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..bd793e28 --- /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 +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Controls.impl + +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/Default/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/Default/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..cc16e96f --- /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 +import QtQuick.Controls +import QtQuick.Controls.Default.impl +import QtQuick.Layouts + +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/Default/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..e2b045a5 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..c920d243 --- /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 +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Controls.Default.impl + +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..8a657cdd --- /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 +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Controls.impl + +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..07319952 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..075c10d3 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..b6de2b57 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..77e97b0c --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..3e8ccd1e --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..f0655f25 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..220f8d03 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..8abd076d --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..24a96b59 --- /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 +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Controls.impl + +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..a5764c78 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..dcc6c79c --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..4c7610c4 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..04c9cb24 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..60e2213b --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..0e1573b0 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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..10e97da5 --- /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 +import QtQuick.Controls +import QtQuick.Layouts + +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 Binary files differnew file mode 100644 index 00000000..ee669b3a --- /dev/null +++ b/tests/manual/nativestyle/checkbox-icon.png diff --git a/tests/manual/nativestyle/checkbox-icon16.png b/tests/manual/nativestyle/checkbox-icon16.png Binary files differnew file mode 100644 index 00000000..8d89eab8 --- /dev/null +++ b/tests/manual/nativestyle/checkbox-icon16.png diff --git a/tests/manual/nativestyle/checkbox-icon@2x.png b/tests/manual/nativestyle/checkbox-icon@2x.png Binary files differnew file mode 100644 index 00000000..51c5601d --- /dev/null +++ b/tests/manual/nativestyle/checkbox-icon@2x.png 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 <QGuiApplication> +#include <QQmlApplicationEngine> +#include <QtQuickControls2/qquickstyle.h> + +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..f0575820 --- /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 +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts + +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 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + <file>ButtonsTab.qml</file> + <file>SlidersTab.qml</file> + </qresource> +</RCC> diff --git a/tests/manual/screenshots/screenshots.qml b/tests/manual/screenshots/screenshots.qml index 2ab684c1..3496b32b 100644 --- a/tests/manual/screenshots/screenshots.qml +++ b/tests/manual/screenshots/screenshots.qml @@ -48,10 +48,10 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 -import Qt.labs.folderlistmodel 2.1 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import Qt.labs.folderlistmodel ApplicationWindow { id: window diff --git a/tests/manual/shared/FontAwesome.qml b/tests/manual/shared/FontAwesome.qml index 9e387594..d64176b4 100644 --- a/tests/manual/shared/FontAwesome.qml +++ b/tests/manual/shared/FontAwesome.qml @@ -47,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick pragma Singleton diff --git a/tests/manual/shared/FontAwesomeIcon.qml b/tests/manual/shared/FontAwesomeIcon.qml index f46ed364..74e7c5da 100644 --- a/tests/manual/shared/FontAwesomeIcon.qml +++ b/tests/manual/shared/FontAwesomeIcon.qml @@ -47,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick import "qrc:/shared" Text { diff --git a/tests/manual/styles-cover-flow/CoverFlowDelegate.qml b/tests/manual/styles-cover-flow/CoverFlowDelegate.qml index 474a189a..061ecfa0 100644 --- a/tests/manual/styles-cover-flow/CoverFlowDelegate.qml +++ b/tests/manual/styles-cover-flow/CoverFlowDelegate.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtGraphicalEffects 1.12 -import QtQuick 2.12 +import QtGraphicalEffects +import QtQuick Item { id: root diff --git a/tests/manual/styles-cover-flow/CoverFlowPath.qml b/tests/manual/styles-cover-flow/CoverFlowPath.qml index 37e7f894..0f70e6b8 100644 --- a/tests/manual/styles-cover-flow/CoverFlowPath.qml +++ b/tests/manual/styles-cover-flow/CoverFlowPath.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick Path { // Point 1 diff --git a/tests/manual/styles-cover-flow/styles-cover-flow.qml b/tests/manual/styles-cover-flow/styles-cover-flow.qml index 273f0869..ec9630cd 100644 --- a/tests/manual/styles-cover-flow/styles-cover-flow.qml +++ b/tests/manual/styles-cover-flow/styles-cover-flow.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 +import QtQuick +import QtQuick.Window Window { // Different delegate positions and widths and window background colors diff --git a/tests/manual/styles/styles.qml b/tests/manual/styles/styles.qml index 7c4721d1..83bd9b34 100644 --- a/tests/manual/styles/styles.qml +++ b/tests/manual/styles/styles.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls ApplicationWindow { id: window diff --git a/tests/manual/systemtrayicon/systemtrayicon.qml b/tests/manual/systemtrayicon/systemtrayicon.qml index a7e656d4..d44bc83b 100644 --- a/tests/manual/systemtrayicon/systemtrayicon.qml +++ b/tests/manual/systemtrayicon/systemtrayicon.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Qt.labs.platform 1.0 +import QtQuick +import QtQuick.Controls +import Qt.labs.platform ApplicationWindow { id: window @@ -75,7 +75,7 @@ ApplicationWindow { SystemTrayIcon { visible: true - iconSource: "qrc:/files/images/qt_logo_green_256.png" + icon.source: "qrc:/files/images/qt_logo_green_256.png" menu: Menu { MenuItem { diff --git a/tests/manual/testbench/ColorEditor.qml b/tests/manual/testbench/ColorEditor.qml index 7f472f9b..2723f33d 100644 --- a/tests/manual/testbench/ColorEditor.qml +++ b/tests/manual/testbench/ColorEditor.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.14 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts RowLayout { property alias labelText: label.text diff --git a/tests/manual/testbench/ControlContainer.qml b/tests/manual/testbench/ControlContainer.qml index 095d3822..4bd99bd3 100644 --- a/tests/manual/testbench/ControlContainer.qml +++ b/tests/manual/testbench/ControlContainer.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick Item { id: container diff --git a/tests/manual/testbench/ExampleContainer.qml b/tests/manual/testbench/ExampleContainer.qml index 5d2ac758..903e52db 100644 --- a/tests/manual/testbench/ExampleContainer.qml +++ b/tests/manual/testbench/ExampleContainer.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts Frame { id: container diff --git a/tests/manual/testbench/SettingsDialog.qml b/tests/manual/testbench/SettingsDialog.qml index 71b4c342..d75f89f1 100644 --- a/tests/manual/testbench/SettingsDialog.qml +++ b/tests/manual/testbench/SettingsDialog.qml @@ -48,12 +48,12 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Imagine 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Imagine +import QtQuick.Layouts -import App 1.0 +import App Dialog { id: settingsDialog diff --git a/tests/manual/testbench/controls/BusyIndicator.qml b/tests/manual/testbench/controls/BusyIndicator.qml index 22b3d98a..cc0f4518 100644 --- a/tests/manual/testbench/controls/BusyIndicator.qml +++ b/tests/manual/testbench/controls/BusyIndicator.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/Button.qml b/tests/manual/testbench/controls/Button.qml index 44ddfee0..ac57453f 100644 --- a/tests/manual/testbench/controls/Button.qml +++ b/tests/manual/testbench/controls/Button.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/CheckBox.qml b/tests/manual/testbench/controls/CheckBox.qml index b79d800d..0598dae8 100644 --- a/tests/manual/testbench/controls/CheckBox.qml +++ b/tests/manual/testbench/controls/CheckBox.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/CheckDelegate.qml b/tests/manual/testbench/controls/CheckDelegate.qml index c8089fab..8f546384 100644 --- a/tests/manual/testbench/controls/CheckDelegate.qml +++ b/tests/manual/testbench/controls/CheckDelegate.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/ComboBox.qml b/tests/manual/testbench/controls/ComboBox.qml index 335eeb56..75fb7701 100644 --- a/tests/manual/testbench/controls/ComboBox.qml +++ b/tests/manual/testbench/controls/ComboBox.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/DelayButton.qml b/tests/manual/testbench/controls/DelayButton.qml index ae887ef3..c0f6faa2 100644 --- a/tests/manual/testbench/controls/DelayButton.qml +++ b/tests/manual/testbench/controls/DelayButton.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/Dial.qml b/tests/manual/testbench/controls/Dial.qml index 06b91076..16c99ec8 100644 --- a/tests/manual/testbench/controls/Dial.qml +++ b/tests/manual/testbench/controls/Dial.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/Dialog.qml b/tests/manual/testbench/controls/Dialog.qml index 52aa923e..0ea9d3be 100644 --- a/tests/manual/testbench/controls/Dialog.qml +++ b/tests/manual/testbench/controls/Dialog.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts // TODO QtObject { diff --git a/tests/manual/testbench/controls/Frame.qml b/tests/manual/testbench/controls/Frame.qml index c7b176fb..dd88c3b8 100644 --- a/tests/manual/testbench/controls/Frame.qml +++ b/tests/manual/testbench/controls/Frame.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/GroupBox.qml b/tests/manual/testbench/controls/GroupBox.qml index eda7ad79..80ced769 100644 --- a/tests/manual/testbench/controls/GroupBox.qml +++ b/tests/manual/testbench/controls/GroupBox.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/ItemDelegate.qml b/tests/manual/testbench/controls/ItemDelegate.qml index 8cf348d4..0b887e2f 100644 --- a/tests/manual/testbench/controls/ItemDelegate.qml +++ b/tests/manual/testbench/controls/ItemDelegate.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/Label.qml b/tests/manual/testbench/controls/Label.qml index 92192e09..d8155a20 100644 --- a/tests/manual/testbench/controls/Label.qml +++ b/tests/manual/testbench/controls/Label.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/Menu.qml b/tests/manual/testbench/controls/Menu.qml index 3bb54009..ba15c052 100644 --- a/tests/manual/testbench/controls/Menu.qml +++ b/tests/manual/testbench/controls/Menu.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts // TODO QtObject { diff --git a/tests/manual/testbench/controls/MenuBar.qml b/tests/manual/testbench/controls/MenuBar.qml index 77a7da2b..f435c9a5 100644 --- a/tests/manual/testbench/controls/MenuBar.qml +++ b/tests/manual/testbench/controls/MenuBar.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls // TODO QtObject { diff --git a/tests/manual/testbench/controls/Page.qml b/tests/manual/testbench/controls/Page.qml index add9cc09..3d310676 100644 --- a/tests/manual/testbench/controls/Page.qml +++ b/tests/manual/testbench/controls/Page.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/PageIndicator.qml b/tests/manual/testbench/controls/PageIndicator.qml index 60094e4d..5de29ef1 100644 --- a/tests/manual/testbench/controls/PageIndicator.qml +++ b/tests/manual/testbench/controls/PageIndicator.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/Pane.qml b/tests/manual/testbench/controls/Pane.qml index c8b6c699..b5329b71 100644 --- a/tests/manual/testbench/controls/Pane.qml +++ b/tests/manual/testbench/controls/Pane.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/ProgressBar.qml b/tests/manual/testbench/controls/ProgressBar.qml index 67047178..bc2d9045 100644 --- a/tests/manual/testbench/controls/ProgressBar.qml +++ b/tests/manual/testbench/controls/ProgressBar.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/RadioButton.qml b/tests/manual/testbench/controls/RadioButton.qml index b1fff6dc..7ca9bd0a 100644 --- a/tests/manual/testbench/controls/RadioButton.qml +++ b/tests/manual/testbench/controls/RadioButton.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/RadioDelegate.qml b/tests/manual/testbench/controls/RadioDelegate.qml index e449744c..ddafd14c 100644 --- a/tests/manual/testbench/controls/RadioDelegate.qml +++ b/tests/manual/testbench/controls/RadioDelegate.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/RangeSlider.qml b/tests/manual/testbench/controls/RangeSlider.qml index b3d84e53..71208fb8 100644 --- a/tests/manual/testbench/controls/RangeSlider.qml +++ b/tests/manual/testbench/controls/RangeSlider.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/RoundButton.qml b/tests/manual/testbench/controls/RoundButton.qml index 5d066133..fb2d1d43 100644 --- a/tests/manual/testbench/controls/RoundButton.qml +++ b/tests/manual/testbench/controls/RoundButton.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/ScrollBar.qml b/tests/manual/testbench/controls/ScrollBar.qml index 25c7f4d6..4ed80f75 100644 --- a/tests/manual/testbench/controls/ScrollBar.qml +++ b/tests/manual/testbench/controls/ScrollBar.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/ScrollIndicator.qml b/tests/manual/testbench/controls/ScrollIndicator.qml index 2c6fd4a9..d9ee487d 100644 --- a/tests/manual/testbench/controls/ScrollIndicator.qml +++ b/tests/manual/testbench/controls/ScrollIndicator.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/Slider.qml b/tests/manual/testbench/controls/Slider.qml index 831f4778..21e751ac 100644 --- a/tests/manual/testbench/controls/Slider.qml +++ b/tests/manual/testbench/controls/Slider.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/SpinBox.qml b/tests/manual/testbench/controls/SpinBox.qml index 0fdfb9fe..22ca6cce 100644 --- a/tests/manual/testbench/controls/SpinBox.qml +++ b/tests/manual/testbench/controls/SpinBox.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/SplitView.qml b/tests/manual/testbench/controls/SplitView.qml index 94f06221..f2801def 100644 --- a/tests/manual/testbench/controls/SplitView.qml +++ b/tests/manual/testbench/controls/SplitView.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.13 -import QtQuick.Controls 2.13 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/SwipeDelegate.qml b/tests/manual/testbench/controls/SwipeDelegate.qml index 141435d8..13d0a443 100644 --- a/tests/manual/testbench/controls/SwipeDelegate.qml +++ b/tests/manual/testbench/controls/SwipeDelegate.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/Switch.qml b/tests/manual/testbench/controls/Switch.qml index 6df1a0e0..6e877a49 100644 --- a/tests/manual/testbench/controls/Switch.qml +++ b/tests/manual/testbench/controls/Switch.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/SwitchDelegate.qml b/tests/manual/testbench/controls/SwitchDelegate.qml index ac4a322a..4f60da55 100644 --- a/tests/manual/testbench/controls/SwitchDelegate.qml +++ b/tests/manual/testbench/controls/SwitchDelegate.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/TabBar.qml b/tests/manual/testbench/controls/TabBar.qml index 7e98eb93..a7a1de49 100644 --- a/tests/manual/testbench/controls/TabBar.qml +++ b/tests/manual/testbench/controls/TabBar.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls // TODO QtObject { diff --git a/tests/manual/testbench/controls/TextArea.qml b/tests/manual/testbench/controls/TextArea.qml index ae3cf08b..dfe28f79 100644 --- a/tests/manual/testbench/controls/TextArea.qml +++ b/tests/manual/testbench/controls/TextArea.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/TextField.qml b/tests/manual/testbench/controls/TextField.qml index b9a5bfb8..1eed3a6c 100644 --- a/tests/manual/testbench/controls/TextField.qml +++ b/tests/manual/testbench/controls/TextField.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/ToolBar.qml b/tests/manual/testbench/controls/ToolBar.qml index ec80ebe7..3aba3377 100644 --- a/tests/manual/testbench/controls/ToolBar.qml +++ b/tests/manual/testbench/controls/ToolBar.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts // TODO QtObject { diff --git a/tests/manual/testbench/controls/ToolTip.qml b/tests/manual/testbench/controls/ToolTip.qml index 3e3a017b..ddcf92f8 100644 --- a/tests/manual/testbench/controls/ToolTip.qml +++ b/tests/manual/testbench/controls/ToolTip.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/controls/Tumbler.qml b/tests/manual/testbench/controls/Tumbler.qml index f10af24e..a2dbebef 100644 --- a/tests/manual/testbench/controls/Tumbler.qml +++ b/tests/manual/testbench/controls/Tumbler.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts QtObject { property var supportedStates: [ diff --git a/tests/manual/testbench/main.cpp b/tests/manual/testbench/main.cpp index 0287537d..0584bd6d 100644 --- a/tests/manual/testbench/main.cpp +++ b/tests/manual/testbench/main.cpp @@ -55,6 +55,7 @@ #include <QQmlApplicationEngine> #include <QQmlContext> #include <QQuickStyle> +#include <QtQuickControls2/private/qquickstyle_p.h> #include "assetfixer.h" #include "clipboard.h" @@ -85,7 +86,7 @@ int main(int argc, char *argv[]) qmlRegisterType<Clipboard>("App", 1, 0, "Clipboard"); qmlRegisterType<DirectoryValidator>("App", 1, 0, "DirectoryValidator"); - engine.rootContext()->setContextProperty("availableStyles", QQuickStyle::availableStyles()); + engine.rootContext()->setContextProperty("availableStyles", QQuickStylePrivate::builtInStyles()); engine.load(QUrl(QStringLiteral("qrc:/testbench.qml"))); diff --git a/tests/manual/testbench/testbench.pro b/tests/manual/testbench/testbench.pro index 829bcbde..4509f496 100644 --- a/tests/manual/testbench/testbench.pro +++ b/tests/manual/testbench/testbench.pro @@ -1,6 +1,6 @@ TEMPLATE = app -QT += qml quick quickcontrols2 +QT += qml quick quickcontrols2 quickcontrols2-private CONFIG += c++11 HEADERS += \ diff --git a/tests/manual/testbench/testbench.qml b/tests/manual/testbench/testbench.qml index daef63b1..2cd8fb43 100644 --- a/tests/manual/testbench/testbench.qml +++ b/tests/manual/testbench/testbench.qml @@ -48,15 +48,15 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Imagine 2.12 -import Qt.labs.folderlistmodel 2.2 -import Qt.labs.settings 1.0 +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Controls.Imagine +import Qt.labs.folderlistmodel +import Qt.labs.settings -import App 1.0 +import App ApplicationWindow { id: window @@ -70,7 +70,7 @@ ApplicationWindow { readonly property bool usingImagineStyle: settings.style.toLowerCase() === "imagine" // Some controls should be visible regardless of whether or not custom assets are lacking for it, // so we use the default assets in some cases. - readonly property string defaultImaginePath: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Imagine/images/" + readonly property string defaultImaginePath: "qrc:/qt-project.org/imports/QtQuick/Controls/Imagine/images/" property bool settingsLoaded: false readonly property string imagineTitleText: " - " + (settings.useCustomImaginePath ? settings.imaginePath : "Default Assets") diff --git a/tests/manual/viewinqwidget/main.cpp b/tests/manual/viewinqwidget/main.cpp index 80cbb415..b6b7a5ff 100644 --- a/tests/manual/viewinqwidget/main.cpp +++ b/tests/manual/viewinqwidget/main.cpp @@ -38,9 +38,9 @@ #include <QHBoxLayout> #include <QVBoxLayout> #include <QDebug> -#include <QDesktopWidget> #include <QDir> #include <QGroupBox> +#include <QScreen> #include <QQmlApplicationEngine> #include <QQmlError> #include <QQuickView> @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) vLayout->addWidget(container); hLayout->addWidget(groupBox); - const QRect availableGeometry = QApplication::desktop()->availableGeometry(&widget); + const QRect availableGeometry = widget.screen()->availableGeometry(); widget.move(availableGeometry.center() - QPoint(widget.sizeHint().width() / 2, widget.sizeHint().height() / 2)); widget.show(); diff --git a/tests/manual/viewinqwidget/main.qml b/tests/manual/viewinqwidget/main.qml index f383f022..5ac170b3 100644 --- a/tests/manual/viewinqwidget/main.qml +++ b/tests/manual/viewinqwidget/main.qml @@ -34,8 +34,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Item { visible: true |