diff options
author | Chris Adams <christopher.adams@nokia.com> | 2012-01-30 11:04:07 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-31 12:00:31 +0100 |
commit | cf52c268b036d808901313acc554587465bdd746 (patch) | |
tree | e0efea11753f61faed7fbb3f15ea86a4adb702e9 /src/widgets/itemviews/qstandarditemmodel.cpp | |
parent | cf20c06756a461730f35acf7631cbf5e762fcfe1 (diff) |
Add public role names setter to QStandardItemModel
This allows QStandardItemModel to be usable in QML without requiring
clients to subclass it.
Task-number: QTBUG-15067
Change-Id: I867fcd8137132affdf21f37a9fa293e855a09a13
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/widgets/itemviews/qstandarditemmodel.cpp')
-rw-r--r-- | src/widgets/itemviews/qstandarditemmodel.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qstandarditemmodel.cpp b/src/widgets/itemviews/qstandarditemmodel.cpp index 0fa82cbd42..112b533f4f 100644 --- a/src/widgets/itemviews/qstandarditemmodel.cpp +++ b/src/widgets/itemviews/qstandarditemmodel.cpp @@ -2080,6 +2080,15 @@ QStandardItemModel::~QStandardItemModel() } /*! + Sets the item role names to \a roleNames. +*/ +void QStandardItemModel::setItemRoleNames(const QHash<int,QByteArray> &roleNames) +{ + Q_D(QStandardItemModel); + d->roleNames = roleNames; +} + +/*! Removes all items (including header items) from the model and sets the number of rows and columns to zero. |