summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.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>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Use debug stream in QTest::toString's default fallback if possibleVolker Hilsheimer2022-07-131-1/+0
| | | | | | | | | | | | | | | | | | | | For built-in types, this is a compile-time assert - we should not have any types in Qt for which we have neither debug streaming nor a QTest::toString specialization implemented. A build of most of Qt submodules passes with this change, after minor modifications to some tests. We cannot declare QSizeHint::Policy as a metatype after the QMetaType has already been instantiated for it, and the QDebug stream operator for QElaspedTimer needs to be correctly declared within the namespace. Add a self-test function for a custom type, and update reference files of the self-test. Task-number: QTBUG-104867 Pick-to: 6.4 Change-Id: I2936db5933f4589fce45f47cf2f3224ed614d8c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
* 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-1/+1
| | | | | | | | | 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>
* Remove most compiler warnings about missing overridesLars Knoll2020-09-111-2/+2
| | | | | | | | | | | | Remove around 1000 compiler warnings about missing overrides in our auto tests. This significantly reduce the compiler warning noise in our auto tests, so that one can actually better see the real problems inbetween. Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Avoid initializing QFlags with 0 or nullptr in testsFriedemann Kleint2019-11-261-11/+6
| | | | | | | Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99. Change-Id: Ib5d17611e43e7ab2c63c7f0587f549377f262e32 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-1/+1
| | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QGraphicsView tests: Prefer exposed over activeJohan Klokkhammer Helsing2019-10-171-1/+1
| | | | | | | | Makes the tests pass on Wayland. Task-number: QTBUG-62188 Change-Id: I5860c1ae6dd3d15632d827f4e357cb6c2cc9c5e3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix deprecation warnings in widget autotestsChristian Ehrlicher2019-02-081-1/+1
| | | | | | | | Fix all deprecation warnings within tests/auto/widgets Change-Id: I854f54c0a1dc0a0086f626b93cd39f63cb1b6033 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* tests/auto/widgets/graphicsview: Avoid unconditional qWait()sKari Oikarinen2018-05-141-1/+1
| | | | | | | | Task-number: QTBUG-63992 Change-Id: Ibbcf5bf968fcf1b1c3a043c805bdcc23a4005f00 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Fix layout tests for GCC 5.2.x/5.3.xSami Nurmenniemi2017-03-301-3/+6
| | | | | | | | | | | | GCC bug 68949 causes tst_QGraphicsGridLayout and tst_QGraphicsLinearLayout to fail on 5.2.x/5.3.x: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68949. This change adds aggregate initialization to QSizeF arrays to work around the bug. The bug was discovered when compiling and running tests on ARM with GCC 5.3.0. Change-Id: I9ecf7b032b6ca1477c29dca3bd7d0ec8d69a0454 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tests/auto/widgets: use QCOMPARE(., nullptr)Marc Mutz2016-11-301-2/+2
| | | | | | | | | | | | .. instead of manually casted 0s. QCOMPARE(., nullptr) was added for Qt 5.8. Make use of the new API. In tst_qwidget.cpp, as a drive-by, change qApp->focusWidget() -> QApplication::focusWidget() Change-Id: I1331b8916b026d48e01534d1ed0b3d72f3f3d50c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QtWidgets: Remove Windows CE.Friedemann Kleint2016-04-071-11/+0
| | | | | | | | | Remove Windows CE-specific files, #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: I102745aaca9d9737f2108fe7618111743d5ae980 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* 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: Remove empty init/cleanup slots, constructors and destructors.Friedemann Kleint2015-12-101-22/+1
| | | | | | | | Move some code (like registrations of meta types) from init() to initTestCase() in the process. Change-Id: I57db5156647cfadab554fbed853b2e68b2815f3b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* tests/auto/widgets: Remove some placeholder formatting.Friedemann Kleint2015-10-191-3/+5
| | | | | | | | 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>
* Fixed a bug where spans did not always work in layouts.Jan Arve Saether2014-12-091-0/+17
| | | | | | | | | | | | | | | | The problem was that the span we stored in the multiCellMap was the "effective" span (i.e. the given span subtracted with the number of ignored rows it would span). Later we used that span to distribute its size across all its cells. However, since the span now could be smaller that the given span, we could sometimes fail to distribute to the last span(s). [ChangeLog][QtWidgets][layouts] Fixed a bug where spans sometimes didn't distribute themselves to the last cells they covered. Change-Id: I31db3d850484dc8b70d62c5f02f680740578c661 Task-number: QTBUG-43099 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Adjust the layout if a QGraphicsWidget is explicitly hiddenJan Arve Saether2014-10-231-0/+89
| | | | | | | | | Since layout items can now be hidden, this also makes sure we respect the QSizePolicy::retainSizeWhenHidden Task-number: QTBUG-20132 Change-Id: Iab59fc9b61d4ca1bb2208c479a027da6eb0283a9 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.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>
* expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-1/+1
| | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-041-0/+12
|\ | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/plugins/platforms/cocoa/qnsview.mm Change-Id: I6fe345df5c417cb7a55a3f91285d9b47a22c04fa
| * Made sure items with preferred width of 0 could also stretchJan Arve Saether2013-05-271-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If no stretch factors were specified, we used the preferred size as a stretch factor. Obviously, that didn't work if the preferred size was actually 0. This patch works around this by actually setting the stretch factor to 1.0 if this is the case. This should work fine in most cases, except for the case where there are also other items with a preferred size close to 0. In this case, the item with preferred size 0 will just grow faster than an item with e.g. preferred size 0.1. Task-number: QTBUG-31217 Change-Id: I966455da0bdd00308591c7f7cfbc4e134d423e57 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | Fixed a bug where the MaximumSizeHint of a layout with spans was wrongJan Arve Saether2013-04-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This was spotted while tracking down a similar bug related to spans. This now also eliminates the Q_EXPECT_FAILs in heightForWidthWithSpanning(), since it now finally works. The problem was only for the maximum size, since the size of an ignored row/column was min: 0, pref: 0, max: FLT_MAX (the default constructed values for a QGridLayoutBox). Change-Id: Ibb33c26ede40ed02edd26f596ba6133d59c9962f Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | Fixed a bug where spans across empty cells got broken.Jan Arve Saether2013-04-031-0/+28
|/ | | | | | | | | | | | | | | If a row/column is only used only because of the spanning of an item, the cell should be treated as it didn't exist. We keep track of this with the "ignore" bit array. The old code would always start from the row/column at position 1. In the attached testcase this made the effectiveRowSpan become larger than actually needed. Task-number: QTBUG-30255 Change-Id: Ief0e7018ee8e5ee36272ce075a43312ffeac7b91 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-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>
* 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>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtWidgets]Thiago Macieira2012-05-031-5/+5
| | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: Ie8ac500f2f8ebe99b7525feaa7b39247e641a461 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Eliminate duplicate data row names in widgets autotests.Jason McDonald2012-02-151-2/+1
| | | | | Change-Id: I82bab3cc39320014fac6732c7b60233b262cb30d 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>
* Replace Q_WS_MAC with Q_OS_MAC in tests/auto/widgetsBradley T. Hughes2012-01-231-2/+2
| | | | | | | | tst_qwidget.cpp will not build/link without tst_qwidget_mac_helpers.mm, so re-add it to the build as well. Change-Id: I55130f62c215c4b82683d90456e31fdb09f833a8 Reviewed-by: Samuel Rødal <samuel.rodal@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>
* Don't depend on moc to disable test functions.Jason McDonald2011-11-181-10/+6
| | | | | | | | | | | | | | | | | | | | | The moc tool is not aware of all defines (particularly those that are compiler builtins) and does not correctly evaluate others that depend on compiler builtins, such as Q_OS_FOO. This commit reverts parts of the following commits, but is not a complete fix as there were many instances of this problem in the tests prior to those commits: 924d810dbdcd5b5b0fa860922b2487ea9062d002 8aaff6751038b88d17e23be6fcee945771297c5b 338d3f11973412047c2c9cd41cbd0c961d738ef3 a55034062ba2bf73a9f1ed3d9cf31745b38149e3 253497b7446c7d723aa3bdd7152e25d6852f2604 7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 9d2ff58f3642828e494e7e9b2df7dbb8e2cd408f 0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove QSKIPs from qgraphicsgridlayout testJason McDonald2011-10-251-6/+6
| | | | | | | | | | If the test decides not to do some extra testing for certain styles, but doesn't find any failures in what it has done so far, it should pass rather than skipping. Removing the QSKIPs also corrects the leakage of the memory pointed to by "widget". Change-Id: Id4cf7e8dc48f836d2c6dcde57dde87797a2fe036 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove SkipMode parameter from QSKIP calls.Jason McDonald2011-10-211-3/+3
| | | | | | | | | The previous commit removed SkipMode from the testlib APi. This commit removes the parameter from all calls to QSKIP. Task-number: QTBUG-21851, QTBUG-21652 Change-Id: I21c0ee6731c1bc6ac6d962590d9b31d7459dfbc5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Moved tests into integrationtests/ and widgets/Jo Asplin2011-10-201-0/+3465
Task-number: QTBUG-19013 Change-Id: Ibb776f5967c0645ce6d22ef7afdc40657c575461 Reviewed-by: Holger Ihrig <holger.ihrig@nokia.com>