aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_button.qml
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-111-1/+1
|\ | | | | | | Change-Id: If797ac58344b20e8de4379343131c097247ba2f2
| * Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | | | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | tst_button: use TestCase's new createTemporaryObject functionsMitch Curtis2016-12-191-21/+8
| | | | | | | | | | | | | | | | This ensures that the appropriate objects are destroyed at the end of each test function. Change-Id: Ia486e46339068a3767910a4ba8c249a39e58d8ed Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add AbstractButton::toggled() signalJ-P Nurmi2016-12-021-1/+3
|/ | | | | | | | | | [ChangeLog][Controls][AbstractButton] Added a toggled() signal that is emitted whenever a checkable button is interactively toggled by the user by using either touch, mouse, or keys. Task-number: QTBUG-57203 Change-Id: If0b0d71d19cbed00f04d8a4309894a055c4254c6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-171-68/+95
|\ | | | | | | | | | | | | Conflicts: tests/auto/controls/data/tst_button.qml Change-Id: I5c97b3c1944e52dba44fd3c7d6d9a255c5e08cf7
| * QQuickAbstractButton: fix auto-repeatJ-P Nurmi2016-11-171-33/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't cancel auto-repeat on the tiniest mouse/touch move, but keep repeating until moved outside the button. The test has been changed so that the exact amount of repeats does not matter, as long as it repeats. This is because waits are not reliable in a busy CI environment. Sometimes waits can take longer, timer events get queued, and we get an unexpected burst of repeats. Change-Id: Ic473e04c4d15a0826c8adf460c69507e64590d99 Task-number: QTBUG-57085 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Tests: de-couple SignalSequenceSpy from the testable controlsJ-P Nurmi2016-11-161-39/+47
| | | | | | | | | | | | | | | | | | | | This change allows running tests without the signal sequence spy, which expects an exact sequence of signals. It can create problems when combined with wait/tryCompare(), which may take longer than expected in a busy CI environment, and result to unexpected signals. Change-Id: I390aa3ddafed9122deaa822b241b3b9bba7841f6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-071-3/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * auto tests: prefer creating signal spies locally where neededJ-P Nurmi2016-10-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | It is tedious to always add new static SignalSpy instances for each tested signal. Just create signal spies locally in the same place where they are used. This makes it much more convenient to create more signal spies to achieve better coverage. This practice has been already used in newly written tests. Change-Id: I7f56c4b3cea0c55c34b85254f69a88ec73b8607f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | tst_button: stabilize auto-repeat testsJ-P Nurmi2016-07-221-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a busy CI environment, the wait loop of tryCompare/Verify(), which is based on timers, may slip through more auto-repeats than expected. Ideally the repeat count should match the expected value of 2, of course, but we can accept the result as long as there are at least 2 repeats that verifies that the button actually starts repeating. It now throws warnings when it happens, which it has now done several times in the CI recently. It should basically never happen when running the tests locally (neither has the test failed when run locally). Change-Id: I2a7faaca7f11094512d68955b581fdf71b014d92 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Bump up all controls and templates imports to version 2.1J-P Nurmi2016-07-081-1/+1
|/ | | | | | | | | | | | Controls must import templates version 2.1 in order to "inherit" 1-revisioned properties, methods, and signals. So far, this has been done case by case, but it's less error prone and more clear to change them all. For example, if you ever see a source file pasted/linked somewhere, it's easy to identify the version it belongs to. Change-Id: I41609ec1a22bc05ac3e79f953a147ca42d9e0786 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Move highlighted to subclasses that actually use itMitch Curtis2016-04-271-0/+11
| | | | | Change-Id: I70468b35b2a3a03c6e2d557a67443291697c8b42 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* import Qt.labs.controls 1.0 => QtQuick.Controls 2.0J-P Nurmi2016-04-211-1/+1
| | | | | | | | | Docs, resources, .metainfo and plugins.qmltypes will be updated in follow up commits. Change-Id: I4438c5bfb8802bff0fa15c56431cfd288f179861 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* tst_button: fix warnings in test_checkableJ-P Nurmi2016-04-191-0/+9
| | | | | | | | | The newly added downChanged signals were missing from the signal sequences. Add missing verify(spy.success) calls to avoid the same in the future. Change-Id: Ib10b8cc0fe5e4afb3af911d22efa0b690036bc1f Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add QQuickAbstractButton::downMitch Curtis2016-04-151-4/+19
| | | | | | | | | | | | | | | | | This property will determine whether or not the button is visually pressed. Having such a distinction allows users more control over their controls. The patch also fixes the problem with ComboBox where pressing on the ComboBox when it's open would cause a delegate in the popup to show as being pressed. Unless explicitly set, this property follows the value of the pressed property. To return to the default value, set it to undefined. Change-Id: I29ecf325ed2ede125613f0c878b0427937599866 Task-number: QTBUG-51005 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix tst_button::test_checkable()J-P Nurmi2016-04-141-1/+18
| | | | | | | | Add checkableChanged() on the list of signals to spy, and specify the expected sequence to avoid the "received unexpected signal" warnings. Change-Id: I796aeafb6283bda9299645b4f96ef70b56fa181f Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Rename ControlSpy to SignalSequenceSpyJ-P Nurmi2016-04-141-1/+1
| | | | | | | | The purpose of this type is to spy a sequence of signals. Change-Id: I4d4712e5ae3b9ec0cf292a75f86b3d8598ea89f6 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Expose checkable where necessary, instead of in QQuickAbstractButtonMitch Curtis2016-04-131-0/+19
| | | | | | | | | | | | | QQuickCheckBox, QQuickRadioButton and QQuickSwitch are inherently checkable, so having this property available to QML doesn't make sense. QQuickButton and QQuickMenuItem are the two classes that need to expose the property. Change-Id: Ic421c195295c4bef0fc934c98fa9e781d98c9b67 Task-number: QTBUG-51554 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Button: migrate from label to contentItemJ-P Nurmi2016-02-061-1/+1
| | | | | Change-Id: Icccab45dec0dafc907847eb0151b60bd9320ab9a Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* AbstractButton: remove the mouse params from signalsJ-P Nurmi2016-01-281-76/+0
| | | | | | | | If we ever want to expose these, the name would be something else than "mouse"... :) Change-Id: Ie9dad16e84708059fd0b43d4764925db7b014d64 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Round expected event coordinates in Button's events testMitch Curtis2015-12-091-6/+6
| | | | | | | | The test expects 20.5 but gets 21 when run with a 4K monitor on Ubuntu 15.10. Change-Id: I1a71ee8614dcb86a595fd2832f89e0db617f677e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Print out actual and expected events in Button's events testMitch Curtis2015-12-091-6/+16
| | | | | | | Qt Quick Test only prints out [object Object], which isn't very useful. Change-Id: I01663ea97abae93a5f27e8328a75fb5b3f93129e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Promote Button::highlighted to AbstractButtonJ-P Nurmi2015-12-031-9/+0
| | | | | Change-Id: I0e17a6c25dfd89fdb547720e9a626c2ec9d7765a Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Specify baseline offsetsJ-P Nurmi2015-11-251-0/+7
| | | | | | Change-Id: I4845a7beac2edc0f0bcc1c810edd7d9e86f31c87 Task-number: QTBUG-49468 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Button: add highlighted propertyMitch Curtis2015-11-131-0/+9
| | | | | | | | Since our focus is on embedded, this will be used as an alternative to the "isDefault" property that exists in Qt Quick Controls. Change-Id: I9b6612e3c3b30040295aeea6d217e90a17af4ebe Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add AbstractButton::autoRepeatJ-P Nurmi2015-11-021-0/+58
| | | | | Change-Id: Idbb94bac9ccdfae730f6e4da6d63c664971f41a3 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Button: add a MouseEvent argument for the signalsJ-P Nurmi2015-10-091-0/+70
| | | | | Change-Id: I7857456cae802ca18069b01b14f3c0131e4ae4c7 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Add AbstractButton::doubleClicked() signalJ-P Nurmi2015-10-091-1/+16
| | | | | Change-Id: Ie53124b1186fee8c4b151a6c6bc3fcfe76c0250f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Rename QtQuick.Controls 2.0 to Qt.labs.controls 1.0J-P Nurmi2015-10-011-1/+1
| | | | | Change-Id: I142622dd85e95ef70b11132e77ccf48701f2cabc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Cleanup & improve auto testsJ-P Nurmi2015-06-291-14/+4
| | | | | | | | | - always verify component creation to catch errors early - remove empty init() and cleanup() functions - remove redundant "defaults" checks Change-Id: I39f16404fa2e3d3e38348742afd8f51ea36b2f05 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* ControlSpy: Accept a list of signals to spy onGabriel de Dietrich2015-05-041-10/+10
| | | | | | | | | | | | | | | | | | This API is cleaner than having to connect to each signal handler namually. We solve the 'pressed' signal problem by connecting to the other signal accessor, namely 'onPressed'. And we do so for all signals. We also lay foundation to capture the signal parameters as each signal is emitted. What we may do with those values is not clear yet. Auto-tests updated accordingly. Change-Id: Ieda96a43072ca7dff2b183e07f6f67aa49c8cf5d Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Introducing ControlSpyGabriel de Dietrich2015-04-291-92/+33
| | | | | | | | | | | Allows specifying expected sequences on signals for a control, and optionally test for property values when each signal is emitted. Rewrote Button auto-test suite using ControlSpy. Change-Id: Id27c1b9ca7ee070898bcd008379e06959341ee04 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* QQuickButton: Add canceled signalGabriel de Dietrich2015-04-291-3/+18
| | | | | | | | | | | | | | We now support the following pattern: 1. Press the mouse button => emit pressed 2. Move the mouse cursor outside the button => pressed = false 3. Release the mouse button => emit canceled Note that getting the mouse grabbed away by another item, at any stage, will also emit the canceled signal. Change-Id: I97e485327370ea47943dfef75553000cee449a01 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add missing QQuickButton::pressed() & released() signalsJ-P Nurmi2015-04-151-15/+43
| | | | | Change-Id: I5942457258e1c666a0d67dbc5a9a5611d4ed5967 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* BSD license for QML code in testsJ-P Nurmi2015-03-041-22/+26
| | | | | Change-Id: Ia1556502ece0bc385375e61653169bdc855f592e Reviewed-by: Jari-Pekka Nurmi <jpnurmi@theqtcompany.com>
* Import the Qt Quick Controls 2 prototypeJ-P Nurmi2015-02-051-0/+172
Change-Id: Ib8c0c4160958e5cfea29a6e9df1b3f1fb19715fc Reviewed-by: Jari-Pekka Nurmi <jpnurmi@theqtcompany.com>