From 84e76c37a5fb040e63f1eabf2fb7010d782a7106 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 10 Jun 2020 17:18:59 +0200 Subject: Restore default role names in QStandardItemModel::roleNames() Amends 32b586864e3a4398da38c045f4ac0823c3dc3c57, which added an override of QStandardItemModel::roleNames(). It's good for it to have its own QHash so that roles can be added, and because QStandardItemModel::setItemRoleNames() remains un-deprecated; but before that change, they were the roles that QAbstractItemModel had initialized from QAbstractItemModelPrivate::defaultRoleNames(). In particular, we need "display" to map to Qt::DisplayRole by default; several tests in qtdeclarative depend on that. Change-Id: I58b2d6aa6b6c78b1d618335ddc4ecb834af57274 Reviewed-by: Volker Hilsheimer --- 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 7192126f91..ebb4d641eb 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -442,6 +442,7 @@ void QStandardItemModelPrivate::init() Q_Q(QStandardItemModel); QObject::connect(q, SIGNAL(dataChanged(QModelIndex,QModelIndex)), q, SLOT(_q_emitItemChanged(QModelIndex,QModelIndex))); + roleNames = QAbstractItemModelPrivate::defaultRoleNames(); } /*! -- cgit v1.2.3