aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel
diff options
context:
space:
mode:
Diffstat (limited to 'libqmenumodel')
-rw-r--r--libqmenumodel/src/qmenumodel.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libqmenumodel/src/qmenumodel.cpp b/libqmenumodel/src/qmenumodel.cpp
index 5faeb43..ed2fd47 100644
--- a/libqmenumodel/src/qmenumodel.cpp
+++ b/libqmenumodel/src/qmenumodel.cpp
@@ -252,6 +252,7 @@ void QMenuModel::onItemsChanged(MenuNode *node,
/*! \internal */
QModelIndex QMenuModel::indexFromNode(MenuNode *node) const
{
+ if (node == m_root) return QModelIndex();
return createIndex(node->position(), 0, node);
}