summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qtoolbutton
Commit message (Collapse)AuthorAgeFilesLines
* QToolButton: Don't crash if deleted while in event handlerSergio Martins2024-04-111-0/+18
| | | | | | | | | | | | | | | | | If QToolButton::mouseReleaseEvent triggers its deletion then it will crash when dereferencing its d pointer. qabstractbutton.cpp already uses QPointer guards in many places but qtoolbutton.cpp was missing this one. While deleteLater() is still our recommendation, we shouldn't crash. It's not always obvious what led to the button's destruction, as the chain of indirections can be long. Change-Id: I4a33447fa4e90953370277eb57a161398ded9a9c Pick-to: 6.7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* CMake: Make widgets tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I3c0d1a63c474969e5eaee5fdbb1bb0229482fc5b Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-171-2/+0
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Deprecate QApplication::setActiveWindow() and mark as internalTor Arne Vestbø2022-08-272-2/+5
| | | | | | | | | | | | | | The function is used the internal window activation machinery and should not be called by user code. Many tests still use this function, and should be ported over to QWidget::activateWindow(). For now they are using the private helper in QApplicationPrivate, so that we can progress with the public API deprecation. Change-Id: I29f1575acf9efdcbae4c005ee9b2eb1bb0c8e5b5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-281-1/+1
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Sync default action when checking tool button programmaticallyVolker Hilsheimer2021-07-221-0/+59
| | | | | | | | | | | | | | | | | | | | | | QAbstractButton::setChecked is not virtual, so QToolButton cannot override to synchronize the default action's checked state. This resulted in button and default action not being in sync when the checked state of the button was changed programmatically, while changing the checked state on the action kept the button in sync. Connect to the button's own toggled signal instead to keep the state of the default action in sync. Make it a unique connection to allow multiple calls to setDefaultAction, which are used by QToolButton to keep the button updated if properties of the default action change. Add a test that confirms that button and action are synchronized both ways, and that we only get single signal emissions when changing either programmatically. Fixes: QTBUG-95255 Pick-to: 6.2 6.1 Change-Id: I0e027faf1da763ef1878e46e85bfa70073c8bf82 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-4/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+3
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QTest: don't wait before sending mouse event: increment the timestampShawn Rutledge2020-11-171-2/+4
| | | | | | | | | | Tests can run faster now, but we still expect calculations based on the timestamp (such as QEventPoint::velocity()) to be correct. Change-Id: Ie962604c9ebd139384dcd89a157de66b4b773cc9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-231-1/+1
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix warning from shadowing virtual functionVolker Hilsheimer2020-09-171-20/+11
| | | | | | | QToolButton::initStyleOption is const. Apply some DRY while at it. Change-Id: If29a52e828bbc2aa58df2852c4c434545acfef3e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-091-1/+1
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove winrtOliver Wolff2020-06-061-3/+0
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-291-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/Qt5CoreConfigExtras.cmake.in src/corelib/Qt5CoreMacros.cmake src/dbus/Qt5DBusConfigExtras.cmake.in src/widgets/Qt5WidgetsConfigExtras.cmake.in Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-281-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qpnghandler.cpp Change-Id: I8630f363457bb613d8fb88470a71d95d97cdb301
| | * Flatten version-specific blacklisting on macOS to all macOS versionsTor Arne Vestbø2020-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't know which versions these blacklistings actually apply on unless we actually get macOS 10.14 and 10.15 into the CI and running tests, so let's start with that, and then granularize the blacklists after that. Task-number: QTBUG-75786 Change-Id: Id79642afa50cb20efa2cd209286b6933918d3a4a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-241-3/+3
|\| | | | | | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * | Avoid initializing QFlags with 0 or nullptr in testsFriedemann Kleint2019-11-261-3/+3
| | | | | | | | | | | | | | | | | | | | | Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99. Change-Id: Ib5d17611e43e7ab2c63c7f0587f549377f262e32 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-191-0/+6
|\| | | | | | | | | | | Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
| * | Widget tests: Skip tests that fail on WaylandJohan Klokkhammer Helsing2019-10-181-0/+6
| |/ | | | | | | | | | | | | | | | | | | | | Either by testing for platform name or window activation. After this gets in, we can enable widget tests in the Wayland bot, which hopefully will reduce the number of regressions in the Wayland plugin. Fixes: QTBUG-62188 Change-Id: I71ce8abd6b5891e5b953126b1c35345892585931 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Regenerate tests/auto/widgets/widgetsAlexandru Croitor2019-11-131-1/+13
| | | | | | | | | | Change-Id: I9d9360612931b29b5d13a224236ef650dc5c8e1d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge branch 'wip/qt6' into wip/cmakeAlexandru Croitor2019-08-151-1/+1
|\| | | | | | | Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
| * unblacklist passing testsDaniel Smith2019-07-081-1/+1
| | | | | | | | | | | | | | | | These tests have not failed on the removed platforms for at least 60 days Task-number: QTBUG-76608 Change-Id: If7a9f4db907124e3cd54e3f4b0ad3e20717d1912 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Begin port of qtbase to CMakeSimon Hausmann2018-11-011-0/+1
|/ | | | | | | | | | | | | | | Done-by: Alexandru Croitor <alexandru.croitor@qt.io> Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-by: Kevin Funk <kevin.funk@kdab.com> Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Done-by: Simon Hausmann <simon.hausmann@qt.io> Done-by: Tobias Hunger <tobias.hunger@qt.io> Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-by: Volker Krause <volker.krause@kdab.com> Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
* winrt: Make widgets/widgets auto tests passOliver Wolff2018-06-221-0/+3
| | | | | | Task-number: QTBUG-68297 Change-Id: I64d6e89e515a6284fbd8625cded22511de783481 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tests/auto/widgets/widgets: Avoid unconditional qWait()sKari Oikarinen2018-04-251-2/+1
| | | | | | Task-number: QTBUG-63992 Change-Id: I7b0c259800082284ddae4e25d139ad3adc858467 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* macOS: Blacklist tst_QToolButton::task176137_autoRepeatOfAction()Friedemann Kleint2017-07-031-0/+2
| | | | | | | The test is apparently flaky. Change-Id: I4d7b5ad653c46a432d79c9090b9f5d4cc98e5b6e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Updated license headersJani Heikkinen2016-01-211-17/+12
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* tests/auto/widgets: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-311-2/+2
| | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: Ie29640451dddeb58342038a8cd5fac152cce39e5 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QToolButton: properly reset the size hint when a menu is set on itGiuseppe D'Angelo2014-09-161-0/+28
| | | | | | | | | | | | | QToolButton::sizeHint() takes into account the presence of a menu. However, setMenu() doesn't retrigger a size hint recalculation. Hence, (un)setting a menu on an already sized tool button won't properly reset the size hint. Since the calculated size hint is cached, delete the cached value and call updateGeometry to cause a recalculation. Task-number: QTBUG-38949 Change-Id: I6e79e5e70e31afdfd129282b3668875eca86f51d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Stabilize tst_qtoolbutton for Windows 8.1.Friedemann Kleint2014-03-281-24/+56
| | | | | | | | | | | | | Ensure triggered() and task176137_autoRepeatOfAction() are using an active main window. Change click timer in triggered() to repeat until the menu is visible and add a timer to close the widget and bail out if the simulated click fails to close the menu. Task-number: QTBUG-37822 Change-Id: If675660d02335bffd5caa89796914924dad1a909 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Make QToolButtonPrivate::popupTimerDone() more robustJ-P Nurmi2014-02-121-0/+10
| | | | | | | | | | Avoid dereferencing the q-pointer if the button has been destructed meanwhile popup was open. Task-number: QTBUG-26956 Change-Id: I68190e9fe84c669229ae0ce4d573ee7a02a8a141 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0Debao Zhang2013-03-281-1/+0
| | | | | Change-Id: I1264784d6984edc70bf07e58ed763e1d1b001d7d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Widgets: Remove declaration of built-in and automatic metatypes.Stephen Kelly2013-01-041-2/+0
| | | | | | | | These types are either built-in or 'automatically declared' and so don't need to be explicitly declared as metatypes. Change-Id: Ibe8e2ec867afb4051a3c7eef806d9cd86945928b Reviewed-by: David Faure <david.faure@kdab.com>
* tst_QToolButton: remove redundant includeJ-P Nurmi2012-11-241-1/+0
| | | | | Change-Id: Ie55a530a89b85a4f3369ee3205221fb01fa1773e Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* test: Remove QSKIP from tst_QToolButton::triggered()Sergio Ahumada2012-10-041-4/+0
| | | | | | | | This test actually passes on Mac OS X, so removing the QSKIP Task-number: QTBUG-24374 Change-Id: I0b761ca9c30afc9d511e9962ee1c0958b863b374 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Remove some dead code wrapped in Q_WS_QWS.Stephen Kelly2012-08-031-3/+0
| | | | | Change-Id: Ie1ee8c4af603b924abe40145041357981d174445 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* tst_qtoolbutton: stabilize and improve failure messageRohan McGovern2012-06-051-2/+7
| | | | | | | | | Allow for a little more leeway in timers. Task-number: QTBUG-26004 Change-Id: I59936d0f675b7f734e04b3f5e63631c74ca4f163 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Set tst_qtoolbutton triggered function skipped.Toby Tomkins2012-02-201-0/+4
| | | | | | | | | | This autotest seems to be caught in an event loop preventing further correct signalling. Mark test function skipped with QSKIP. Task-number: QTBUG-24374 Change-Id: Ic943a33b71fa87d0873278cb7b7b134c22602be3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>