qt5base-lts/tests/auto/corelib/itemmodels
Stephen Kelly c3ad8c1c06 Make the roleNames a virtual accessor.
This is consistent with the rest of the API of QAbstractItemModel
(which is virtual) and removes the need for code like this
in the constructor (where it doesn't belong):

QHash<int, QByteArray> myRoleNames = roleNames();
myRoleNames.insert(Qt::UserRole + 1, "myCustomRole");
setRoleNames(myRoleNames);

in favor of

MyModel::roleNames() const {
  QHash<int, QByteArray> myRoleNames = QAbstractItemModel::roleNames();
  myRoleNames.insert(Qt::UserRole + 1, "myCustomRole");
  return myRoleNames;
}

which is consistent with all other QAIM API (eg, flags()).

This is a source compatible change.

Change-Id: I7e1ce17f8dab2292c4c7b6dbd3c09ec71b5c793b
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Marius Bugge Monsen <marius@cutehacks.com>
2012-01-10 11:37:28 +01:00
..
qabstractitemmodel Make the roleNames a virtual accessor. 2012-01-10 11:37:28 +01:00
qabstractproxymodel Update copyright year in license headers. 2012-01-05 06:36:56 +01:00
qidentityproxymodel Cleanup itemmodel autotests. 2011-12-28 06:33:32 +01:00
qitemmodel Move the qitemmodel test to the itemmodels directory. 2012-01-06 17:21:25 +01:00
qitemselectionmodel Update copyright year in license headers. 2012-01-05 06:36:56 +01:00
qsortfilterproxymodel Update copyright year in license headers. 2012-01-05 06:36:56 +01:00
qstringlistmodel Update copyright year in license headers. 2012-01-05 06:36:56 +01:00
itemmodels.pro Move the qitemmodel test to the itemmodels directory. 2012-01-06 17:21:25 +01:00