1
0
Fork 0
flightgear/utils/fgqcanvas/temporarywidget.h

50 lines
1,013 B
C
Raw Normal View History

#ifndef TEMPORARYWIDGET_H
#define TEMPORARYWIDGET_H
#include <QWidget>
#include <QtWebSockets/QWebSocket>
#include <QAction>
namespace Ui {
class TemporaryWidget;
}
class LocalProp;
class CanvasTreeModel;
2016-12-22 16:59:19 +00:00
class ElementDataModel;
class TemporaryWidget : public QWidget
{
Q_OBJECT
public:
explicit TemporaryWidget(QWidget *parent = 0);
~TemporaryWidget();
private Q_SLOTS:
void onStartConnect();
void onConnected();
void onTextMessageReceived(QString message);
void onSocketClosed();
2016-12-22 16:59:19 +00:00
void onTreeCurrentChanged(const QModelIndex &previous, const QModelIndex &current);
private:
void saveSettings();
void restoreSettings();
LocalProp* propertyFromPath(QByteArray path) const;
QWebSocket m_webSocket;
Ui::TemporaryWidget *ui;
QByteArray rootPropertyPath;
LocalProp* m_localPropertyRoot = nullptr;
QHash<int, LocalProp*> idPropertyDict;
CanvasTreeModel* m_canvasModel;
2016-12-22 16:59:19 +00:00
ElementDataModel* m_elementModel;
};
#endif // TEMPORARYWIDGET_H