mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-16 08:17:58 +00:00
33 lines
695 B
C++
33 lines
695 B
C++
#include "backend/computermanager.h"
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
class ComputerModel : public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
enum Roles
|
|
{
|
|
NameRole = Qt::UserRole,
|
|
OnlineRole,
|
|
PairedRole,
|
|
BusyRole,
|
|
AddPcRole
|
|
};
|
|
|
|
public:
|
|
explicit ComputerModel(QObject* object = nullptr);
|
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
|
|
|
int rowCount(const QModelIndex &parent) const override;
|
|
|
|
virtual QHash<int, QByteArray> roleNames() const override;
|
|
|
|
private slots:
|
|
void handleComputerStateChanged(NvComputer* computer);
|
|
|
|
private:
|
|
QVector<NvComputer*> m_Computers;
|
|
ComputerManager m_ComputerManager;
|
|
};
|