summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStephen Kelly <ske@ableton.com>2016-02-15 12:51:25 +0100
committerStephen Kelly <ske@ableton.com>2016-02-17 11:39:13 +0000
commitbfeb2fdd7999e63fd21045eb7c0ac5dc5e62d726 (patch)
treedbe2657a77853b6b0412919d6bacab8c974bb92e /tests
parenta44d7862c8e92ad2bc2d0d56e542066e688d5c82 (diff)
QStandardItemModel: Reset the flags on clear()
Pass modeltest after clear(). Otherwise it fails because more flags than Qt::ItemIsDropEnabled get returned for the QModelIndex(). Change-Id: I8f11515cc7dc9383f528f785312ffb77b3c2699d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro6
-rw-r--r--tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp4
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro b/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro
index eef165d9f7..3c12a83f5a 100644
--- a/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro
+++ b/tests/auto/gui/itemmodels/qstandarditemmodel/qstandarditemmodel.pro
@@ -4,6 +4,10 @@ TARGET = tst_qstandarditemmodel
QT += widgets widgets-private testlib
QT += core-private gui-private
-SOURCES += tst_qstandarditemmodel.cpp
+mtdir = ../../../other/modeltest
+INCLUDEPATH += $${mtdir}
+
+SOURCES += $${mtdir}/modeltest.cpp tst_qstandarditemmodel.cpp
+HEADERS += $${mtdir}/modeltest.h
diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
index 7e9e5a6e96..dca718a6d8 100644
--- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
@@ -32,6 +32,7 @@
#include <qstandarditemmodel.h>
#include <QTreeView>
#include <private/qtreeview_p.h>
+#include "modeltest.h"
class tst_QStandardItemModel : public QObject
{
@@ -734,6 +735,9 @@ void tst_QStandardItemModel::clear()
QSignalSpy modelResetSpy(&model, SIGNAL(modelReset()));
QSignalSpy layoutChangedSpy(&model, SIGNAL(layoutChanged()));
QSignalSpy rowsRemovedSpy(&model, SIGNAL(rowsRemoved(QModelIndex,int,int)));
+
+ ModelTest mt(&model);
+
model.clear();
QCOMPARE(modelResetSpy.count(), 1);