diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-06-10 17:18:59 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-06-10 19:58:48 +0200 |
commit | 84e76c37a5fb040e63f1eabf2fb7010d782a7106 (patch) | |
tree | 794d95d8dce2e15f0784d3d05606d8dd957a5dc7 /src/gui/itemmodels/qstandarditemmodel.cpp | |
parent | 7ec12b2902cc84a85ac6fe05ea98f76efa214344 (diff) |
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 <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/itemmodels/qstandarditemmodel.cpp')
-rw-r--r-- | src/gui/itemmodels/qstandarditemmodel.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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(); } /*! |