From cf52c268b036d808901313acc554587465bdd746 Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Mon, 30 Jan 2012 11:04:07 +1000 Subject: 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 --- src/widgets/itemviews/qstandarditemmodel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/widgets/itemviews/qstandarditemmodel.cpp') 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 @@ -2079,6 +2079,15 @@ QStandardItemModel::~QStandardItemModel() { } +/*! + Sets the item role names to \a roleNames. +*/ +void QStandardItemModel::setItemRoleNames(const QHash &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. -- cgit v1.2.3