2016-12-03 14:14:06 +00:00
|
|
|
#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;
|
2016-12-03 14:14:06 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2016-12-22 17:15:50 +00:00
|
|
|
void onTreeCurrentChanged(const QModelIndex &previous, const QModelIndex ¤t);
|
2016-12-03 14:14:06 +00:00
|
|
|
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;
|
2016-12-03 14:14:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEMPORARYWIDGET_H
|