diff options
author | Alberto Mardegan <alberto.mardegan@canonical.com> | 2013-06-06 12:27:08 +0000 |
---|---|---|
committer | Tarmac <> | 2013-06-06 12:27:08 +0000 |
commit | 2c5855ca07be8957e31d19f0866280d12902b6b6 (patch) | |
tree | efd39ec072b094f38e220e9dfdc24257135e2f73 /libqmenumodel | |
parent | 885710fa1a01644cdc736074a06aef0616f06abe (diff) | |
parent | 8157af28188959d105f13657886517ea90fcb37e (diff) | |
download | qmenumodel-2c5855ca07be8957e31d19f0866280d12902b6b6.tar.gz qmenumodel-2c5855ca07be8957e31d19f0866280d12902b6b6.tar.bz2 qmenumodel-2c5855ca07be8957e31d19f0866280d12902b6b6.zip |
Use invalid index as root index
When emitting the rowsInserted signal for top-level items, use an invalid
QModelIndex as parent.
Approved by Renato Araujo Oliveira Filho, PS Jenkins bot.
Diffstat (limited to 'libqmenumodel')
-rw-r--r-- | libqmenumodel/src/qmenumodel.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libqmenumodel/src/qmenumodel.cpp b/libqmenumodel/src/qmenumodel.cpp index 5faeb43..9bc9e02 100644 --- a/libqmenumodel/src/qmenumodel.cpp +++ b/libqmenumodel/src/qmenumodel.cpp @@ -252,6 +252,9 @@ void QMenuModel::onItemsChanged(MenuNode *node, /*! \internal */ QModelIndex QMenuModel::indexFromNode(MenuNode *node) const { + if (node == m_root) { + return QModelIndex(); + } return createIndex(node->position(), 0, node); } |