From a9445c3b9c8f51a229b62c25df1aeebe5c85c88d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20H=C3=B6ltt=C3=A4?= Date: Mon, 3 Dec 2018 13:44:15 +0100 Subject: Cursor now movable only to items that set the acceptsCursor value to true --- plugin/cursornavigation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugin/cursornavigation.cpp') diff --git a/plugin/cursornavigation.cpp b/plugin/cursornavigation.cpp index e35a939..718a24b 100644 --- a/plugin/cursornavigation.cpp +++ b/plugin/cursornavigation.cpp @@ -176,7 +176,7 @@ void CursorNavigation::registerItem(CursorNavigationAttached* item) QQuickItem *parentItem = item->item()->parentItem(); CursorNavigationAttached *parentCNA=nullptr; while (parentItem) { - if ((parentCNA=CursorNavigation::cursorNavigationAttachment(parentItem))) + if ((parentCNA=CursorNavigation::cursorNavigationAttachment(parentItem)) && parentCNA->acceptsCursor()) break; parentItem = parentItem->parentItem(); } @@ -198,6 +198,8 @@ void CursorNavigation::unregisterItem(CursorNavigationAttached* item) if (item->m_parentNavigable) item->m_parentNavigable->m_children.removeOne(item); + + //TODO if the item that is being unregistered has children, they should be reassigned to the item's parent } void CursorNavigation::_move(qreal angle, qreal tolerance, bool discrete) -- cgit v1.2.3