summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* tst_QSplitter: fix compiler warningAxel Spoerl2023-09-011-1/+1
| | | | | | | | | | | | | | QLabel *l is declared uninitialized, assigned in a for loop. The last object is deleted for testing purposes. This leads to a false compiler warning about deleting a potentially unintialized pointer. => initialize with nullptr to silence the warning. Pick-to: 6.5 6.6 Change-Id: I1422b04fc1fdbfc7248de577884aabfb539f3f4b Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Introduce QT_NO_AS_CONST and mark QtBase free of itMarc Mutz2022-11-271-1/+1
| | | | | Change-Id: I680086e767fe6d5c69eb7103b26150293c69b175 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix memory leak and clean up splitter testVolker Hilsheimer2022-10-141-24/+25
| | | | | | | | | | | | Allocate the QSplitter on the stack so that it and its child widgets are cleaned up when the test function finishes. As a drive-by, replace QString usage with QByteArray to avoid unneeded conversion from and to latin1, and modernize list construction and for loop. Pick-to: 6.4 6.2 Change-Id: I2e29961edbab1ec88be356fca6bc100f08894e82 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Don't hide a widget that is swapped into a hidden splitterVolker Hilsheimer2022-05-231-0/+43
| | | | | | | | | | | | | | | | | When replacing a widget in a hidden splitter, then we only need to keep the new widget hidden if the previous widget was hidden. If the new widget is not explicitly hidden, and the splitter is already visible, then we need to explicitly show the new widget. Augment test case; the existing test cases already cover swapping out a collapsed or hidden widget. Fixes: QTBUG-102134 Pick-to: 6.3 6.2 Change-Id: I9b60711a5c1cab79777ce4183783114a16ac3394 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@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>
* QSplitter: Don't move handle in non-pressed stateNodir Temirkhodjaev2022-04-051-0/+21
| | | | | | | Fixes: QTBUG-102249 Pick-to: 6.2 6.3 Change-Id: Ib1d74447e346760d1fc9960e11486e8dc7ea3bc0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+1
| | | | | | | | | | | 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>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-071-3/+3
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix compiler warnings about missing overridesLars Knoll2020-09-131-2/+2
| | | | | Change-Id: I52bf9fe45607f4a99cafa441bd78dfe5f7adb0e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove winrtOliver Wolff2020-06-061-6/+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>
* Fix irrelevant error case in QSplitter testEskil Abrahamsen Blomfeldt2020-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The tst_QSplitter::replaceWidget() is testing that if you replace a longer QLabel with a shorter one in a horizontal splitter layout, then we *only* get a resize for the new, shorter label (expanding it horizontally to match the replaced widget, as documented). But the test accidentally triggered the QTextDocument backend for the QLabel by including HTML tags in its text. Due to QTBUG-82954, it is possible that the QTextDocument height includes the leading of the font in the last line, so if the default font has a leading, the new label will be higher than the QSplitter, and the splitter will expand its height, causing resizes for the other labels as well. Since this is not the case we are testing here, and it is currently blocking the fix for QTBUG-80554, we simply make the new label use the same plain text backend as the others. Task-number: QTBUG-82954 Change-Id: I6bfa1f3648b0fc9758c57ab2fa95be2451995df3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Widget tests: Skip tests that fail on WaylandJohan Klokkhammer Helsing2019-10-181-0/+12
| | | | | | | | | | | 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>
* Remove usages of deprecated APIs of qtbase/widgetsSona Kurazyan2019-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | - Replace the usages of deprecated APIs by corresponding alternatives in the library code and documentation. - Build docs for deprecated APIs conditionally, based on deprecation version. Remove the docs of methods deprecated since 5.0.0, these methods are not compiled anymore. - Modify the tests to make them build when deprecated APIs disabled: * Make the the parts of the tests testing the deprecated APIs to be compiled conditionally, only when the corresponding methods are enabled. * If the test-case tests only the deprecated API, but not the corresponding replacement, add tests for the replacement Task-number: QTBUG-76491 Task-number: QTBUG-76540 Task-number: QTBUG-76541 Change-Id: I6aaf0a1369c479fb880369a38f2b8e1e86b46934 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Stabilize tst_qsplitterFrederik Gladhorn2019-06-191-0/+1
| | | | | | | | | | | | | This is the worst fix ever, adding one more qWait. The test has been updated in the 5.13 branch, so there a different fix will be needed. For now this is in line with the rest of the code. This test is currently one of the worst offenders when it comes to flaky tests. Task-number: QTBUG-64639 Change-Id: Ia1e71cc948997408b9658839013c9ad098111033 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* winrt: Make widgets/widgets auto tests passOliver Wolff2018-06-221-0/+6
| | | | | | 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-8/+5
| | | | | | Task-number: QTBUG-63992 Change-Id: I7b0c259800082284ddae4e25d139ad3adc858467 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* tst_QSplitter::replaceWidget: explicit wait for eventsChristian Ehrlicher2018-01-261-18/+39
| | | | | | | | | | | | Wait a little bit longer for the visibility and resize events. By directly waiting for the incoming events with QTRY_COMPARE we give the test some more time to deliver the expected events. Also move the check for the expectedResizeCount/expectedPaintCount before the geometry check for better debugging. Task-number: QTBUG-64639 Change-Id: I712e432aa8f8d35dd199adf88af3653009528b57 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/fortuneclient/client.cpp examples/network/fortuneserver/server.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h src/plugins/platforms/cocoa/qcocoabackingstore.h src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoascreen.h src/plugins/platforms/ios/qiosbackingstore.h src/plugins/sqldrivers/oci/qsql_oci.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
| * Ensure result of all QTest::qWaitFor are verifiedTor Arne Vestbø2017-10-051-1/+1
| | | | | | | | | | | | | | | | | | The qWaitFor functions themselves can not trigger a test failure, as that will not result in the test function exiting early, so every single call to qWaitFor needs to be wrapped in a QVERIFY. Change-Id: Id15a1549f31d06cdbf788e1d84ea431c28636ec8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-1/+1
|/ | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QSplitterHandle: Ensure a minimum grab areaGabriel de Dietrich2016-12-231-0/+24
| | | | | | | | | | | | | This used to work only for 0- and 1-pixel wide handles. However, and paradoxically, 2- and 3-pixel wide handles would end up with narrower grab areas. We now ensure a 4 or 5 minimum grab area, depending on the handle width parity. The patch also clears the margins and mask if the handle size is increased at some point. Change-Id: I8a16e39fb34b5452d9021dbde8c22bec79df0243 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Introducing QSplitter::replaceWidget()Gabriel de Dietrich2016-12-021-0/+172
| | | | | | | | | | | | | | | | | | This new API addresses the use case where we want to replace a widget by another one inside the splitter. Up to now, the way of doing would include removing one widget and add the new one at the same place. However, this triggers a series of resize and paint events because of the successive changes in the splitter's children leading to a relayout of the remaining children. The new widget inherits the same properties as in the previous slot: geometry, visibility, and collapsed states. The previous widget, returned by the function, loses its parent and is hidden. Change-Id: I3dddf6b582d5ce2db8cff3c40bc46084263123ac Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@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: Remove some placeholder formatting.Friedemann Kleint2015-10-191-3/+3
| | | | | | | | Use QByteArray/QString addition instead in loops and for test row names. Change-Id: Ia067cd966bf13506e6ca19925eae3158da027b83 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@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>
* Remove traces of the Maemo platformTor Arne Vestbø2015-02-041-1/+1
| | | | | | | Change-Id: I6b551de331aa0386ea53d8e96f50b669777d2d69 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Fix saving handle width in QSplitter::saveState()Alexander Volkov2014-09-161-0/+37
| | | | | | | | | | | QSplitter::handleWidth() returns either a style dependent value if d->handleWidth is negative or the value of d->handleWidth itself. So to preserve this choice after calling saveState()/restoreState() we should save and restore the value of d->handleWidth rather than a result of handleWidth() which is non-negative. Change-Id: Idc11f8063d34b6c4a5f9b0a0032868679766dfb9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QSplitter: Exclude top level widgets from child event handling.Friedemann Kleint2014-07-151-1/+28
| | | | | | | | | Prevent the splitter from adding them to the layout or showing them. Task-number: QTBUG-40132 Change-Id: Ife2be0bbd7e489570ef41f6f72a034b356c65f18 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Extend QStyle API with a SH_Splitter_OpaqueResize styleHintRohan Garg2013-08-201-0/+2
| | | | | | | | | | | | Currently the default for QSplitter::opaqueResize is hard coded, which is less than ideal. Instead this should be provided as a style hint via QStyle so as to give a more uniform look to all applications. Change-Id: I5711811f7b672e36aafcd292ed320308570a0390 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@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-1/+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>
* Make it obvious that adding a QLayout to QSplitter is not supported.Mitch Curtis2012-11-021-1/+11
| | | | | | | | | | | | | | | It does not make sense to add a QLayout to a QSplitter, since the splitter manages its child widgets in the same manner as a QLayout. The result of doing so is that the child widgets inside that layout will lead to the splitter and the layout fighting to position the child widgets. QSplitter::addWidget should be used to add widgets directly to the splitter instead. Change-Id: I640b463cae8673f87354d28636bff4dd3cfb9679 Reviewed-by: Samu Voutilainen <samu.voutilainen@gmail.com> Reviewed-by: Samuel Rødal <samuel.rodal@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>
* Eliminate duplicate data row names in widgets autotests.Jason McDonald2012-02-151-1/+1
| | | | | Change-Id: I82bab3cc39320014fac6732c7b60233b262cb30d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Changed qsplitter unittest to work from install directoryKurt Korbatits2012-01-311-1/+1
| | | | | | | | | - Changed qsplitter unittest to use TESTDATA and QFINDTESTDATA Change-Id: I5db0fbfb20e6bd0ec169e884f16c1ec819f4e449 Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> 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>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-061-3/+0
| | | | | | | | | These comments were mostly empty or inaccurate. Appropriate naming of tests and appropriate placement of tests within the directory tree provide more reliable indicators of what is being tested. Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Moved tests into integrationtests/ and widgets/Jo Asplin2011-10-201-0/+777
Task-number: QTBUG-19013 Change-Id: Ibb776f5967c0645ce6d22ef7afdc40657c575461 Reviewed-by: Holger Ihrig <holger.ihrig@nokia.com>