QAbstractItemModelTester: Check size hint role
Returning the wrong data type for Qt::SizeHintRole may lead to a size of 0,0 and the item disappearing. Task-number: PYSIDE-2772 Change-Id: I906445f2ed2141da2606774f2b8ad6282662eb17 Reviewed-by: hjk <hjk@qt.io> (cherry picked from commit 84f2cd6523081ed8774b2a9fe9ee36d05172ff50) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
bca56f277e
commit
6333376402
@ -669,6 +669,10 @@ void QAbstractItemModelTesterPrivate::data()
|
||||
|| state == Qt::Checked);
|
||||
}
|
||||
|
||||
QVariant sizeHintVariant = model->data(model->index(0, 0), Qt::SizeHintRole);
|
||||
if (sizeHintVariant.isValid())
|
||||
MODELTESTER_VERIFY(sizeHintVariant.canConvert<QSize>());
|
||||
|
||||
Q_Q(QAbstractItemModelTester);
|
||||
|
||||
if (!QTestPrivate::testDataGuiRoles(q))
|
||||
|
Loading…
x
Reference in New Issue
Block a user