aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/cursornavigation.h
diff options
context:
space:
mode:
authorAntti Hölttä <AHoelttae@luxoft.com>2018-10-30 15:40:04 +0100
committerAntti Hölttä <AHoelttae@luxoft.com>2019-03-18 16:30:59 +0100
commit00fa5d9215d32124292fe3e45372acebac7b9d31 (patch)
tree021b35b301ae990ac9842f5ebf21d8c51db718a5 /plugin/cursornavigation.h
parent2f4ec044ee4c7cf14481e1e0b86fecf804fcd770 (diff)
Refactor item registration with scopes in mind
ItemRegister class removed and items now keep track of their own cursor navigable child items. Navigation happens now only between siblings.
Diffstat (limited to 'plugin/cursornavigation.h')
-rw-r--r--plugin/cursornavigation.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugin/cursornavigation.h b/plugin/cursornavigation.h
index 2217679..7e61ee9 100644
--- a/plugin/cursornavigation.h
+++ b/plugin/cursornavigation.h
@@ -25,20 +25,22 @@ public:
static CursorNavigation *cursorNavigationForWindow(QQuickWindow *window);
+ static CursorNavigationAttached *cursorNavigationAttachment(QQuickItem *item);
+
private:
- void setCursorOnItem(QQuickItem *item);
+ void setCursorOnItem(CursorNavigationAttached *item);
void onActiveFocusItemChanged();
-
- static CursorNavigationAttached *cursorNavigationAttachment(QQuickItem *item);
+ void registerItem(CursorNavigationAttached* item);
+ void unregisterItem(CursorNavigationAttached* item);
private:
static const char windowPropertyName[];
QQuickWindow *m_window;
InputAdapter m_inputAdapter;
- QQuickItem *m_currentItem; //item that currently has the cursor
+ CursorNavigationAttached *m_currentItem; //item that currently has the cursor
QList<CursorNavigationAlgorithm*> m_algorithms;
- ItemRegister m_itemRegister;
-
+ //a root item that is not tied to any actual QQuickItem
+ CursorNavigationAttached m_rootItem;
friend class CursorNavigationAttached;
};