summaryrefslogtreecommitdiffstats
path: root/src/testlib/qabstractitemmodeltester.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.10' into ↵v5.15.10-lts-lgplTarja Sundqvist2023-04-241-0/+2
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ic1bb4240ca70a8a361fa0267476707446579221d
| * QtTest: includemocsMarc Mutz2022-04-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Task-number: QTBUG-102886 Change-Id: I9378ddcabbfa0ec5ca895f6ce55ab5f1ec2cade3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 82cf06fc2122dcef44c466ae0da839482a601a3c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into ↵v5.15.8-lts-lgplTarja Sundqvist2022-11-111-1/+1
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I569a2246c9e8d70430e8c5405b9f3df2218078ee
| * Fix typo in QAbstractItemModelTesterAndreas Buhr2021-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | When recursively checking children in QAbstractItemModelTester, the currentDepth of recursion was incorrectly increased. This patch fixes it. Change-Id: Ia79508f358e2fcb6b90780a79baec053522e871c Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 1f2f61d80860f55638cfd194bbed5d679a588b1f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.5' into ↵v5.15.5-lts-lgplTarja Sundqvist2022-05-161-2/+2
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I0cdb390124e783dc9cd832a9954baa76a0e9eb6b
| * Fix QAbstractItemModelTester false positiveLuca Beldi2021-05-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | When rows are removed from a model with no columns, the test should not report a problem if indexes are invalid Fixes: QTBUG-92886 Change-Id: I7a042dfdb2575f87208a00cbed13db3869807f84 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit fed2c0d23614df1b96dcc8746223501b07597a52) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.4' into ↵Tarja Sundqvist2022-04-071-1/+1
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I3d223d54a832c8365fec4b399550da79f4c1abbb
| * QAbstractItemModelTester: fix false positive when model has zero columnsDavid Faure2021-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | Regression introduced by me in commit 72e0d699cec09458ca9325035d477d4899e8e47b Fixes: QTBUG-92220 Change-Id: Ic7dd4eda0a1993f9763933882baf928bfc83b08b Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b4aac2af19690917553f93660e3ad760fc15d0b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Revert "Update commercial license headers"Tarja Sundqvist2021-03-241-20/+20
|/ | | | | | | | | | | This reverts commit 81f474501aa0c7bfe2a206b303da022b72423e46. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I3c477161af0e2d166f282da344d028fdd4cfca53 Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
* Update commercial license headersTarja Sundqvist2021-01-261-20/+20
| | | | | | | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qtbase/src/printsupport, tqtc-qtbase/src/sql, tqtc-qtbase/src/testlib, tqtc-qtbase/src/tools, tqtc-qtbase/src/widgets, tqtc-qtbase/src/winmain, tqtc-qtbase/src/xml. The documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4154 Change-Id: Ic0372da6cefd42319c4cf82a67bbbb409c1ebfc0 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QAbstractItemModelTester: don't rely on hasChildren()David Faure2020-10-281-4/+5
| | | | | | | | | | | | | | | | | | | | Dynamic models which use fetchMore to asynchronously fill subdirs (like KDirModel) return true in hasChildren() for dirs that are expected to have children (so that the "+" shows in the treeview) but do not actually have children readily available. They will be inserted later on once the async listing job is done (as a result of fetchMore triggering that job). So QAbstractItemModelTester should use rowCount instead, to find out if there are children present. This detected a bug in QConcatenateTablesProxyModel: it returned a non-zero rowCount for its items, while it's flat. Change-Id: Idcdc86159f1fc79ed5297075dfcf30c09896287a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 72e0d699cec09458ca9325035d477d4899e8e47b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Close memory leak in QTestLib support for item model testingVolker Hilsheimer2020-05-191-4/+14
| | | | | | | | | | | | QTest::toString allocates memory by calling qstrdup; that memory must be freed by the caller. Change-Id: I218bc57b3312fdd9195fb49eaed7d20df4bf717c Fixes: QTBUG-84081 Coverity-Id: 186979 Covierty-Id: 186980 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit fe4794f70ecc4a302b22ad26614203a70c049a13)
* Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-03-311-0/+6
|\ | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp Change-Id: Ifaa56153f5f0d687a6b4d94f84fcfa1e1751afd2
| * testlib: add QAbstractItemModelTester::verify()Liang Qi2020-03-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This amends b3e4be2d8b9debf217657436139da0152f6f8797. When building testlib with QtGui linked:(use "QT = core-private gui" in src/testlib/testlib.pro) Undefined symbols for architecture x86_64: "QAbstractItemModelTester::verify(bool, char const*, char const*, char const*, int)", referenced from: QTestPrivate::testDataGuiRoles(QAbstractItemModelTester*) in qabstractitemmodeltester.o Change-Id: Ideb10ddd6717fed8d9f91f75bbfc9d5a22104730 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Replace usages of QVariant::value by qvariant_castOlivier Goffart2019-12-151-1/+1
|/ | | | | | | This is done automatically with a clazy check Change-Id: I3b59511d3d36d416c8eda74858ead611d327b116 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix ICE on QNX 6.6Sergio Martins2018-10-051-1/+1
| | | | | | | qabstractitemmodeltester.cpp:223:31: internal compiler error: in expand_expr_real_1, at expr.c:9170 Change-Id: I098c1bdf706512c91c649205f4675de0ca374227 Reviewed-by: David Faure <david.faure@kdab.com>
* QAbstractItemModelTester: don't call match(QModelIndex(), ...)David Faure2018-06-271-2/+3
| | | | | | | | | The documentation for match() indicates that the index has to be valid since it determines which column to search in (in addition to "from which row"). So call match with a valid index, if the model isn't empty. Change-Id: I5f3754cf14d053bf04d207cefe7dcc938e0f4a5a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QAbstractItemModelTester: fix out-of-bounds index() callsDavid Faure2018-06-271-4/+15
| | | | | | | | | | | | | | When removing rows, the tester is looking at the data of the row "just before" and the row "just after" the removed rows, to see if they are still the same at the end of the removal operation. Guard this with bounds check, in case there is no row just before or just after. This is the opportunity to use modeltester in tst_qidentityproxymodel, which was already a testcase for removing the only row in a given parent. Change-Id: Iec8228c16b9c670b794e2665356d153679178494 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* TestLib: Fix license headers in qabstractitemmodeltester.*Kai Koehne2018-05-071-5/+16
| | | | | Change-Id: Ide05bcdd30cd5f672949aacd5564a4a73c38366d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* doc: Fix remaining clang parsing errors in QtTestMartin Smith2018-01-181-14/+14
| | | | | | | | This update also corrects all the remaining qdoc warnings in the mnodule. Change-Id: I1cea2cb1dd515d075a1e49a52ca78fc407c3a324 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Long live QAbstractItemModelTester!Giuseppe D'Angelo2018-01-091-0/+807
AKA the model tester, living in QtTestLib now. Underwent some significant refactoring from the original modeltester: in particular, it will stop testing illegal indices. [ChangeLog][QtTestLib] Added QAbstractItemModelTester, a class to help testing item models. Change-Id: I0e5efed7217330be11465ce3abb3590f3f2601a4 Reviewed-by: David Faure <david.faure@kdab.com>