From bfeb2fdd7999e63fd21045eb7c0ac5dc5e62d726 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 15 Feb 2016 12:51:25 +0100 Subject: 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) --- src/gui/itemmodels/qstandarditemmodel.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui/itemmodels/qstandarditemmodel.cpp') diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp index e843351cf7..479a4283b0 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -2168,6 +2168,7 @@ void QStandardItemModel::clear() Q_D(QStandardItemModel); beginResetModel(); d->root.reset(new QStandardItem); + d->root->setFlags(Qt::ItemIsDropEnabled); d->root->d_func()->setModel(this); qDeleteAll(d->columnHeaderItems); d->columnHeaderItems.clear(); -- cgit v1.2.3