aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-07 17:20:24 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-07 17:24:19 +0200
commita3b706531b98c64137acaebf26756828cd43a2a0 (patch)
treeb04490213d60519b8a0c90f9c166eef862ed185b
parent2f4a059881dbec289d86abc7456b42d5eec77ceb (diff)
parentc2b7e55af43518ae1898eddf8611ef617149ca8a (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-checked.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-explicit.qml src/quicktemplates2/qquickmenu.cpp tests/auto/controls/data/tst_buttongroup.qml tests/auto/controls/data/tst_swipedelegate.qml Change-Id: Ib6042a0ad716f557927e7412d17ea8957d06c015
-rw-r--r--.gitignore1
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-button-custom.pngbin0 -> 1512 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-checkbox-tristate.gifbin4033 -> 8784 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-checkbox.gifbin2864 -> 6403 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-checkbox.pngbin2573 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-checkdelegate-tristate.gifbin0 -> 10487 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-checkdelegate.gifbin14330 -> 15290 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-itemdelegate.gifbin14448 -> 16287 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-popup-custom.pngbin0 -> 630 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-progressbar-disabled.pngbin133 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.gifbin0 -> 5882 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.pngbin229 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-progressbar-normal.pngbin133 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-progressbar.gifbin0 -> 2072 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-radiobutton-checked.pngbin2591 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-radiobutton-disabled.pngbin2179 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-radiobutton-focused.pngbin2328 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-radiobutton-normal.pngbin2027 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-radiobutton.gifbin0 -> 7993 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-radiobutton.pngbin3491 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-radiodelegate.gifbin16357 -> 16859 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-rangeslider-disabled.pngbin1106 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-rangeslider-first-handle-focused.pngbin1266 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-rangeslider-first-handle.pngbin1230 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-rangeslider-normal.pngbin1266 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-rangeslider-second-handle-focused.pngbin1266 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-rangeslider-second-handle.pngbin1385 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-rangeslider.gifbin18024 -> 17402 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-rangeslider.pngbin1204 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-scrollbar.gifbin0 -> 32067 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-scrollbar.pngbin680 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-scrollindicator.gifbin0 -> 42352 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-scrollindicator.pngbin387 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-slider-disabled.pngbin1019 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-slider-focused.pngbin1154 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-slider-normal.pngbin1154 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-slider-nosnap.gifbin0 -> 18138 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-slider-snapalways.gifbin0 -> 7201 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-slider-snaponrelease.gifbin0 -> 18377 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-slider.gifbin16972 -> 13697 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-slider.pngbin1117 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-tabbar-explicit.pngbin0 -> 2701 bytes
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml10
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-popup-custom.qml3
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-custom.qml13
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml34
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml33
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-checked.qml34
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-disabled.qml34
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-focused.qml34
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-normal.qml33
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-disabled.qml35
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle-focused.qml35
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-normal.qml34
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle-focused.qml35
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle.qml39
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-disabled.qml34
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-focused.qml34
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-normal.qml33
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-explicit.qml (renamed from src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle.qml)33
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-buttons.qdoc15
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc32
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-indicators.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-input.qdoc4
-rw-r--r--src/imports/controls/material/SpinBox.qml2
-rw-r--r--src/imports/controls/material/TextArea.qml2
-rw-r--r--src/imports/controls/material/TextField.qml2
-rw-r--r--src/quicktemplates2/qquickabstractbutton.cpp2
-rw-r--r--src/quicktemplates2/qquickapplicationwindow.cpp32
-rw-r--r--src/quicktemplates2/qquickcheckdelegate.cpp4
-rw-r--r--src/quicktemplates2/qquickmenu.cpp2
-rw-r--r--src/quicktemplates2/qquickprogressbar.cpp12
-rw-r--r--src/quicktemplates2/qquickradiobutton.cpp26
-rw-r--r--src/quicktemplates2/qquickradiodelegate.cpp18
-rw-r--r--src/quicktemplates2/qquickrangeslider.cpp11
-rw-r--r--src/quicktemplates2/qquickscrollbar.cpp4
-rw-r--r--src/quicktemplates2/qquickscrollindicator.cpp4
-rw-r--r--src/quicktemplates2/qquickslider.cpp33
-rw-r--r--src/quicktemplates2/qquickswipedelegate.cpp2
-rw-r--r--src/quicktemplates2/qquicktabbar.cpp17
-rw-r--r--tests/auto/controls/data/tst_button.qml9
-rw-r--r--tests/auto/controls/data/tst_buttongroup.qml40
-rw-r--r--tests/auto/controls/data/tst_combobox.qml34
-rw-r--r--tests/auto/controls/data/tst_control.qml23
-rw-r--r--tests/auto/controls/data/tst_popup.qml73
-rw-r--r--tests/auto/controls/data/tst_rangeslider.qml36
-rw-r--r--tests/auto/controls/data/tst_scrollbar.qml18
-rw-r--r--tests/auto/controls/data/tst_slider.qml22
-rw-r--r--tests/auto/controls/data/tst_spinbox.qml37
-rw-r--r--tests/auto/controls/data/tst_stackview.qml7
-rw-r--r--tests/auto/controls/data/tst_swipedelegate.qml200
-rw-r--r--tests/auto/controls/data/tst_swipeview.qml17
-rw-r--r--tests/auto/controls/data/tst_tabbar.qml20
-rw-r--r--tests/auto/controls/data/tst_toolbutton.qml40
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-checkbox.qml8
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-checkdelegate-tristate.qml81
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml57
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-progressbar.qml71
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-radiobutton.qml73
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-scrollbar.qml70
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml67
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-slider-snap.qml79
-rw-r--r--tests/manual/gifs/tst_gifs.cpp233
-rw-r--r--tests/manual/manual.pro1
-rw-r--r--tests/manual/screenshots/qtquickcontrols2.conf2
-rw-r--r--tests/manual/screenshots/screenshots.cpp62
-rw-r--r--tests/manual/screenshots/screenshots.pro13
-rw-r--r--tests/manual/screenshots/screenshots.qml164
108 files changed, 1327 insertions, 999 deletions
diff --git a/.gitignore b/.gitignore
index 7c99c1e1..059c91e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,6 +43,7 @@
/tests/manual/gifs/tst_gifs
/tests/manual/styles/styles
/tests/manual/testbench/testbench
+/tests/manual/screenshots/screenshots
/tests/auto/snippets/screenshots/*.png
/tests/manual/gifs/gifs/*.gif
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-custom.png b/src/imports/controls/doc/images/qtquickcontrols2-button-custom.png
new file mode 100644
index 00000000..e418da04
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-button-custom.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-checkbox-tristate.gif b/src/imports/controls/doc/images/qtquickcontrols2-checkbox-tristate.gif
index 50986f1b..56a15867 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-checkbox-tristate.gif
+++ b/src/imports/controls/doc/images/qtquickcontrols2-checkbox-tristate.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-checkbox.gif b/src/imports/controls/doc/images/qtquickcontrols2-checkbox.gif
index beacdb37..d70c0ee4 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-checkbox.gif
+++ b/src/imports/controls/doc/images/qtquickcontrols2-checkbox.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-checkbox.png b/src/imports/controls/doc/images/qtquickcontrols2-checkbox.png
deleted file mode 100644
index a824949c..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-checkbox.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-checkdelegate-tristate.gif b/src/imports/controls/doc/images/qtquickcontrols2-checkdelegate-tristate.gif
new file mode 100644
index 00000000..8d058d6c
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-checkdelegate-tristate.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-checkdelegate.gif b/src/imports/controls/doc/images/qtquickcontrols2-checkdelegate.gif
index d379f63c..da3fab98 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-checkdelegate.gif
+++ b/src/imports/controls/doc/images/qtquickcontrols2-checkdelegate.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-itemdelegate.gif b/src/imports/controls/doc/images/qtquickcontrols2-itemdelegate.gif
index 0e8554ff..dccb6efc 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-itemdelegate.gif
+++ b/src/imports/controls/doc/images/qtquickcontrols2-itemdelegate.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-popup-custom.png b/src/imports/controls/doc/images/qtquickcontrols2-popup-custom.png
new file mode 100644
index 00000000..aa07d53a
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-popup-custom.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-disabled.png b/src/imports/controls/doc/images/qtquickcontrols2-progressbar-disabled.png
deleted file mode 100644
index 9ce19e92..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-disabled.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.gif b/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.gif
new file mode 100644
index 00000000..d6756d16
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.png b/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.png
deleted file mode 100644
index ec2e9ae9..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-normal.png b/src/imports/controls/doc/images/qtquickcontrols2-progressbar-normal.png
deleted file mode 100644
index 9ce19e92..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-normal.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-progressbar.gif b/src/imports/controls/doc/images/qtquickcontrols2-progressbar.gif
new file mode 100644
index 00000000..49af5f45
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-progressbar.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-checked.png b/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-checked.png
deleted file mode 100644
index d22a595b..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-checked.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-disabled.png b/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-disabled.png
deleted file mode 100644
index 11a99d6f..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-disabled.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-focused.png b/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-focused.png
deleted file mode 100644
index d7c79ed1..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-focused.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-normal.png b/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-normal.png
deleted file mode 100644
index 8a49bf58..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton-normal.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton.gif b/src/imports/controls/doc/images/qtquickcontrols2-radiobutton.gif
new file mode 100644
index 00000000..4cbf3ed9
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-radiobutton.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton.png b/src/imports/controls/doc/images/qtquickcontrols2-radiobutton.png
deleted file mode 100644
index 6c217968..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-radiobutton.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-radiodelegate.gif b/src/imports/controls/doc/images/qtquickcontrols2-radiodelegate.gif
index 851064e9..b6afd6fe 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-radiodelegate.gif
+++ b/src/imports/controls/doc/images/qtquickcontrols2-radiodelegate.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-disabled.png b/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-disabled.png
deleted file mode 100644
index 8406fca6..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-disabled.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-first-handle-focused.png b/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-first-handle-focused.png
deleted file mode 100644
index c5f658d5..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-first-handle-focused.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-first-handle.png b/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-first-handle.png
deleted file mode 100644
index 535362bf..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-first-handle.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-normal.png b/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-normal.png
deleted file mode 100644
index c5f658d5..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-normal.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-second-handle-focused.png b/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-second-handle-focused.png
deleted file mode 100644
index c5f658d5..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-second-handle-focused.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-second-handle.png b/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-second-handle.png
deleted file mode 100644
index 44509959..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider-second-handle.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider.gif b/src/imports/controls/doc/images/qtquickcontrols2-rangeslider.gif
index 394e8085..d35b1502 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider.gif
+++ b/src/imports/controls/doc/images/qtquickcontrols2-rangeslider.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider.png b/src/imports/controls/doc/images/qtquickcontrols2-rangeslider.png
deleted file mode 100644
index abb033c2..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-rangeslider.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-scrollbar.gif b/src/imports/controls/doc/images/qtquickcontrols2-scrollbar.gif
new file mode 100644
index 00000000..ed3ab607
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-scrollbar.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-scrollbar.png b/src/imports/controls/doc/images/qtquickcontrols2-scrollbar.png
deleted file mode 100644
index b1abafb5..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-scrollbar.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-scrollindicator.gif b/src/imports/controls/doc/images/qtquickcontrols2-scrollindicator.gif
new file mode 100644
index 00000000..73007820
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-scrollindicator.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-scrollindicator.png b/src/imports/controls/doc/images/qtquickcontrols2-scrollindicator.png
deleted file mode 100644
index ea0923cc..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-scrollindicator.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-slider-disabled.png b/src/imports/controls/doc/images/qtquickcontrols2-slider-disabled.png
deleted file mode 100644
index 919a9a2b..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-slider-disabled.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-slider-focused.png b/src/imports/controls/doc/images/qtquickcontrols2-slider-focused.png
deleted file mode 100644
index e6c4179c..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-slider-focused.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-slider-normal.png b/src/imports/controls/doc/images/qtquickcontrols2-slider-normal.png
deleted file mode 100644
index e6c4179c..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-slider-normal.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-slider-nosnap.gif b/src/imports/controls/doc/images/qtquickcontrols2-slider-nosnap.gif
new file mode 100644
index 00000000..ab233c5b
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-slider-nosnap.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-slider-snapalways.gif b/src/imports/controls/doc/images/qtquickcontrols2-slider-snapalways.gif
new file mode 100644
index 00000000..8eb4011f
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-slider-snapalways.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-slider-snaponrelease.gif b/src/imports/controls/doc/images/qtquickcontrols2-slider-snaponrelease.gif
new file mode 100644
index 00000000..f3b1d5c7
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-slider-snaponrelease.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-slider.gif b/src/imports/controls/doc/images/qtquickcontrols2-slider.gif
index 7cb84b56..2ee56334 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-slider.gif
+++ b/src/imports/controls/doc/images/qtquickcontrols2-slider.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-slider.png b/src/imports/controls/doc/images/qtquickcontrols2-slider.png
deleted file mode 100644
index 2e27a604..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-slider.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-tabbar-explicit.png b/src/imports/controls/doc/images/qtquickcontrols2-tabbar-explicit.png
new file mode 100644
index 00000000..cdfee3d0
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-tabbar-explicit.png
Binary files differ
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml
index 6742abf6..1bf9baf4 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml
@@ -44,8 +44,8 @@ Dial {
handle: Rectangle {
id: handleItem
- x: background.x + background.width / 2 - handle.width / 2
- y: background.y + background.height / 2 - handle.height / 2
+ x: control.background.x + control.background.width / 2 - width / 2
+ y: control.background.y + control.background.height / 2 - height / 2
width: 16
height: 16
color: control.pressed ? "#17a81a" : "#21be2b"
@@ -54,12 +54,12 @@ Dial {
opacity: control.enabled ? 1 : 0.3
transform: [
Translate {
- y: -Math.min(background.width, background.height) * 0.4 + handle.height / 2
+ y: -Math.min(control.background.width, control.background.height) * 0.4 + handleItem.height / 2
},
Rotation {
angle: control.angle
- origin.x: handle.width / 2
- origin.y: handle.height / 2
+ origin.x: handleItem.width / 2
+ origin.y: handleItem.height / 2
}
]
}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-popup-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-popup-custom.qml
index 32025cc7..6b427611 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-popup-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-popup-custom.qml
@@ -35,12 +35,13 @@ Item {
height: 200
Binding {
- target: root
+ target: popup
property: "visible"
value: root.Window.active
}
//! [1]
Popup {
+ id: popup
background: Rectangle {
implicitWidth: 200
implicitHeight: 200
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-custom.qml
index c29956e4..9e6779d6 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-custom.qml
@@ -32,22 +32,21 @@ import QtQuick.Controls 2.1
ProgressBar {
id: control
value: 0.5
+ padding: 2
background: Rectangle {
implicitWidth: 200
- implicitHeight: 4
- x: control.leftPadding
- y: parent.height / 2 - height / 2
+ implicitHeight: 6
color: "#e6e6e6"
- radius: 2
+ radius: 3
}
contentItem: Item {
- implicitWidth: background.implicitWidth
- implicitHeight: background.implicitHeight
+ implicitWidth: 200
+ implicitHeight: 4
Rectangle {
- width: control.visualPosition * background.width
+ width: control.visualPosition * parent.width
height: parent.height
radius: 2
color: "#17a81a"
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml
deleted file mode 100644
index 885f058a..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-ProgressBar {
- value: 0.5
- enabled: false
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml
deleted file mode 100644
index 1a4eb8cc..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml
+++ /dev/null
@@ -1,33 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-ProgressBar {
- value: 0.5
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-checked.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-checked.qml
deleted file mode 100644
index 6d144589..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-checked.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-RadioButton {
- text: "Checked"
- checked: true
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-disabled.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-disabled.qml
deleted file mode 100644
index 3aefc293..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-disabled.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-RadioButton {
- text: "Disabled"
- enabled: false
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-focused.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-focused.qml
deleted file mode 100644
index 2de742a4..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-focused.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-RadioButton {
- text: "Focused"
- focus: true
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-normal.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-normal.qml
deleted file mode 100644
index cc4248c4..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-normal.qml
+++ /dev/null
@@ -1,33 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-RadioButton {
- text: "Normal"
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-disabled.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-disabled.qml
deleted file mode 100644
index e7ef44ef..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-disabled.qml
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-RangeSlider {
- first.value: 0.25
- second.value: 0.75
- enabled: false
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle-focused.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle-focused.qml
deleted file mode 100644
index 4328c203..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle-focused.qml
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-RangeSlider {
- first.value: 0.25
- second.value: 0.75
- first.handle.focus: true
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-normal.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-normal.qml
deleted file mode 100644
index f2cbb1fa..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-normal.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-RangeSlider {
- first.value: 0.25
- second.value: 0.75
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle-focused.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle-focused.qml
deleted file mode 100644
index 37b4940d..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle-focused.qml
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-RangeSlider {
- first.value: 0.25
- second.value: 0.75
- second.handle.focus: true
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle.qml
deleted file mode 100644
index 9e206ecb..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle.qml
+++ /dev/null
@@ -1,39 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-RangeSlider {
- first.value: 0.25
- second.value: 0.75
- Rectangle {
- anchors.fill: second.handle
- color: "transparent"
- border.color: "red"
- }
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-disabled.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-disabled.qml
deleted file mode 100644
index bd60a974..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-disabled.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-Slider {
- value: 0.5
- enabled: false
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-focused.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-focused.qml
deleted file mode 100644
index 05ee2ee3..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-focused.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-Slider {
- value: 0.5
- focus: true
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-normal.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-normal.qml
deleted file mode 100644
index ab824904..00000000
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-normal.qml
+++ /dev/null
@@ -1,33 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Controls 2.1
-
-Slider {
- value: 0.5
-}
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-explicit.qml
index a8d58ae0..f3e24f10 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-explicit.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2016 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -25,15 +25,28 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtQuick.Controls 2.1
+import QtQuick 2.6
+import QtQuick.Controls 2.0
-RangeSlider {
- first.value: 0.25
- second.value: 0.75
- Rectangle {
- anchors.fill: first.handle
- color: "transparent"
- border.color: "red"
+Item {
+ width: 360
+ height: childrenRect.height
+
+//! [1]
+TabBar {
+ width: parent.width
+ TabButton {
+ text: "First"
+ width: implicitWidth
+ }
+ TabButton {
+ text: "Second"
+ width: implicitWidth
}
+ TabButton {
+ text: "Third"
+ width: implicitWidth
+ }
+}
+//! [1]
}
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-buttons.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-buttons.qdoc
index 48b0097d..5e2c9370 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-buttons.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-buttons.qdoc
@@ -50,16 +50,7 @@
to perform an action. The most common examples are Apply, Cancel,
Save, Close and Help.
- \table
- \row \li \image qtquickcontrols2-button-normal.png
- \li A button in its normal state.
- \row \li \image qtquickcontrols2-button-pressed.png
- \li A button that is pressed.
- \row \li \image qtquickcontrols2-button-focused.png
- \li A button that has active focus.
- \row \li \image qtquickcontrols2-button-disabled.png
- \li A button that is disabled.
- \endtable
+ \image qtquickcontrols2-button.gif
Recommendations:
@@ -75,7 +66,7 @@
\section1 CheckBox Control
- \image qtquickcontrols2-checkbox.png
+ \image qtquickcontrols2-checkbox.gif
\l CheckBox is used to build multi-selection option lists. Any number of
options can be selected, including none, but the options should
@@ -111,7 +102,7 @@
\section1 RadioButton Control
- \image qtquickcontrols2-radiobutton.png
+ \image qtquickcontrols2-radiobutton.gif
\l RadioButton is used to select only one option from a set of options.
Selecting one option automatically deselects the one selected before.
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
index bdd69f8e..866aef23 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
@@ -335,6 +335,38 @@
\l {Customizing a Control} section. The code can be used as a starting
point to implement a custom look and feel.
+ \section2 Customizing ApplicationWindow
+
+ ApplicationWindow consists of one visual item:
+ \l {ApplicationWindow::background}{background}. It is also possible
+ to customize the \l {ApplicationWindow::overlay}{modal} and
+ \l {ApplicationWindow::overlay}{modeless} items.
+
+ \code
+ import QtQuick 2.7
+ import QtQuick.Controls 2.0
+
+ ApplicationWindow {
+ visible: true
+
+ background: Rectangle {
+ gradient: Gradient {
+ GradientStop { position: 0; color: "#ffffff" }
+ GradientStop { position: 1; color: "#c1bbf9" }
+ }
+ }
+
+ overlay.modal: Rectangle {
+ color: "#8f28282a"
+ }
+
+ overlay.modeless: Rectangle {
+ color: "#2f28282a"
+ }
+ }
+ \endcode
+
+
\section2 Customizing BusyIndicator
BusyIndicator consists of two visual items: \l {Control::background}{background}
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-indicators.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-indicators.qdoc
index 010ff444..03750844 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-indicators.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-indicators.qdoc
@@ -54,7 +54,7 @@
\section1 ScrollBar Control
- \image qtquickcontrols2-scrollbar.png
+ \image qtquickcontrols2-scrollbar.gif
\l ScrollBar is an interactive bar that indicates the current scroll
position, and can be used to scroll to a specific position in a
@@ -62,7 +62,7 @@
\section1 ScrollIndicator Control
- \image qtquickcontrols2-scrollindicator.png
+ \image qtquickcontrols2-scrollindicator.gif
\l ScrollIndicator is a non-interactive indicator that indicates the
current scroll position, and can be used to scroll to a specific position in a
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc
index 681a9d89..c3583fd1 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc
@@ -85,13 +85,13 @@
\section1 Slider Control
- \image qtquickcontrols2-slider.png
+ \image qtquickcontrols2-slider.gif
\l Slider is used to select a value by sliding a handle along a track.
\section1 RangeSlider Control
- \image qtquickcontrols2-rangeslider.png
+ \image qtquickcontrols2-rangeslider.gif
\l RangeSlider is used to select a range specified by two values,
by sliding each handle along a track.
diff --git a/src/imports/controls/material/SpinBox.qml b/src/imports/controls/material/SpinBox.qml
index 4058077b..257e9bf2 100644
--- a/src/imports/controls/material/SpinBox.qml
+++ b/src/imports/controls/material/SpinBox.qml
@@ -94,7 +94,7 @@ T.SpinBox {
id: timer
running: control.activeFocus
repeat: true
- interval: Qt.styleHints.cursorFlashTime
+ interval: Qt.styleHints.cursorFlashTime / 2
onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0
// force the cursor visible when gaining focus
onRunningChanged: cursor.opacity = 1
diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml
index f8734ad1..3f30af00 100644
--- a/src/imports/controls/material/TextArea.qml
+++ b/src/imports/controls/material/TextArea.qml
@@ -76,7 +76,7 @@ T.TextArea {
id: timer
running: control.activeFocus
repeat: true
- interval: Qt.styleHints.cursorFlashTime
+ interval: Qt.styleHints.cursorFlashTime / 2
onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0
// force the cursor visible when gaining focus
onRunningChanged: cursor.opacity = 1
diff --git a/src/imports/controls/material/TextField.qml b/src/imports/controls/material/TextField.qml
index a8eae1e2..edab2385 100644
--- a/src/imports/controls/material/TextField.qml
+++ b/src/imports/controls/material/TextField.qml
@@ -76,7 +76,7 @@ T.TextField {
id: timer
running: control.activeFocus
repeat: true
- interval: Qt.styleHints.cursorFlashTime
+ interval: Qt.styleHints.cursorFlashTime / 2
onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0
// force the cursor visible when gaining focus
onRunningChanged: cursor.opacity = 1
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp
index f2442cb7..ce75a497 100644
--- a/src/quicktemplates2/qquickabstractbutton.cpp
+++ b/src/quicktemplates2/qquickabstractbutton.cpp
@@ -384,7 +384,7 @@ void QQuickAbstractButton::setCheckable(bool checkable)
one button can be checked at any time; checking another button automatically
unchecks the previously checked one.
- \note The property has no effect on buttons that belong to an ButtonGroup.
+ \note The property has no effect on buttons that belong to a ButtonGroup.
RadioButton and TabButton are auto-exclusive by default.
*/
diff --git a/src/quicktemplates2/qquickapplicationwindow.cpp b/src/quicktemplates2/qquickapplicationwindow.cpp
index 7fb406c1..7f65b8bf 100644
--- a/src/quicktemplates2/qquickapplicationwindow.cpp
+++ b/src/quicktemplates2/qquickapplicationwindow.cpp
@@ -94,7 +94,7 @@ QT_BEGIN_NAMESPACE
\note By default, an ApplicationWindow is not visible.
- \sa Page, {Container Controls}
+ \sa {Customizing ApplicationWindow}, Page, {Container Controls}
*/
class QQuickApplicationWindowPrivate : public QQuickItemChangeListener
@@ -275,9 +275,15 @@ QQuickApplicationWindow::~QQuickApplicationWindow()
The background item is stacked under the \l {contentItem}{content item},
but above the \l {Window::color}{background color} of the window.
+ The background item is useful for images and gradients, for example,
+ but the \l {Window::}{color} property is preferable for solid colors,
+ as it doesn't need to create an item.
+
\note If the background item has no explicit size specified, it automatically
follows the control's size. In most cases, there is no need to specify
width or height for a background item.
+
+ \sa {Customizing ApplicationWindow}, contentItem, header, footer, overlay
*/
QQuickItem *QQuickApplicationWindow::background() const
{
@@ -408,6 +414,17 @@ void QQuickApplicationWindow::setFooter(QQuickItem *footer)
This default property holds the list of all objects declared as children of
the window.
+ The data property allows you to freely mix visual children, resources and
+ other windows in an ApplicationWindow.
+
+ If you assign an Item to the contentData list, it becomes a child of the
+ window's contentItem, so that it appears inside the window. The item's
+ parent will be the window's \l contentItem.
+
+ It should not generally be necessary to refer to the contentData property,
+ as it is the default property for ApplicationWindow and thus all child
+ items are automatically assigned to this property.
+
\sa contentItem
*/
QQmlListProperty<QObject> QQuickApplicationWindow::contentData()
@@ -420,6 +437,11 @@ QQmlListProperty<QObject> QQuickApplicationWindow::contentData()
\readonly
This property holds the window content item.
+
+ The content item is stacked above the \l background item, and under the
+ \l header, \l footer, and \l overlay items.
+
+ \sa background, header, footer, overlay
*/
QQuickItem *QQuickApplicationWindow::contentItem() const
{
@@ -476,6 +498,14 @@ QQuickItem *QQuickApplicationWindow::activeFocusControl() const
\li This property holds a component to use as a visual item that implements
background dimming for modeless popups. It is created for and stacked below
visible dimming popups.
+ \row
+ \li overlay.pressed()
+ \li This signal is emitted when the overlay is pressed by the user while
+ a popup is visible.
+ \row
+ \li overlay.released()
+ \li This signal is emitted when the overlay is released by the user while
+ a modal popup is visible.
\endtable
\sa Popup::modal, Popup::dim
diff --git a/src/quicktemplates2/qquickcheckdelegate.cpp b/src/quicktemplates2/qquickcheckdelegate.cpp
index 249aaa95..304d2b6c 100644
--- a/src/quicktemplates2/qquickcheckdelegate.cpp
+++ b/src/quicktemplates2/qquickcheckdelegate.cpp
@@ -108,6 +108,10 @@ QQuickCheckDelegate::QQuickCheckDelegate(QQuickItem *parent) :
This property determines whether the check delegate has three states.
+ In the animation below, the first checkdelegate is tri-state:
+
+ \image qtquickcontrols2-checkdelegate-tristate.gif
+
The default is \c false, i.e., the delegate has only two states.
*/
bool QQuickCheckDelegate::isTristate() const
diff --git a/src/quicktemplates2/qquickmenu.cpp b/src/quicktemplates2/qquickmenu.cpp
index 80ad5b68..ed2cd7e0 100644
--- a/src/quicktemplates2/qquickmenu.cpp
+++ b/src/quicktemplates2/qquickmenu.cpp
@@ -415,7 +415,7 @@ QVariant QQuickMenu::contentModel() const
\note Unlike \c contentChildren, \c contentData does include non-visual QML
objects. It is not re-ordered when items are inserted or moved.
- \sa Item::data, Popup::contentChildren
+ \sa Item::data, {Popup::}{contentChildren}
*/
QQmlListProperty<QObject> QQuickMenu::contentData()
{
diff --git a/src/quicktemplates2/qquickprogressbar.cpp b/src/quicktemplates2/qquickprogressbar.cpp
index 9c091ba1..00ecc5c5 100644
--- a/src/quicktemplates2/qquickprogressbar.cpp
+++ b/src/quicktemplates2/qquickprogressbar.cpp
@@ -48,16 +48,11 @@ QT_BEGIN_NAMESPACE
\ingroup qtquickcontrols2-indicators
\brief Indicates the progress of an operation.
+ \image qtquickcontrols2-progressbar.gif
+
ProgressBar indicates the progress of an operation. The value should be updated
regularly. The range is defined by \l from and \l to, which both can contain any value.
- \table
- \row \li \image qtquickcontrols2-progressbar-normal.png
- \li A progress bar in its normal state.
- \row \li \image qtquickcontrols2-progressbar-disabled.png
- \li A progress bar that is disabled.
- \endtable
-
\code
ProgressBar {
value: 0.5
@@ -214,8 +209,7 @@ qreal QQuickProgressBar::visualPosition() const
A progress bar in indeterminate mode displays that an operation is in progress, but it
doesn't show how much progress has been made.
- See below for an example:
- \image qtquickcontrols2-progressbar-indeterminate.png
+ \image qtquickcontrols2-progressbar-indeterminate.gif
*/
bool QQuickProgressBar::isIndeterminate() const
diff --git a/src/quicktemplates2/qquickradiobutton.cpp b/src/quicktemplates2/qquickradiobutton.cpp
index 2aafbfbd..a8d11377 100644
--- a/src/quicktemplates2/qquickradiobutton.cpp
+++ b/src/quicktemplates2/qquickradiobutton.cpp
@@ -50,25 +50,27 @@ QT_BEGIN_NAMESPACE
\ingroup qtquickcontrols2-buttons
\brief An option button that can be toggled on or off.
+ \image qtquickcontrols2-radiobutton.gif
+
RadioButton presents an option button that can be toggled on (checked) or
off (unchecked). Radio buttons are typically used to select one option
from a set of options.
- \table
- \row \li \image qtquickcontrols2-radiobutton-normal.png
- \li A radio button in its normal state.
- \row \li \image qtquickcontrols2-radiobutton-checked.png
- \li A radio button that is checked.
- \row \li \image qtquickcontrols2-radiobutton-focused.png
- \li A radio button that has active focus.
- \row \li \image qtquickcontrols2-radiobutton-disabled.png
- \li A radio button that is disabled.
- \endtable
+ RadioButton inherits its API from \l AbstractButton. For instance,
+ you can set \l {AbstractButton::text}{text} and react to
+ \l {AbstractButton::clicked}{clicks} using the AbstractButton API.
+ The state of the radio button can be set with the
+ \l {AbstractButton::}{checked} property.
Radio buttons are \l {AbstractButton::autoExclusive}{auto-exclusive}
by default. Only one button can be checked at any time amongst radio
buttons that belong to the same parent item; checking another button
- automatically unchecks the previously checked one.
+ automatically unchecks the previously checked one. For radio buttons
+ that do not share a common parent, ButtonGroup can be used to manage
+ exclusivity.
+
+ \l RadioDelegate is similar to RadioButton, except that it is typically
+ used in views.
\code
ColumnLayout {
@@ -85,7 +87,7 @@ QT_BEGIN_NAMESPACE
}
\endcode
- \sa ButtonGroup, {Customizing RadioButton}, {Button Controls}
+ \sa ButtonGroup, {Customizing RadioButton}, {Button Controls}, RadioDelegate
*/
QQuickRadioButton::QQuickRadioButton(QQuickItem *parent) :
diff --git a/src/quicktemplates2/qquickradiodelegate.cpp b/src/quicktemplates2/qquickradiodelegate.cpp
index 01a27cc9..bf3557e8 100644
--- a/src/quicktemplates2/qquickradiodelegate.cpp
+++ b/src/quicktemplates2/qquickradiodelegate.cpp
@@ -56,9 +56,23 @@ QT_BEGIN_NAMESPACE
off (unchecked). Radio delegates are typically used to select one option
from a set of options.
- The state of the radio delegate can be set with the
+ RadioDelegate inherits its API from \l ItemDelegate, which is inherited
+ from AbstractButton. For instance, you can set \l {AbstractButton::text}{text},
+ and react to \l {AbstractButton::clicked}{clicks} using the AbstractButton
+ API. The state of the radio delegate can be set with the
\l {AbstractButton::}{checked} property.
+ Radio delegates are \l {AbstractButton::autoExclusive}{auto-exclusive}
+ by default. Only one delegate can be checked at any time amongst radio
+ delegates that belong to the same parent item; checking another delegate
+ automatically unchecks the previously checked one. For radio delegates
+ that do not share a common parent, ButtonGroup can be used to manage
+ exclusivity.
+
+ \l RadioButton is similar to RadioDelegate, except that it is typically
+ not used in views, but rather when there are only a few options, and often
+ with the requirement that each button is uniquely identifiable.
+
\code
ButtonGroup {
id: buttonGroup
@@ -74,7 +88,7 @@ QT_BEGIN_NAMESPACE
}
\endcode
- \sa {Customizing RadioDelegate}, {Delegate Controls}
+ \sa {Customizing RadioDelegate}, {Delegate Controls}, RadioButton
*/
QQuickRadioDelegate::QQuickRadioDelegate(QQuickItem *parent) :
diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp
index 34654fe1..a4862fa6 100644
--- a/src/quicktemplates2/qquickrangeslider.cpp
+++ b/src/quicktemplates2/qquickrangeslider.cpp
@@ -56,17 +56,6 @@ QT_BEGIN_NAMESPACE
RangeSlider is used to select a range specified by two values, by sliding
each handle along a track.
- \table
- \row \li \image qtquickcontrols2-rangeslider-normal.png
- \li A range slider in its normal state.
- \row \li \image qtquickcontrols2-rangeslider-first-handle-focused.png
- \li A range slider whose first handle has active focus.
- \row \li \image qtquickcontrols2-rangeslider-second-handle-focused.png
- \li A range slider whose second handle has active focus.
- \row \li \image qtquickcontrols2-rangeslider-disabled.png
- \li A range slider that is disabled.
- \endtable
-
\code
RangeSlider {
first.value: 0.25
diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp
index 5f26814d..d81b1bd5 100644
--- a/src/quicktemplates2/qquickscrollbar.cpp
+++ b/src/quicktemplates2/qquickscrollbar.cpp
@@ -52,12 +52,12 @@ QT_BEGIN_NAMESPACE
\ingroup qtquickcontrols2-indicators
\brief An interactive scroll bar control.
+ \image qtquickcontrols2-scrollbar.gif
+
ScrollBar is an interactive bar that can be used to scroll to a specific
position. A scroll bar can be either \l vertical or \l horizontal, and can
be attached to any \l Flickable, such as \l ListView and \l GridView.
- \image qtquickcontrols2-scrollbar.png
-
\code
Flickable {
// ...
diff --git a/src/quicktemplates2/qquickscrollindicator.cpp b/src/quicktemplates2/qquickscrollindicator.cpp
index 351f3113..b1a3e4ec 100644
--- a/src/quicktemplates2/qquickscrollindicator.cpp
+++ b/src/quicktemplates2/qquickscrollindicator.cpp
@@ -52,12 +52,12 @@ QT_BEGIN_NAMESPACE
\ingroup qtquickcontrols2-indicators
\brief A non-interactive scroll indicator control.
+ \image qtquickcontrols2-scrollindicator.gif
+
ScrollIndicator is a non-interactive indicator that indicates the current scroll
position. A scroll indicator can be either \l vertical or \l horizontal, and can
be attached to any \l Flickable, such as \l ListView and \l GridView.
- \image qtquickcontrols2-scrollindicator.png
-
\code
Flickable {
// ...
diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp
index 43754260..63fc50ac 100644
--- a/src/quicktemplates2/qquickslider.cpp
+++ b/src/quicktemplates2/qquickslider.cpp
@@ -54,21 +54,24 @@ QT_BEGIN_NAMESPACE
Slider is used to select a value by sliding a handle along a track.
- \table
- \row \li \image qtquickcontrols2-slider-normal.png
- \li A slider in its normal state.
- \row \li \image qtquickcontrols2-slider-focused.png
- \li A slider that has active focus.
- \row \li \image qtquickcontrols2-slider-disabled.png
- \li A slider that is disabled.
- \endtable
+ In the example below, custom \l from, \l value, and \l to values are set:
\code
Slider {
- value: 0.5
+ from: 1
+ value: 25
+ to: 100
}
\endcode
+ The \l position property is defined as a percentage of the control's size,
+ scaled within the range \c {0.0 - 1.0}. The \l visualPosition property is
+ the same, except that it is reversed in a
+ \l {Right-to-left User Interfaces}{right-to-left} application. The
+ visualPosition is useful for positioning the handle when styling Slider.
+ In the example above, \l visualPosition will be \c 0.24 in a left-to-right
+ application, and \c 0.76 in a right-to-left application.
+
\sa {Customizing Slider}, {Input Controls}
*/
@@ -322,6 +325,18 @@ void QQuickSlider::setStepSize(qreal step)
\value Slider.SnapAlways The slider snaps while the handle is dragged.
\value Slider.SnapOnRelease The slider does not snap while being dragged, but only after the handle is released.
+ In the following table, the various modes are illustrated with animations.
+ The movement of the mouse cursor and the \l stepSize (\c 0.2) are identical
+ in each animation.
+
+ \table
+ \header
+ \row \li \b Value \li \b Example
+ \row \li \c Slider.NoSnap \li \image qtquickcontrols2-slider-nosnap.gif
+ \row \li \c Slider.SnapAlways \li \image qtquickcontrols2-slider-snapalways.gif
+ \row \li \c Slider.SnapOnRelease \li \image qtquickcontrols2-slider-snaponrelease.gif
+ \endtable
+
\sa stepSize
*/
QQuickSlider::SnapMode QQuickSlider::snapMode() const
diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp
index 50eb7584..4bbcc0a5 100644
--- a/src/quicktemplates2/qquickswipedelegate.cpp
+++ b/src/quicktemplates2/qquickswipedelegate.cpp
@@ -640,7 +640,7 @@ bool QQuickSwipeDelegatePrivate::handleMouseMoveEvent(QQuickItem *item, QMouseEv
const QPointF mappedEventPos = item->mapToItem(q, event->pos());
const qreal distance = (mappedEventPos - pressPoint).x();
if (!q->keepMouseGrab()) {
- // Taken from QQuickDrawer::handleMouseMoveEvent; see comments there.
+ // Taken from QQuickDrawerPrivate::grabMouse; see comments there.
int threshold = qMax(20, QGuiApplication::styleHints()->startDragDistance() + 5);
const bool overThreshold = QQuickWindowPrivate::dragOverThreshold(distance, Qt::XAxis, event, threshold);
if (window && overThreshold) {
diff --git a/src/quicktemplates2/qquicktabbar.cpp b/src/quicktemplates2/qquicktabbar.cpp
index 6d7a505a..ddcf7b12 100644
--- a/src/quicktemplates2/qquicktabbar.cpp
+++ b/src/quicktemplates2/qquicktabbar.cpp
@@ -60,13 +60,24 @@ QT_BEGIN_NAMESPACE
\snippet qtquickcontrols2-tabbar.qml 1
- \section2 Flickable Tabs
+ \section2 Resizing Tabs
By default, TabBar resizes its buttons to fit the width of the control.
The available space is distributed equally to each button. The default
resizing behavior can be overridden by setting an explicit width for the
- buttons. If the total width of the buttons exceeds the available width
- of the tab bar, it automatically becomes flickable.
+ buttons.
+
+ The following example illustrates how to keep each tab button at their
+ implicit size instead of being resized to fit the tabbar:
+
+ \borderedimage qtquickcontrols2-tabbar-explicit.png
+
+ \snippet qtquickcontrols2-tabbar-explicit.qml 1
+
+ \section2 Flickable Tabs
+
+ If the total width of the buttons exceeds the available width of the tab bar,
+ it automatically becomes flickable.
\image qtquickcontrols2-tabbar-flickable.png
diff --git a/tests/auto/controls/data/tst_button.qml b/tests/auto/controls/data/tst_button.qml
index cc588016..16d1bb94 100644
--- a/tests/auto/controls/data/tst_button.qml
+++ b/tests/auto/controls/data/tst_button.qml
@@ -62,6 +62,11 @@ TestCase {
}
}
+ Component {
+ id: signalSpy
+ SignalSpy { }
+ }
+
function test_text() {
var control = button.createObject(testCase)
verify(control)
@@ -179,8 +184,6 @@ TestCase {
return "actual event:" + JSON.stringify(actual) + ", expected event:" + JSON.stringify(expected)
}
- SignalSpy { id: clickSpy; signalName: "clicked" }
-
function test_autoRepeat() {
var control = button.createObject(testCase)
verify(control)
@@ -192,7 +195,7 @@ TestCase {
control.forceActiveFocus()
verify(control.activeFocus)
- clickSpy.target = control
+ var clickSpy = signalSpy.createObject(control, {target: control, signalName: "clicked"})
verify(clickSpy.valid)
var repeatCount = 2
diff --git a/tests/auto/controls/data/tst_buttongroup.qml b/tests/auto/controls/data/tst_buttongroup.qml
index 2427999a..186eb9d1 100644
--- a/tests/auto/controls/data/tst_buttongroup.qml
+++ b/tests/auto/controls/data/tst_buttongroup.qml
@@ -55,35 +55,9 @@ TestCase {
ButtonGroup { }
}
- SignalSpy {
- id: checkedButtonSpy
- signalName: "checkedButtonChanged"
- }
-
- SignalSpy {
- id: buttonsSpy
- signalName: "buttonsChanged"
- }
-
- SignalSpy {
- id: clickedSpy
- signalName: "clicked"
- }
-
- function init() {
- verify(!checkedButtonSpy.target)
- compare(checkedButtonSpy.count, 0)
-
- verify(!buttonsSpy.target)
- compare(buttonsSpy.count, 0)
- }
-
- function cleanup() {
- checkedButtonSpy.target = null
- checkedButtonSpy.clear()
-
- buttonsSpy.target = null
- buttonsSpy.clear()
+ Component {
+ id: signalSpy
+ SignalSpy { }
}
function test_null() {
@@ -110,7 +84,7 @@ TestCase {
var group = buttonGroup.createObject(testCase)
verify(group)
- checkedButtonSpy.target = group
+ var checkedButtonSpy = signalSpy.createObject(testCase, {target: group, signalName: "checkedButtonChanged"})
verify(checkedButtonSpy.valid)
verify(!group.checkedButton)
@@ -181,7 +155,7 @@ TestCase {
var group = buttonGroup.createObject(testCase)
verify(group)
- buttonsSpy.target = group
+ var buttonsSpy = signalSpy.createObject(testCase, {target: group, signalName: "buttonsChanged"})
verify(buttonsSpy.valid)
compare(group.buttons.length, 0)
@@ -226,7 +200,7 @@ TestCase {
var group = buttonGroup.createObject(testCase)
verify(group)
- clickedSpy.target = group
+ var clickedSpy = signalSpy.createObject(testCase, {target: group, signalName: "clicked"})
verify(clickedSpy.valid)
var button1 = button.createObject(testCase)
@@ -332,7 +306,7 @@ TestCase {
var group = buttonGroup.createObject(testCase)
verify(group)
- buttonsSpy.target = group
+ var buttonsSpy = signalSpy.createObject(testCase, {target: group, signalName: "buttonsChanged"})
verify(buttonsSpy.valid)
var button1 = button.createObject(testCase, {objectName: "button1", checked: true})
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index 5ae1e0a6..b74911c7 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -51,16 +51,6 @@ TestCase {
when: windowShown
name: "ComboBox"
- SignalSpy {
- id: activatedSpy
- signalName: "activated"
- }
-
- SignalSpy {
- id: highlightedSpy
- signalName: "highlighted"
- }
-
Component {
id: signalSpy
SignalSpy { }
@@ -80,22 +70,6 @@ TestCase {
}
}
- function init() {
- verify(!activatedSpy.target)
- compare(activatedSpy.count, 0)
-
- verify(!highlightedSpy.target)
- compare(highlightedSpy.count, 0)
- }
-
- function cleanup() {
- activatedSpy.target = null
- activatedSpy.clear()
-
- highlightedSpy.target = null
- highlightedSpy.clear()
- }
-
function test_defaults() {
var control = comboBox.createObject(testCase)
verify(control)
@@ -333,10 +307,10 @@ TestCase {
var control = comboBox.createObject(testCase, {model: 3})
verify(control)
- activatedSpy.target = control
+ var activatedSpy = signalSpy.createObject(control, {target: control, signalName: "activated"})
verify(activatedSpy.valid)
- highlightedSpy.target = control
+ var highlightedSpy = signalSpy.createObject(control, {target: control, signalName: "highlighted"})
verify(highlightedSpy.valid)
waitForRendering(control)
@@ -545,10 +519,10 @@ TestCase {
var control = comboBox.createObject(testCase, {model: 3})
verify(control)
- activatedSpy.target = control
+ var activatedSpy = signalSpy.createObject(control, {target: control, signalName: "activated"})
verify(activatedSpy.valid)
- highlightedSpy.target = control
+ var highlightedSpy = signalSpy.createObject(control, {target: control, signalName: "highlighted"})
verify(highlightedSpy.valid)
mouseClick(control)
diff --git a/tests/auto/controls/data/tst_control.qml b/tests/auto/controls/data/tst_control.qml
index dc84ff93..77f23fa5 100644
--- a/tests/auto/controls/data/tst_control.qml
+++ b/tests/auto/controls/data/tst_control.qml
@@ -71,21 +71,6 @@ TestCase {
SignalSpy { }
}
- SignalSpy {
- id: mirroredSpy
- signalName: "mirroredChanged"
- }
-
- SignalSpy {
- id: availableWidthSpy
- signalName: "availableWidthChanged"
- }
-
- SignalSpy {
- id: availableHeightSpy
- signalName: "availableHeightChanged"
- }
-
function test_padding() {
var control = component.createObject(testCase)
verify(control)
@@ -150,10 +135,10 @@ TestCase {
var control = component.createObject(testCase)
verify(control)
- availableWidthSpy.target = control
- availableHeightSpy.target = control
-
+ var availableWidthSpy = signalSpy.createObject(control, {target: control, signalName: "availableWidthChanged"})
verify(availableWidthSpy.valid)
+
+ var availableHeightSpy = signalSpy.createObject(control, {target: control, signalName: "availableHeightChanged"})
verify(availableHeightSpy.valid)
var availableWidthChanges = 0
@@ -222,7 +207,7 @@ TestCase {
var control = component.createObject(testCase)
verify(control)
- mirroredSpy.target = control
+ var mirroredSpy = signalSpy.createObject(control, {target: control, signalName: "mirroredChanged"})
verify(mirroredSpy.valid)
control.locale = Qt.locale("en_US")
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml
index c2a4bb2b..c81c6341 100644
--- a/tests/auto/controls/data/tst_popup.qml
+++ b/tests/auto/controls/data/tst_popup.qml
@@ -72,65 +72,28 @@ TestCase {
Rectangle { }
}
- SignalSpy {
- id: availableWidthSpy
- signalName: "availableWidthChanged"
- }
-
- SignalSpy {
- id: availableHeightSpy
- signalName: "availableHeightChanged"
- }
-
- SignalSpy {
- id: paddingSpy
- signalName: "paddingChanged"
- }
-
- SignalSpy {
- id: topPaddingSpy
- signalName: "topPaddingChanged"
- }
-
- SignalSpy {
- id: leftPaddingSpy
- signalName: "leftPaddingChanged"
- }
-
- SignalSpy {
- id: rightPaddingSpy
- signalName: "rightPaddingChanged"
- }
-
- SignalSpy {
- id: bottomPaddingSpy
- signalName: "bottomPaddingChanged"
- }
-
- SignalSpy {
- id: xSpy
- signalName: "xChanged"
- }
-
- SignalSpy {
- id: ySpy
- signalName: "yChanged"
+ Component {
+ id: signalSpy
+ SignalSpy { }
}
function test_padding() {
var control = popupTemplate.createObject(testCase)
verify(control)
- paddingSpy.target = control
- topPaddingSpy.target = control
- leftPaddingSpy.target = control
- rightPaddingSpy.target = control
- bottomPaddingSpy.target = control
-
+ var paddingSpy = signalSpy.createObject(testCase, {target: control, signalName: "paddingChanged"})
verify(paddingSpy.valid)
+
+ var topPaddingSpy = signalSpy.createObject(testCase, {target: control, signalName: "topPaddingChanged"})
verify(topPaddingSpy.valid)
+
+ var leftPaddingSpy = signalSpy.createObject(testCase, {target: control, signalName: "leftPaddingChanged"})
verify(leftPaddingSpy.valid)
+
+ var rightPaddingSpy = signalSpy.createObject(testCase, {target: control, signalName: "rightPaddingChanged"})
verify(rightPaddingSpy.valid)
+
+ var bottomPaddingSpy = signalSpy.createObject(testCase, {target: control, signalName: "bottomPaddingChanged"})
verify(bottomPaddingSpy.valid)
var paddingChanges = 0
@@ -229,10 +192,10 @@ TestCase {
var control = popupTemplate.createObject(testCase)
verify(control)
- availableWidthSpy.target = control
- availableHeightSpy.target = control
-
+ var availableWidthSpy = signalSpy.createObject(testCase, {target: control, signalName: "availableWidthChanged"})
verify(availableWidthSpy.valid)
+
+ var availableHeightSpy = signalSpy.createObject(testCase, {target: control, signalName: "availableHeightChanged"})
verify(availableHeightSpy.valid)
var availableWidthChanges = 0
@@ -302,10 +265,10 @@ TestCase {
verify(control)
verify(control.visible)
- xSpy.target = control
- ySpy.target = control
-
+ var xSpy = signalSpy.createObject(testCase, {target: control, signalName: "xChanged"})
verify(xSpy.valid)
+
+ var ySpy = signalSpy.createObject(testCase, {target: control, signalName: "yChanged"})
verify(ySpy.valid)
// moving outside margins does not trigger change notifiers
diff --git a/tests/auto/controls/data/tst_rangeslider.qml b/tests/auto/controls/data/tst_rangeslider.qml
index 392be018..eb654bbc 100644
--- a/tests/auto/controls/data/tst_rangeslider.qml
+++ b/tests/auto/controls/data/tst_rangeslider.qml
@@ -50,14 +50,9 @@ TestCase {
when: windowShown
name: "RangeSlider"
- SignalSpy {
- id: firstPressedSpy
- signalName: "pressedChanged"
- }
-
- SignalSpy {
- id: secondPressedSpy
- signalName: "pressedChanged"
+ Component {
+ id: signalSpy
+ SignalSpy { }
}
Component {
@@ -84,21 +79,6 @@ TestCase {
}
}
- function init() {
- verify(!firstPressedSpy.target)
- compare(firstPressedSpy.count, 0)
-
- verify(!secondPressedSpy.target)
- compare(secondPressedSpy.count, 0)
- }
-
- function cleanup() {
- firstPressedSpy.target = null
- firstPressedSpy.clear()
- secondPressedSpy.target = null
- secondPressedSpy.clear()
- }
-
function test_defaults() {
var control = sliderComponent.createObject(testCase)
verify(control)
@@ -303,10 +283,10 @@ TestCase {
var control = sliderComponent.createObject(testCase, { orientation: data.orientation })
verify(control)
- firstPressedSpy.target = control.first
+ var firstPressedSpy = signalSpy.createObject(control, {target: control.first, signalName: "pressedChanged"})
verify(firstPressedSpy.valid)
- secondPressedSpy.target = control.second
+ var secondPressedSpy = signalSpy.createObject(control, {target: control.second, signalName: "pressedChanged"})
verify(secondPressedSpy.valid)
mousePress(control, control.width * 0.25, control.height * 0.75, Qt.LeftButton)
@@ -473,7 +453,7 @@ TestCase {
var pressedCount = 0
- firstPressedSpy.target = control.first
+ var firstPressedSpy = signalSpy.createObject(control, {target: control.first, signalName: "pressedChanged"})
verify(firstPressedSpy.valid)
control.first.handle.forceActiveFocus()
@@ -511,7 +491,7 @@ TestCase {
control.stepSize = 0.25
pressedCount = 0;
- secondPressedSpy.target = control.second
+ var secondPressedSpy = signalSpy.createObject(control, {target: control.second, signalName: "pressedChanged"})
verify(secondPressedSpy.valid)
control.second.handle.forceActiveFocus()
@@ -553,7 +533,7 @@ TestCase {
var control = sliderComponent.createObject(testCase, { leftPadding: 10, rightPadding: 20 })
verify(control)
- firstPressedSpy.target = control.first
+ var firstPressedSpy = signalSpy.createObject(control, {target: control.first, signalName: "pressedChanged"})
verify(firstPressedSpy.valid)
mousePress(control, control.first.handle.x, control.first.handle.y, Qt.LeftButton)
diff --git a/tests/auto/controls/data/tst_scrollbar.qml b/tests/auto/controls/data/tst_scrollbar.qml
index 643dbe33..d7bc792d 100644
--- a/tests/auto/controls/data/tst_scrollbar.qml
+++ b/tests/auto/controls/data/tst_scrollbar.qml
@@ -50,9 +50,9 @@ TestCase {
when: windowShown
name: "ScrollBar"
- SignalSpy{
- id: pressedSpy
- signalName: "pressedChanged"
+ Component {
+ id: signalSpy
+ SignalSpy { }
}
Component {
@@ -72,16 +72,6 @@ TestCase {
}
}
- function init() {
- verify(!pressedSpy.target)
- compare(pressedSpy.count, 0)
- }
-
- function cleanup() {
- pressedSpy.target = null
- pressedSpy.clear()
- }
-
function test_attach() {
var container = flickable.createObject(testCase)
verify(container)
@@ -179,7 +169,7 @@ TestCase {
var control = scrollBar.createObject(testCase, data.properties)
verify(control)
- pressedSpy.target = control
+ var pressedSpy = signalSpy.createObject(control, {target: control, signalName: "pressedChanged"})
verify(pressedSpy.valid)
mousePress(control, 0, 0, Qt.LeftButton)
diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml
index f91760e4..029aff14 100644
--- a/tests/auto/controls/data/tst_slider.qml
+++ b/tests/auto/controls/data/tst_slider.qml
@@ -50,9 +50,9 @@ TestCase {
when: windowShown
name: "Slider"
- SignalSpy{
- id: pressedSpy
- signalName: "pressedChanged"
+ Component {
+ id: signalSpy
+ SignalSpy { }
}
Component {
@@ -60,16 +60,6 @@ TestCase {
Slider { }
}
- function init() {
- verify(!pressedSpy.target)
- compare(pressedSpy.count, 0)
- }
-
- function cleanup() {
- pressedSpy.target = null
- pressedSpy.clear()
- }
-
function test_defaults() {
var control = slider.createObject(testCase)
verify(control)
@@ -232,7 +222,7 @@ TestCase {
var control = slider.createObject(testCase, {orientation: data.orientation})
verify(control)
- pressedSpy.target = control
+ var pressedSpy = signalSpy.createObject(control, {target: control, signalName: "pressedChanged"})
verify(pressedSpy.valid)
mousePress(control, 0, 0, Qt.LeftButton)
@@ -308,7 +298,7 @@ TestCase {
var pressedCount = 0
- pressedSpy.target = control
+ var pressedSpy = signalSpy.createObject(control, {target: control, signalName: "pressedChanged"})
verify(pressedSpy.valid)
control.forceActiveFocus()
@@ -380,7 +370,7 @@ TestCase {
var control = slider.createObject(testCase, {leftPadding: 10, rightPadding: 20})
verify(control)
- pressedSpy.target = control
+ var pressedSpy = signalSpy.createObject(control, {target: control, signalName: "pressedChanged"})
verify(pressedSpy.valid)
mousePress(control, 0, 0, Qt.LeftButton)
diff --git a/tests/auto/controls/data/tst_spinbox.qml b/tests/auto/controls/data/tst_spinbox.qml
index 81c67681..30db246f 100644
--- a/tests/auto/controls/data/tst_spinbox.qml
+++ b/tests/auto/controls/data/tst_spinbox.qml
@@ -50,14 +50,9 @@ TestCase {
when: windowShown
name: "SpinBox"
- SignalSpy{
- id: upPressedSpy
- signalName: "pressedChanged"
- }
-
- SignalSpy{
- id: downPressedSpy
- signalName: "pressedChanged"
+ Component {
+ id: signalSpy
+ SignalSpy { }
}
Component {
@@ -65,20 +60,6 @@ TestCase {
SpinBox { }
}
- function init() {
- verify(!upPressedSpy.target)
- compare(upPressedSpy.count, 0)
- verify(!downPressedSpy.target)
- compare(downPressedSpy.count, 0)
- }
-
- function cleanup() {
- upPressedSpy.target = null
- upPressedSpy.clear()
- downPressedSpy.target = null
- downPressedSpy.clear()
- }
-
function test_defaults() {
var control = spinBox.createObject(testCase)
verify(control)
@@ -190,9 +171,12 @@ TestCase {
var control = spinBox.createObject(testCase, {stepSize: 50})
verify(control)
- upPressedSpy.target = control.up
+ var upPressedSpy = signalSpy.createObject(control, {target: control.up, signalName: "pressedChanged"})
verify(upPressedSpy.valid)
+ var downPressedSpy = signalSpy.createObject(control, {target: control.down, signalName: "pressedChanged"})
+ verify(downPressedSpy.valid)
+
mousePress(control.up.indicator)
compare(upPressedSpy.count, 1)
compare(control.up.pressed, true)
@@ -225,9 +209,6 @@ TestCase {
compare(control.down.pressed, false)
compare(control.value, control.to)
- downPressedSpy.target = control.down
- verify(downPressedSpy.valid)
-
control.value = 50;
mousePress(control.down.indicator)
compare(downPressedSpy.count, 1)
@@ -271,10 +252,10 @@ TestCase {
var upPressedCount = 0
var downPressedCount = 0
- upPressedSpy.target = control.up
+ var upPressedSpy = signalSpy.createObject(control, {target: control.up, signalName: "pressedChanged"})
verify(upPressedSpy.valid)
- downPressedSpy.target = control.down
+ var downPressedSpy = signalSpy.createObject(control, {target: control.down, signalName: "pressedChanged"})
verify(downPressedSpy.valid)
control.forceActiveFocus()
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml
index 242c0699..b0e18389 100644
--- a/tests/auto/controls/data/tst_stackview.qml
+++ b/tests/auto/controls/data/tst_stackview.qml
@@ -92,18 +92,13 @@ TestCase {
control.destroy()
}
- SignalSpy {
- id: busySpy
- signalName: "busyChanged"
- }
-
function test_busy() {
var control = stackView.createObject(testCase)
verify(control)
compare(control.busy, false)
var busyCount = 0
- busySpy.target = control
+ var busySpy = signalSpy.createObject(control, {target: control, signalName: "busyChanged"})
verify(busySpy.valid)
control.push(component)
diff --git a/tests/auto/controls/data/tst_swipedelegate.qml b/tests/auto/controls/data/tst_swipedelegate.qml
index 255c1d6d..d30ade48 100644
--- a/tests/auto/controls/data/tst_swipedelegate.qml
+++ b/tests/auto/controls/data/tst_swipedelegate.qml
@@ -54,6 +54,87 @@ TestCase {
readonly property int dragDistance: Math.max(20, Qt.styleHints.startDragDistance + 5)
Component {
+ id: backgroundFillComponent
+ SwipeDelegate {
+ background: Item { anchors.fill: parent }
+ }
+ }
+
+ Component {
+ id: backgroundCenterInComponent
+ SwipeDelegate {
+ background: Item { anchors.centerIn: parent }
+ }
+ }
+
+ Component {
+ id: backgroundLeftComponent
+ SwipeDelegate {
+ background: Item { anchors.left: parent.left }
+ }
+ }
+
+ Component {
+ id: backgroundRightComponent
+ SwipeDelegate {
+ background: Item { anchors.right: parent.right }
+ }
+ }
+
+ Component {
+ id: contentItemFillComponent
+ SwipeDelegate {
+ contentItem: Item { anchors.fill: parent }
+ }
+ }
+
+ Component {
+ id: contentItemCenterInComponent
+ SwipeDelegate {
+ contentItem: Item { anchors.centerIn: parent }
+ }
+ }
+
+ Component {
+ id: contentItemLeftComponent
+ SwipeDelegate {
+ contentItem: Item { anchors.left: parent.left }
+ }
+ }
+
+ Component {
+ id: contentItemRightComponent
+ SwipeDelegate {
+ contentItem: Item { anchors.right: parent.right }
+ }
+ }
+
+ function test_horizontalAnchors_data() {
+ return [
+ { tag: "background, fill", component: backgroundFillComponent, itemName: "background", warningLocation: ":59:25" },
+ { tag: "background, centerIn", component: backgroundCenterInComponent, itemName: "background", warningLocation: ":66:25" },
+ { tag: "background, left", component: backgroundLeftComponent, itemName: "background", warningLocation: ":73:25" },
+ { tag: "background, right", component: backgroundRightComponent, itemName: "background", warningLocation: ":80:25" },
+ { tag: "contentItem, fill", component: contentItemFillComponent, itemName: "contentItem", warningLocation: ":87:26" },
+ { tag: "contentItem, centerIn", component: contentItemCenterInComponent, itemName: "contentItem", warningLocation: ":94:26" },
+ { tag: "contentItem, left", component: contentItemLeftComponent, itemName: "contentItem", warningLocation: ":101:26" },
+ { tag: "contentItem, right", component: contentItemRightComponent, itemName: "contentItem", warningLocation: ":108:26" }
+ ];
+ }
+
+ function test_horizontalAnchors(data) {
+ var warningMessage = Qt.resolvedUrl("tst_swipedelegate.qml") + data.warningLocation
+ + ": QML : SwipeDelegate: cannot use horizontal anchors with " + data.itemName + "; unable to layout the item."
+
+ ignoreWarning(warningMessage);
+
+ var control = data.component.createObject(testCase);
+ verify(control.contentItem);
+
+ control.destroy();
+ }
+
+ Component {
id: greenLeftComponent
Rectangle {
@@ -91,18 +172,6 @@ TestCase {
SignalSpy {}
}
- function test_defaults() {
- var control = swipeDelegateComponent.createObject(testCase);
- verify(control);
-
- compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset);
- compare(control.swipe.position, 0);
- verify(!control.pressed);
- verify(!control.swipe.complete);
-
- control.destroy();
- }
-
Component {
id: itemComponent
@@ -139,7 +208,7 @@ TestCase {
verify(control);
ignoreWarning(Qt.resolvedUrl("tst_swipedelegate.qml") +
- ":79:9: QML SwipeDelegate: cannot set both behind and left/right properties")
+ ":160:9: QML SwipeDelegate: cannot set both behind and left/right properties")
control.swipe.behind = itemComponent;
// Shouldn't be any warnings when unsetting delegates.
@@ -148,7 +217,7 @@ TestCase {
// right is still set.
ignoreWarning(Qt.resolvedUrl("tst_swipedelegate.qml") +
- ":79:9: QML SwipeDelegate: cannot set both behind and left/right properties")
+ ":160:9: QML SwipeDelegate: cannot set both behind and left/right properties")
control.swipe.behind = itemComponent;
control.swipe.right = null;
@@ -157,11 +226,11 @@ TestCase {
control.swipe.behind = itemComponent;
ignoreWarning(Qt.resolvedUrl("tst_swipedelegate.qml") +
- ":79:9: QML SwipeDelegate: cannot set both behind and left/right properties")
+ ":160:9: QML SwipeDelegate: cannot set both behind and left/right properties")
control.swipe.left = itemComponent;
ignoreWarning(Qt.resolvedUrl("tst_swipedelegate.qml") +
- ":79:9: QML SwipeDelegate: cannot set both behind and left/right properties")
+ ":160:9: QML SwipeDelegate: cannot set both behind and left/right properties")
control.swipe.right = itemComponent;
control.swipe.behind = null;
@@ -176,7 +245,7 @@ TestCase {
var oldLeft = control.swipe.left;
var oldLeftItem = control.swipe.leftItem;
ignoreWarning(Qt.resolvedUrl("tst_swipedelegate.qml") +
- ":79:9: QML SwipeDelegate: left/right/behind properties may only be set when swipe.position is 0")
+ ":160:9: QML SwipeDelegate: left/right/behind properties may only be set when swipe.position is 0")
control.swipe.left = null;
compare(control.swipe.left, oldLeft);
compare(control.swipe.leftItem, oldLeftItem);
@@ -187,7 +256,7 @@ TestCase {
var oldRight = control.swipe.right;
var oldRightItem = control.swipe.rightItem;
ignoreWarning(Qt.resolvedUrl("tst_swipedelegate.qml") +
- ":79:9: QML SwipeDelegate: left/right/behind properties may only be set when swipe.position is 0")
+ ":160:9: QML SwipeDelegate: left/right/behind properties may only be set when swipe.position is 0")
control.swipe.right = null;
compare(control.swipe.right, oldRight);
compare(control.swipe.rightItem, oldRightItem);
@@ -213,7 +282,7 @@ TestCase {
var oldBehind = control.swipe.behind;
var oldBehindItem = control.swipe.behindItem;
ignoreWarning(Qt.resolvedUrl("tst_swipedelegate.qml") +
- ":79:9: QML SwipeDelegate: left/right/behind properties may only be set when swipe.position is 0")
+ ":160:9: QML SwipeDelegate: left/right/behind properties may only be set when swipe.position is 0")
control.swipe.behind = null;
compare(control.swipe.behind, oldBehind);
compare(control.swipe.behindItem, oldBehindItem);
@@ -221,6 +290,18 @@ TestCase {
control.destroy();
}
+ function test_defaults() {
+ var control = swipeDelegateComponent.createObject(testCase);
+ verify(control);
+
+ compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset);
+ compare(control.swipe.position, 0);
+ verify(!control.pressed);
+ verify(!control.swipe.complete);
+
+ control.destroy();
+ }
+
SignalSequenceSpy {
id: mouseSignalSequenceSpy
signals: ["pressed", "released", "canceled", "clicked", "doubleClicked", "pressedChanged", "pressAndHold"]
@@ -1161,85 +1242,4 @@ TestCase {
control.destroy();
}
-
- Component {
- id: backgroundFillComponent
- SwipeDelegate {
- background: Item { anchors.fill: parent }
- }
- }
-
- Component {
- id: backgroundCenterInComponent
- SwipeDelegate {
- background: Item { anchors.centerIn: parent }
- }
- }
-
- Component {
- id: backgroundLeftComponent
- SwipeDelegate {
- background: Item { anchors.left: parent.left }
- }
- }
-
- Component {
- id: backgroundRightComponent
- SwipeDelegate {
- background: Item { anchors.right: parent.right }
- }
- }
-
- Component {
- id: contentItemFillComponent
- SwipeDelegate {
- contentItem: Item { anchors.fill: parent }
- }
- }
-
- Component {
- id: contentItemCenterInComponent
- SwipeDelegate {
- contentItem: Item { anchors.centerIn: parent }
- }
- }
-
- Component {
- id: contentItemLeftComponent
- SwipeDelegate {
- contentItem: Item { anchors.left: parent.left }
- }
- }
-
- Component {
- id: contentItemRightComponent
- SwipeDelegate {
- contentItem: Item { anchors.right: parent.right }
- }
- }
-
- function test_horizontalAnchors_data() {
- return [
- { tag: "background, fill", component: backgroundFillComponent, itemName: "background", warningLocation: ":1168:25" },
- { tag: "background, centerIn", component: backgroundCenterInComponent, itemName: "background", warningLocation: ":1175:25" },
- { tag: "background, left", component: backgroundLeftComponent, itemName: "background", warningLocation: ":1182:25" },
- { tag: "background, right", component: backgroundRightComponent, itemName: "background", warningLocation: ":1189:25" },
- { tag: "contentItem, fill", component: contentItemFillComponent, itemName: "contentItem", warningLocation: ":1196:26" },
- { tag: "contentItem, centerIn", component: contentItemCenterInComponent, itemName: "contentItem", warningLocation: ":1203:26" },
- { tag: "contentItem, left", component: contentItemLeftComponent, itemName: "contentItem", warningLocation: ":1210:26" },
- { tag: "contentItem, right", component: contentItemRightComponent, itemName: "contentItem", warningLocation: ":1217:26" }
- ];
- }
-
- function test_horizontalAnchors(data) {
- var warningMessage = Qt.resolvedUrl("tst_swipedelegate.qml") + data.warningLocation
- + ": QML : SwipeDelegate: cannot use horizontal anchors with " + data.itemName + "; unable to layout the item."
-
- ignoreWarning(warningMessage);
-
- var control = data.component.createObject(testCase);
- verify(control.contentItem);
-
- control.destroy();
- }
}
diff --git a/tests/auto/controls/data/tst_swipeview.qml b/tests/auto/controls/data/tst_swipeview.qml
index b131236d..2d5f413a 100644
--- a/tests/auto/controls/data/tst_swipeview.qml
+++ b/tests/auto/controls/data/tst_swipeview.qml
@@ -60,20 +60,16 @@ TestCase {
Text { }
}
- SignalSpy {
- id: currentItemChangedSpy
- signalName: "currentItemChanged"
- }
-
- function cleanup() {
- currentItemChangedSpy.clear()
- currentItemChangedSpy.target = null
+ Component {
+ id: signalSpy
+ SignalSpy { }
}
function test_current() {
var control = swipeView.createObject(testCase)
- currentItemChangedSpy.target = control
+ var currentItemChangedSpy = signalSpy.createObject(testCase, {target: control, signalName: "currentItemChanged"})
+ verify(currentItemChangedSpy.valid)
compare(control.count, 0)
compare(control.currentIndex, -1)
@@ -156,7 +152,8 @@ TestCase {
control.currentIndexChanged.connect(verifyCurrentIndexCountDiff)
control.countChanged.connect(verifyCurrentIndexCountDiff)
- currentItemChangedSpy.target = control;
+ var currentItemChangedSpy = signalSpy.createObject(testCase, {target: control, signalName: "currentItemChanged"})
+ verify(currentItemChangedSpy.valid)
compare(control.count, 0)
compare(control.currentIndex, -1)
diff --git a/tests/auto/controls/data/tst_tabbar.qml b/tests/auto/controls/data/tst_tabbar.qml
index 92e80952..da0181a1 100644
--- a/tests/auto/controls/data/tst_tabbar.qml
+++ b/tests/auto/controls/data/tst_tabbar.qml
@@ -85,19 +85,9 @@ TestCase {
}
}
- SignalSpy {
- id: contentChildrenSpy
- signalName: "contentChildrenChanged"
- }
-
- function init() {
- verify(!contentChildrenSpy.target)
- compare(contentChildrenSpy.count, 0)
- }
-
- function cleanup() {
- contentChildrenSpy.target = null
- contentChildrenSpy.clear()
+ Component {
+ id: signalSpy
+ SignalSpy { }
}
function test_defaults() {
@@ -186,7 +176,7 @@ TestCase {
control.currentIndexChanged.connect(verifyCurrentIndexCountDiff)
control.countChanged.connect(verifyCurrentIndexCountDiff)
- contentChildrenSpy.target = control
+ var contentChildrenSpy = signalSpy.createObject(testCase, {target: control, signalName: "contentChildrenChanged"})
verify(contentChildrenSpy.valid)
compare(control.count, 0)
@@ -303,7 +293,7 @@ TestCase {
return true
}
- contentChildrenSpy.target = control
+ var contentChildrenSpy = signalSpy.createObject(testCase, {target: control, signalName: "contentChildrenChanged"})
verify(contentChildrenSpy.valid)
verify(compareObjectNames(control.contentData, ["object", "button1", "timer", "button2", ""]))
diff --git a/tests/auto/controls/data/tst_toolbutton.qml b/tests/auto/controls/data/tst_toolbutton.qml
index cc41d942..a59cff07 100644
--- a/tests/auto/controls/data/tst_toolbutton.qml
+++ b/tests/auto/controls/data/tst_toolbutton.qml
@@ -50,19 +50,9 @@ TestCase {
when: windowShown
name: "ToolButton"
- SignalSpy {
- id: pressedSpy
- signalName: "pressedChanged"
- }
-
- SignalSpy {
- id: downSpy
- signalName: "downChanged"
- }
-
- SignalSpy {
- id: clickedSpy
- signalName: "clicked"
+ Component {
+ id: signalSpy
+ SignalSpy { }
}
Component {
@@ -70,20 +60,6 @@ TestCase {
ToolButton { }
}
- function init() {
- verify(!pressedSpy.target)
- verify(!clickedSpy.target)
- compare(pressedSpy.count, 0)
- compare(clickedSpy.count, 0)
- }
-
- function cleanup() {
- pressedSpy.target = null
- clickedSpy.target = null
- pressedSpy.clear()
- clickedSpy.clear()
- }
-
function test_text() {
var control = toolButton.createObject(testCase)
verify(control)
@@ -101,11 +77,13 @@ TestCase {
var control = toolButton.createObject(testCase)
verify(control)
- pressedSpy.target = control
- downSpy.target = control
- clickedSpy.target = control
+ var pressedSpy = signalSpy.createObject(control, {target: control, signalName: "pressedChanged"})
verify(pressedSpy.valid)
+
+ var downSpy = signalSpy.createObject(control, {target: control, signalName: "downChanged"})
verify(downSpy.valid)
+
+ var clickedSpy = signalSpy.createObject(control, {target: control, signalName: "clicked"})
verify(clickedSpy.valid)
// check
@@ -170,7 +148,7 @@ TestCase {
var control = toolButton.createObject(testCase)
verify(control)
- clickedSpy.target = control
+ var clickedSpy = signalSpy.createObject(control, {target: control, signalName: "clicked"})
verify(clickedSpy.valid)
control.forceActiveFocus()
diff --git a/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml b/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml
index ef53721d..3195c1c9 100644
--- a/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml
+++ b/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml
@@ -48,8 +48,8 @@ Window {
height: column.implicitHeight
visible: true
- property alias second: second
- property alias third: third
+ property alias control2: control2
+ property alias control3: control3
ColumnLayout {
id: column
@@ -60,11 +60,11 @@ Window {
text: qsTr("First")
}
CheckBox {
- id: second
+ id: control2
text: qsTr("Second")
}
CheckBox {
- id: third
+ id: control3
checked: true
text: qsTr("Third")
}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-checkdelegate-tristate.qml b/tests/manual/gifs/data/qtquickcontrols2-checkdelegate-tristate.qml
new file mode 100644
index 00000000..eddb71d5
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-checkdelegate-tristate.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.7
+import QtQuick.Controls 2.0
+import QtQuick.Layouts 1.1
+import QtQuick.Window 2.0
+
+Window {
+ id: window
+ width: 170
+ height: column.implicitHeight
+ visible: true
+
+ property alias english: english
+ property alias norwegian: norwegian
+
+ ColumnLayout {
+ id: column
+ anchors.fill: parent
+
+ CheckDelegate {
+ text: qsTr("Languages")
+ checkState: english.checked && norwegian.checked
+ ? Qt.Checked : (english.checked || norwegian.checked) ? Qt.PartiallyChecked : Qt.Unchecked
+ tristate: true
+ Layout.fillWidth: true
+ }
+ CheckDelegate {
+ id: english
+ text: qsTr("English")
+ checked: true
+ leftPadding: indicator.width + 14
+ Layout.fillWidth: true
+ }
+ CheckDelegate {
+ id: norwegian
+ text: qsTr("Norwegian")
+ checked: true
+ leftPadding: indicator.width + 14
+ Layout.fillWidth: true
+ }
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml b/tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml
new file mode 100644
index 00000000..0785b279
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.7
+import QtQuick.Window 2.0
+import QtQuick.Controls 2.0
+
+Window {
+ width: progressBar.implicitWidth
+ height: 64
+ visible: true
+
+ property alias progressBar: progressBar
+
+ ProgressBar {
+ id: progressBar
+ indeterminate: true
+ anchors.centerIn: parent
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-progressbar.qml b/tests/manual/gifs/data/qtquickcontrols2-progressbar.qml
new file mode 100644
index 00000000..13d5075d
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-progressbar.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.7
+import QtQuick.Window 2.0
+import QtQuick.Controls 2.0
+
+Window {
+ width: progressBar.implicitWidth
+ height: 64
+ visible: true
+
+ property alias progressBar: progressBar
+
+ ProgressBar {
+ id: progressBar
+ value: 0.5
+ anchors.centerIn: parent
+
+ Timer {
+ running: true
+ interval: 500
+ onTriggered: animation.start()
+ }
+
+ NumberAnimation {
+ id: animation
+ target: progressBar
+ property: "value"
+ to: 1
+ duration: 2000
+ }
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-radiobutton.qml b/tests/manual/gifs/data/qtquickcontrols2-radiobutton.qml
new file mode 100644
index 00000000..576668f3
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-radiobutton.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Controls 2.0
+import QtQuick.Layouts 1.1
+import QtQuick.Window 2.0
+
+Window {
+ width: column.implicitWidth
+ height: column.implicitHeight
+ visible: true
+
+ property alias control1: control1
+ property alias control2: control2
+ property alias control3: control3
+
+ ColumnLayout {
+ id: column
+ anchors.centerIn: parent
+
+ RadioButton {
+ id: control1
+ text: qsTr("First")
+ checked: true
+ }
+ RadioButton {
+ id: control2
+ text: qsTr("Second")
+ }
+ RadioButton {
+ id: control3
+ text: qsTr("Third")
+ }
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-scrollbar.qml b/tests/manual/gifs/data/qtquickcontrols2-scrollbar.qml
new file mode 100644
index 00000000..ce198685
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-scrollbar.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Window 2.0
+import QtQuick.Controls 2.0
+
+Window {
+ width: 100
+ height: 120
+ visible: true
+ color: "#eeeeee"
+
+ property alias scrollBar: scrollBar
+
+ ListView {
+ anchors.fill: parent
+
+ ScrollBar.vertical: ScrollBar {
+ id: scrollBar
+ active: true
+ }
+
+ model: 10
+ delegate: Label {
+ text: qsTr("Item %1").arg(index + 1)
+ width: 100
+ height: 40
+ leftPadding: 10
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml b/tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml
new file mode 100644
index 00000000..091e5250
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Window 2.0
+import QtQuick.Controls 2.0
+
+Window {
+ width: 100
+ height: 120
+ visible: true
+ color: "#eeeeee"
+
+ ListView {
+ anchors.fill: parent
+
+ ScrollIndicator.vertical: ScrollIndicator {
+ active: true
+ }
+
+ model: 10
+ delegate: Label {
+ text: qsTr("Item %1").arg(index + 1)
+ width: 100
+ height: 40
+ leftPadding: 10
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-slider-snap.qml b/tests/manual/gifs/data/qtquickcontrols2-slider-snap.qml
new file mode 100644
index 00000000..aa2351fc
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-slider-snap.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.7
+import QtQuick.Window 2.0
+import QtQuick.Controls 2.0
+
+Window {
+ width: slider.implicitWidth
+ height: slider.implicitHeight
+ visible: true
+
+ property alias slider: slider
+
+ Slider {
+ id: slider
+ stepSize: 0.2
+ anchors.centerIn: parent
+
+ Rectangle {
+ anchors.fill: slider.handle
+ radius: width / 2
+ color: slider.pressed ? "#aa666666" : "transparent"
+ }
+
+ contentItem: Item {
+ Repeater {
+ id: repeater
+ model: 6
+
+ Rectangle {
+ x: ((slider.contentItem.width - slider.handle.width) * (index / (repeater.count - 1)))
+ - width / 2 + slider.handle.width / 2
+ y: parent.height
+ width: 1
+ height: 4
+ color: "#888"
+ }
+ }
+ }
+ }
+}
diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp
index 2eebc180..9de401cb 100644
--- a/tests/manual/gifs/tst_gifs.cpp
+++ b/tests/manual/gifs/tst_gifs.cpp
@@ -51,6 +51,8 @@ private slots:
void tumblerWrap();
void slider();
+ void sliderSnap_data();
+ void sliderSnap();
void rangeSlider();
void busyIndicator();
void switchGif();
@@ -65,8 +67,14 @@ private slots:
void delegates();
void dial_data();
void dial();
- void checkBox();
- void checkBoxTriState();
+ void scrollBar();
+ void scrollIndicator();
+ void progressBar_data();
+ void progressBar();
+ void triState_data();
+ void triState();
+ void checkables_data();
+ void checkables();
private:
void moveSmoothly(QQuickWindow *window, const QPoint &from, const QPoint &to, int movements,
@@ -97,8 +105,8 @@ void tst_Gifs::moveSmoothly(QQuickWindow *window, const QPoint &from, const QPoi
int yDifference = to.y() - from.y();
for (int movement = 0; movement < movements; ++movement) {
QPoint pos = QPoint(
- from.x() + curve.valueForProgress(movement / qreal(qAbs(xDifference))) * xDifference,
- from.y() + curve.valueForProgress(movement / qreal(qAbs(yDifference))) * yDifference);
+ from.x() + qRound(curve.valueForProgress(movement / qreal(qAbs(xDifference))) * xDifference),
+ from.y() + qRound(curve.valueForProgress(movement / qreal(qAbs(yDifference))) * yDifference));
QTest::mouseMove(window, pos, movementDelay);
}
}
@@ -236,6 +244,58 @@ void tst_Gifs::slider()
gifRecorder.waitForFinish();
}
+void tst_Gifs::sliderSnap_data()
+{
+ QTest::addColumn<QString>("gifBaseName");
+ QTest::addColumn<int>("snapMode");
+ QTest::newRow("NoSnap") << "qtquickcontrols2-slider-nosnap" << 0;
+ QTest::newRow("SnapAlways") << "qtquickcontrols2-slider-snapalways" << 1;
+ QTest::newRow("SnapOnRelease") << "qtquickcontrols2-slider-snaponrelease" << 2;
+}
+
+void tst_Gifs::sliderSnap()
+{
+ QFETCH(QString, gifBaseName);
+ QFETCH(int, snapMode);
+
+ GifRecorder gifRecorder;
+ gifRecorder.setDataDirPath(dataDirPath);
+ gifRecorder.setOutputDir(outputDir);
+ gifRecorder.setRecordingDuration(8);
+ gifRecorder.setHighQuality(true);
+ gifRecorder.setQmlFileName("qtquickcontrols2-slider-snap.qml");
+ gifRecorder.setOutputFileBaseName(gifBaseName);
+
+ gifRecorder.start();
+
+ QQuickWindow *window = gifRecorder.window();
+ QQuickItem *slider = window->property("slider").value<QQuickItem*>();
+ QVERIFY(slider);
+ QVERIFY(slider->setProperty("snapMode", QVariant(snapMode)));
+ QCOMPARE(slider->property("snapMode").toInt(), snapMode);
+ QQuickItem *handle = slider->property("handle").value<QQuickItem*>();
+ QVERIFY(handle);
+
+ const QPoint startPos(slider->property("leftPadding").toReal(), slider->height() / 2);
+ const int trackWidth = slider->property("availableWidth").toReal();
+
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, startPos, 200);
+ QPoint pos1 = startPos + QPoint(trackWidth * 0.3, 0);
+ moveSmoothly(window, startPos, pos1, pos1.x() - startPos.x(), QEasingCurve::OutQuint, 30);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, pos1, 0);
+
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, startPos, 400);
+ const QPoint pos2 = startPos + QPoint(trackWidth * 0.6, 0);
+ moveSmoothly(window, pos1, pos2, pos2.x() - pos1.x(), QEasingCurve::OutQuint, 30);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, pos2, 0);
+
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, pos2, 400);
+ moveSmoothly(window, pos2, startPos, qAbs(startPos.x() - pos2.x()) / 2, QEasingCurve::OutQuint, 30);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, startPos, 0);
+
+ gifRecorder.waitForFinish();
+}
+
void tst_Gifs::rangeSlider()
{
GifRecorder gifRecorder;
@@ -612,41 +672,61 @@ void tst_Gifs::dial()
gifRecorder.waitForFinish();
}
-void tst_Gifs::checkBox()
+void tst_Gifs::checkables_data()
+{
+ QTest::addColumn<QString>("name");
+ QTest::addColumn<QVector<int> >("pressIndices");
+
+ QTest::newRow("checkbox") << "checkbox" << (QVector<int>() << 1 << 2 << 2 << 1);
+ QTest::newRow("radiobutton") << "radiobutton" << (QVector<int>() << 1 << 2 << 1 << 0);
+}
+
+void tst_Gifs::checkables()
{
+ QFETCH(QString, name);
+ QFETCH(QVector<int>, pressIndices);
+
GifRecorder gifRecorder;
gifRecorder.setDataDirPath(dataDirPath);
gifRecorder.setOutputDir(outputDir);
- gifRecorder.setRecordingDuration(5);
- gifRecorder.setQmlFileName("qtquickcontrols2-checkbox.qml");
+ gifRecorder.setRecordingDuration(6);
+ gifRecorder.setQmlFileName(QString::fromLatin1("qtquickcontrols2-%1.qml").arg(name));
gifRecorder.start();
QQuickWindow *window = gifRecorder.window();
- QQuickItem *second = window->property("second").value<QQuickItem*>();
- QVERIFY(second);
- QQuickItem *third = window->property("third").value<QQuickItem*>();
- QVERIFY(third);
-
- QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
- second->mapToScene(QPointF(second->width() / 2, second->height() / 2)).toPoint(), 400);
- QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
- third->mapToScene(QPointF(third->width() / 2, third->height() / 2)).toPoint(), 800);
- QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
- third->mapToScene(QPointF(third->width() / 2, third->height() / 2)).toPoint(), 800);
- QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
- second->mapToScene(QPointF(second->width() / 2, second->height() / 2)).toPoint(), 800);
+
+ for (int i = 0; i < pressIndices.size(); ++i) {
+ const int pressIndex = pressIndices.at(i);
+ const char *controlId = qPrintable(QString::fromLatin1("control%1").arg(pressIndex + 1));
+ QQuickItem *control = window->property(controlId).value<QQuickItem*>();
+ QVERIFY(control);
+
+ const QPoint pos = control->mapToScene(QPointF(control->width() / 2, control->height() / 2)).toPoint();
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, pos, 800);
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier, pos, 300);
+ }
gifRecorder.waitForFinish();
}
-void tst_Gifs::checkBoxTriState()
+void tst_Gifs::triState_data()
+{
+ QTest::addColumn<QString>("name");
+
+ QTest::newRow("checkbox-tristate") << "checkbox-tristate";
+ QTest::newRow("checkdelegate-tristate") << "checkdelegate-tristate";
+}
+
+void tst_Gifs::triState()
{
+ QFETCH(QString, name);
+
GifRecorder gifRecorder;
gifRecorder.setDataDirPath(dataDirPath);
gifRecorder.setOutputDir(outputDir);
gifRecorder.setRecordingDuration(6);
- gifRecorder.setQmlFileName("qtquickcontrols2-checkbox-tristate.qml");
+ gifRecorder.setQmlFileName(QString::fromLatin1("qtquickcontrols2-%1.qml").arg(name));
gifRecorder.start();
@@ -656,15 +736,108 @@ void tst_Gifs::checkBoxTriState()
QQuickItem *norwegian = window->property("norwegian").value<QQuickItem*>();
QVERIFY(norwegian);
- QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
- english->mapToScene(QPointF(english->width() / 2, english->height() / 2)).toPoint(), 1000);
- QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
- norwegian->mapToScene(QPointF(norwegian->width() / 2, norwegian->height() / 2)).toPoint(), 1000);
- QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
- norwegian->mapToScene(QPointF(norwegian->width() / 2, norwegian->height() / 2)).toPoint(), 1000);
- QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
- english->mapToScene(QPointF(english->width() / 2, english->height() / 2)).toPoint(), 1000);
+ const QPoint englishCenter = english->mapToScene(
+ QPointF(english->width() / 2, english->height() / 2)).toPoint();
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, englishCenter, 1000);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, englishCenter, 300);
+
+ const QPoint norwegianCenter = norwegian->mapToScene(
+ QPointF(norwegian->width() / 2, norwegian->height() / 2)).toPoint();
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, norwegianCenter, 1000);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, norwegianCenter, 300);
+
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, norwegianCenter, 1000);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, norwegianCenter, 300);
+
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, englishCenter, 1000);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, englishCenter, 300);
+
+ gifRecorder.waitForFinish();
+}
+
+void tst_Gifs::scrollBar()
+{
+ GifRecorder gifRecorder;
+ gifRecorder.setDataDirPath(dataDirPath);
+ gifRecorder.setOutputDir(outputDir);
+ gifRecorder.setRecordingDuration(6);
+ gifRecorder.setQmlFileName("qtquickcontrols2-scrollbar.qml");
+
+ gifRecorder.start();
+
+ QQuickWindow *window = gifRecorder.window();
+ QQuickItem *scrollBar = window->property("scrollBar").value<QQuickItem*>();
+ QVERIFY(scrollBar);
+
+ // Flick in the center of the screen to show that there's a scroll bar.
+ const QPoint lhsWindowBottom = QPoint(0, window->height() - 1);
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, lhsWindowBottom, 100);
+ QTest::mouseMove(window, lhsWindowBottom - QPoint(0, 10), 30);
+ QTest::mouseMove(window, lhsWindowBottom - QPoint(0, 30), 30);
+ QTest::mouseMove(window, lhsWindowBottom - QPoint(0, 60), 30);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, lhsWindowBottom - QPoint(0, 100), 30);
+
+ // Scroll with the scroll bar.
+ const QPoint rhsWindowBottom = QPoint(window->width() - 1, window->height() - 1);
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, rhsWindowBottom, 2000);
+ const QPoint rhsWindowTop = QPoint(window->width() - 1, 1);
+ moveSmoothly(window, rhsWindowBottom, rhsWindowTop,
+ qAbs(rhsWindowTop.y() - rhsWindowBottom.y()), QEasingCurve::InCubic, 10);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, rhsWindowTop, 20);
+
+ gifRecorder.waitForFinish();
+}
+void tst_Gifs::scrollIndicator()
+{
+ GifRecorder gifRecorder;
+ gifRecorder.setDataDirPath(dataDirPath);
+ gifRecorder.setOutputDir(outputDir);
+ gifRecorder.setRecordingDuration(6);
+ gifRecorder.setQmlFileName("qtquickcontrols2-scrollindicator.qml");
+
+ gifRecorder.start();
+
+ // Flick in the center of the screen to show that there's a scroll indicator.
+ QQuickWindow *window = gifRecorder.window();
+ const QPoint windowBottom = QPoint(0, window->height() - 1);
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, windowBottom, 100);
+ QTest::mouseMove(window, windowBottom - QPoint(0, 10), 30);
+ QTest::mouseMove(window, windowBottom - QPoint(0, 30), 30);
+ QTest::mouseMove(window, windowBottom - QPoint(0, 60), 30);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, windowBottom - QPoint(0, 100), 30);
+
+ // Scroll back down.
+ const QPoint windowTop = QPoint(0, 0);
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, windowTop, 2000);
+ QTest::mouseMove(window, windowTop + QPoint(0, 10), 30);
+ QTest::mouseMove(window, windowTop + QPoint(0, 30), 30);
+ QTest::mouseMove(window, windowTop + QPoint(0, 60), 30);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, windowTop + QPoint(0, 100), 30);
+
+ gifRecorder.waitForFinish();
+}
+
+void tst_Gifs::progressBar_data()
+{
+ QTest::addColumn<bool>("indeterminate");
+
+ QTest::newRow("indeterminate:false") << false;
+ QTest::newRow("indeterminate:true") << true;
+}
+
+void tst_Gifs::progressBar()
+{
+ QFETCH(bool, indeterminate);
+
+ GifRecorder gifRecorder;
+ gifRecorder.setDataDirPath(dataDirPath);
+ gifRecorder.setOutputDir(outputDir);
+ gifRecorder.setRecordingDuration(4);
+ gifRecorder.setQmlFileName(QString::fromLatin1("qtquickcontrols2-progressbar%1").arg(
+ indeterminate ? QLatin1String("-indeterminate.qml") : QLatin1String(".qml")));
+
+ gifRecorder.start();
gifRecorder.waitForFinish();
}
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro
index bbc1e881..d81ea32f 100644
--- a/tests/manual/manual.pro
+++ b/tests/manual/manual.pro
@@ -3,6 +3,7 @@ SUBDIRS += \
buttons \
gifs \
fonts \
+ screenshots \
styles \
testbench
diff --git a/tests/manual/screenshots/qtquickcontrols2.conf b/tests/manual/screenshots/qtquickcontrols2.conf
new file mode 100644
index 00000000..b6c7c87e
--- /dev/null
+++ b/tests/manual/screenshots/qtquickcontrols2.conf
@@ -0,0 +1,2 @@
+[Controls]
+Style=Material
diff --git a/tests/manual/screenshots/screenshots.cpp b/tests/manual/screenshots/screenshots.cpp
new file mode 100644
index 00000000..0c14ead3
--- /dev/null
+++ b/tests/manual/screenshots/screenshots.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QQmlContext>
+#include <QFileInfo>
+#include <QDir>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ const QUrl snippetsDir = QUrl::fromLocalFile(SNIPPETS_DIR);
+ Q_ASSERT(snippetsDir.isValid() && QFileInfo(snippetsDir.toLocalFile()).exists());
+ engine.rootContext()->setContextProperty("snippetsDir", snippetsDir);
+ engine.rootContext()->setContextProperty("screenshotsDir", QUrl::fromLocalFile(QDir::currentPath()));
+ engine.rootContext()->setContextProperty("screenshotsDirStr", QDir::currentPath());
+ engine.load(QUrl("qrc:/screenshots.qml"));
+ if (engine.rootObjects().isEmpty())
+ return -1;
+
+ return app.exec();
+}
diff --git a/tests/manual/screenshots/screenshots.pro b/tests/manual/screenshots/screenshots.pro
new file mode 100644
index 00000000..5894888f
--- /dev/null
+++ b/tests/manual/screenshots/screenshots.pro
@@ -0,0 +1,13 @@
+TEMPLATE = app
+TARGET = screenshots
+QT += quick widgets
+
+DEFINES += SNIPPETS_DIR=\\\"$$PWD/../../../src/imports/controls/doc/snippets\\\"
+message($$DEFINES)
+
+SOURCES += \
+ screenshots.cpp
+
+RESOURCES += \
+ screenshots.qml \
+ qtquickcontrols2.conf
diff --git a/tests/manual/screenshots/screenshots.qml b/tests/manual/screenshots/screenshots.qml
new file mode 100644
index 00000000..afe7368b
--- /dev/null
+++ b/tests/manual/screenshots/screenshots.qml
@@ -0,0 +1,164 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Layouts 1.3
+import QtQuick.Controls 2.0
+import Qt.labs.folderlistmodel 2.1
+
+ApplicationWindow {
+ id: window
+ title: "Qt Quick Controls 2 - Screenshots"
+ visible: true
+ width: Math.max(600, loader.implicitWidth)
+ height: Math.max(600, loader.implicitHeight)
+
+ property string currentFilePath
+ property string lastSavePath
+
+ Shortcut {
+ sequence: "Ctrl+Q"
+ onActivated: Qt.quit()
+ }
+
+ header: ToolBar {
+ RowLayout {
+ anchors.fill: parent
+
+ ToolButton {
+ text: "Choose Snippet"
+ focusPolicy: Qt.NoFocus
+ onClicked: snippetDrawer.open()
+ }
+ }
+ }
+
+ Drawer {
+ id: snippetDrawer
+ width: window.width / 2
+ height: window.height
+
+ ListView {
+ id: snippetsListView
+ anchors.fill: parent
+ model: FolderListModel {
+ folder: snippetsDir
+ nameFilters: ["*.qml"]
+ showDirs: false
+ }
+ delegate: ItemDelegate {
+ width: parent.width
+ text: fileName
+ focusPolicy: Qt.NoFocus
+
+ readonly property string baseName: fileBaseName
+
+ contentItem: Label {
+ text: parent.text
+ elide: Text.ElideLeft
+ }
+ onClicked: {
+ snippetsListView.currentIndex = index;
+ loader.source = "file:///" + filePath;
+ currentFilePath = filePath;
+ snippetDrawer.close();
+ }
+ }
+ }
+ }
+
+ Loader {
+ id: loader
+ anchors.centerIn: parent
+ }
+
+ ToolTip {
+ id: saveResultToolTip
+ x: window.contentItem.width / 2 - width / 2
+ y: window.contentItem.height - height - 20
+ timeout: 3000
+ }
+
+ footer: ToolBar {
+ RowLayout {
+ anchors.fill: parent
+
+ ToolButton {
+ text: "Open Output Folder"
+ focusPolicy: Qt.NoFocus
+ onClicked: Qt.openUrlExternally(screenshotsDir)
+ }
+
+ ToolButton {
+ text: "Open Last Screenshot"
+ focusPolicy: Qt.NoFocus
+ enabled: lastSavePath.length > 0
+ onClicked: Qt.openUrlExternally(lastSavePath)
+ }
+
+ Item {
+ Layout.fillWidth: true
+ }
+
+ ToolButton {
+ text: "Take Screenshot"
+ focusPolicy: Qt.NoFocus
+ enabled: loader.status === Loader.Ready
+ onClicked: {
+ if (!loader.item)
+ return;
+
+ var grabSuccessful = loader.grabToImage(function(result) {
+ var savePath = screenshotsDirStr + "/" + snippetsListView.currentItem.baseName + ".png";
+ if (result.saveToFile(savePath)) {
+ saveResultToolTip.text = "Successfully saved screenshot to output folder";
+ lastSavePath = savePath;
+ } else {
+ saveResultToolTip.text = "Failed to save screenshot";
+ }
+ })
+ if (!grabSuccessful)
+ saveResultToolTip.text = "Failed to grab image";
+ saveResultToolTip.open();
+ }
+ }
+ }
+ }
+}