1#ifndef MPSERVERSMODEL_H
2#define MPSERVERSMODEL_H
4#include <QAbstractListModel>
23 int rowCount(const QModelIndex& index) const override;
25 QVariant
data(const QModelIndex& index,
int role) const override;
27 QHash<
int, QByteArray>
roleNames() const override;
45 return m_currentIndex;
57 SGSharedPtr<RemoteXMLRequest> m_mpServerRequest;
58 bool m_doRestoreMPServer =
false;
62 ServerInfo(QString n, QString l, QString h,
int port);
64 QString
name, location, host;
68 std::vector<ServerInfo> m_servers;
69 int m_currentIndex = 0;
MPServersModel(QObject *parent=nullptr)
QVariant data(const QModelIndex &index, int role) const override
void onRefreshMPServersDone(simgear::HTTP::Request *)
QHash< int, QByteArray > roleNames() const override
void setCurrentIndex(int currentIndex)
void onRefreshMPServersFailed(simgear::HTTP::Request *)
void currentIndexChanged(int currentIndex)
void restoreMPServerSelection()
int findMPServerPort(const std::string &host)
int rowCount(const QModelIndex &index) const override