QStandardItemModel: extend the test coverage for property bindings
The pre-existing tests were not using the QTestPrivate helpers, so extend them with the call to QTestPrivate::testReadWritePropertyBasics. The updated test didn't reveal any problems with binding loops, so no other action is required for now. Task-number: QTBUG-116346 Change-Id: I360614a40fe2bacb796051607ed67e7e666b4f22 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit ac59fcdab8adb80648fee15956428630946dd01d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
fd7418cfb5
commit
bda8582f39
@ -14,4 +14,5 @@ qt_internal_add_test(tst_qstandarditemmodel
|
|||||||
Qt::GuiPrivate
|
Qt::GuiPrivate
|
||||||
Qt::Widgets
|
Qt::Widgets
|
||||||
Qt::WidgetsPrivate
|
Qt::WidgetsPrivate
|
||||||
|
Qt::TestPrivate
|
||||||
)
|
)
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <QAbstractItemModelTester>
|
#include <QAbstractItemModelTester>
|
||||||
|
|
||||||
#include <private/qabstractitemmodel_p.h>
|
#include <private/qabstractitemmodel_p.h>
|
||||||
|
#include <private/qpropertytesthelper_p.h>
|
||||||
#include <private/qtreeview_p.h>
|
#include <private/qtreeview_p.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -902,6 +903,9 @@ void tst_QStandardItemModel::sortRoleBindings()
|
|||||||
sortRoleObserver.setBinding([&] { return model.sortRole(); });
|
sortRoleObserver.setBinding([&] { return model.sortRole(); });
|
||||||
model.setSortRole(Qt::EditRole);
|
model.setSortRole(Qt::EditRole);
|
||||||
QCOMPARE(sortRoleObserver, Qt::EditRole);
|
QCOMPARE(sortRoleObserver, Qt::EditRole);
|
||||||
|
|
||||||
|
QTestPrivate::testReadWritePropertyBasics(model, static_cast<int>(Qt::DisplayRole),
|
||||||
|
static_cast<int>(Qt::EditRole), "sortRole");
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QStandardItemModel::findItems()
|
void tst_QStandardItemModel::findItems()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user