Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef HTUNNELVIEWERMODEL_H
- #define HTUNNELVIEWERMODEL_H
- #include <QObject>
- #include <QtQml/QQmlEngine>
- #include <QQmlHelpers>
- #include <QAbstractListModel>
- #include <QMap>
- #include <QTimer>
- #include "toolbox.h"
- class HTunnelViewerModel : public QAbstractListModel
- {
- Q_OBJECT
- SINGELTON(HTunnelViewerModel)
- QML_WRITABLE_PROPERTY(bool, setEnabled)
- public:
- explicit HTunnelViewerModel(QObject *parent = 0);
- ~HTunnelViewerModel();
- static void declareQML();
- enum HTunnelViewerRole {
- Address = Qt::UserRole + 1,
- ActiveConnections,
- SpeedUp,
- SpeedDown
- };
- Q_ENUM(HTunnelViewerRole)
- /// QAbstractListModel
- virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
- virtual int rowCount(const QModelIndex & parent = QModelIndex()) const override;
- virtual QHash<int, QByteArray> roleNames() const override;
- private:
- QTimer m_updateTimer;
- };
- #endif // HTUNNELVIEWERMODEL_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement