Do not crash trying to load or save QModelIndex.
QModelIndex doesn't have data stream operators loading or saving this type should gracefully fail. Change-Id: I6a1a3bab3f83ff4921369a07fdb54ac462eff554 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
parent
d97fd99270
commit
c9319f17f4
@ -633,6 +633,7 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
|
||||
case QMetaType::VoidStar:
|
||||
case QMetaType::QObjectStar:
|
||||
case QMetaType::QWidgetStar:
|
||||
case QMetaType::QModelIndex:
|
||||
return false;
|
||||
case QMetaType::Long:
|
||||
stream << qlonglong(*static_cast<const long *>(data));
|
||||
@ -837,6 +838,7 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
|
||||
case QMetaType::VoidStar:
|
||||
case QMetaType::QObjectStar:
|
||||
case QMetaType::QWidgetStar:
|
||||
case QMetaType::QModelIndex:
|
||||
return false;
|
||||
case QMetaType::Long: {
|
||||
qlonglong l;
|
||||
|
Loading…
Reference in New Issue
Block a user