42 #ifndef QDECLARATIVEINPUTDEVICEINFO_H
43 #define QDECLARATIVEINPUTDEVICEINFO_H
46 #include <QAbstractListModel>
47 #include "qinputinfo.h"
49 class QDeclarativeInputDeviceInfo :
public QAbstractListModel
52 Q_DISABLE_COPY(QDeclarativeInputDeviceInfo)
56 ServiceRole = Qt::UserRole + 1
59 explicit QDeclarativeInputDeviceInfo(QObject *parent = 0);
60 virtual ~QDeclarativeInputDeviceInfo();
62 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const;
63 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
65 QHash<int, QByteArray> roleNames()
const;
67 Q_INVOKABLE
int indexOf(
const QString &devicePath)
const;
69 Q_INVOKABLE QInputDevice *
get(
int index)
const;
72 void newDevice(
const QString &devicePath);
73 void deviceRemoved(
const QString &devicePath);
76 void updateDeviceList();
78 QInputDeviceInfo *deviceInfo;
79 QVector<QInputDevice *> inputDevices;
81 void addedDevice(
const QString &);
82 void removedDevice(
const QString &path);
86 #endif // QDECLARATIVEINPUTDEVICEINFO_H