diff options
author | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2019-05-28 14:02:08 +0800 |
---|---|---|
committer | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2019-05-28 14:02:08 +0800 |
commit | 3508d025b0046fffb337ffceb912947ef1dcf47d (patch) | |
tree | c2665aa357bda0132a6134621c9cacd0b2795200 /launcher/src/shortcutappmodel.h | |
parent | 353da85004c72efb2bd6f117a15713b58e0df866 (diff) |
registerShortcut
Change-Id: Ia05d26a3e14f6b35e53f70c116e5b422518883a4
Diffstat (limited to 'launcher/src/shortcutappmodel.h')
-rw-r--r-- | launcher/src/shortcutappmodel.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/launcher/src/shortcutappmodel.h b/launcher/src/shortcutappmodel.h new file mode 100644 index 0000000..e11e121 --- /dev/null +++ b/launcher/src/shortcutappmodel.h @@ -0,0 +1,53 @@ +#ifndef SHORTCUTAPPMODEL_H +#define SHORTCUTAPPMODEL_H + +#include <QtCore/QAbstractListModel> +#include <QXmlStreamReader> +#include <QXmlStreamWriter> +#include <QFile> +#include <QProcess> +#include <QThread> + +struct RegisterApp { + QString id; + QString name; + QString icon; + bool isBlank; +}; + +class ShortcutAppModel : public QAbstractListModel +{ + Q_OBJECT +public: + explicit ShortcutAppModel(QObject *parent = nullptr); + ~ShortcutAppModel(); + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QHash<int, QByteArray> roleNames() const override; + + Q_INVOKABLE QString getId(int index) const; + Q_INVOKABLE QString getName(int index) const; + Q_INVOKABLE QString getIcon(int index) const; + Q_INVOKABLE bool isBlank(int index) const; + +public slots: + void shortcutUpdate(QStringList shortcut_list); + +signals: + void updateShortcut(); + +private: + void init(); + void getAppQueue(); + void setAppQueuePoint(QString id, QString name); + QString getIconPath(QString id); + + class Private; + Private *d; + RegisterApp app; + +}; + +#endif // SHORTCUTAPPMODEL_H |