aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/itemregister.h
blob: 9c9430aa9fd0bcb1dca350e517e15ba0d5ed7234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*#ifndef ITEMREGISTER_H
#define ITEMREGISTER_H

#include <QObject>

class QQuickItem;

//keeps track of items that are cursor navigable
class ItemRegister : public QObject
{
    Q_OBJECT

public:
    ItemRegister();

    void registerItem(QQuickItem* item);
    void unregisterItem(QQuickItem* item);

    //find the items that are within the same scope as the argument item
    const QList<QQuickItem*> siblingItems(QQuickItem* item) const;

private Q_SLOTS:
    void onItemDestroyed(QObject *obj);

private:
    //find the item's first parent that is cursor navigable
    QQuickItem *findParent(QQuickItem* item);

    //for now the data structure is just a list. could be replaced with something more efficient for the final purpose
    QList<QQuickItem*> m_items;

};

#endif // ITEMREGISTER_H
*/