summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/cursornavigationattached.cpp8
-rw-r--r--plugin/cursornavigationattached.h4
2 files changed, 11 insertions, 1 deletions
diff --git a/plugin/cursornavigationattached.cpp b/plugin/cursornavigationattached.cpp
index 6e208d5..44bcdb9 100644
--- a/plugin/cursornavigationattached.cpp
+++ b/plugin/cursornavigationattached.cpp
@@ -242,6 +242,14 @@ void CursorNavigationAttached::escape()
}
}
+QQuickItem *CursorNavigationAttached::currentItem()
+{
+ if (m_cursorNavigation && m_cursorNavigation->m_currentItem) {
+ return m_cursorNavigation->m_currentItem->item();
+ }
+ return nullptr;
+}
+
void CursorNavigationAttached::onWindowChanged(QQuickWindow *window)
{
qDebug() << "window changed, window = " << window;
diff --git a/plugin/cursornavigationattached.h b/plugin/cursornavigationattached.h
index a005d7c..ac37de3 100644
--- a/plugin/cursornavigationattached.h
+++ b/plugin/cursornavigationattached.h
@@ -107,7 +107,9 @@ public slots:
void moveForward();
void moveBack();
void escape();
-
+ /* Returns the item that currently has the cursor
+ */
+ QQuickItem *currentItem();
signals:
void acceptsCursorChanged(bool acceptsCursor);