aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel
diff options
context:
space:
mode:
Diffstat (limited to 'libqmenumodel')
-rw-r--r--libqmenumodel/src/qmenumodel.cpp3
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);
}