diff options
| author | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2020-07-27 17:09:49 +0200 |
|---|---|---|
| committer | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2020-07-27 17:13:25 +0200 |
| commit | 7411d37db68911c59016472e3aead0634cf555ae (patch) | |
| tree | 72238bf0774ad15a1ac5326ba4607f6caeb7f48f /src/main_qmladaptor.h | |
| parent | 77eefb1b2364737d824cc4cbefbe4b7bb1fd55b9 (diff) | |
| download | RWA.Support.DesktopApp-7411d37db68911c59016472e3aead0634cf555ae.tar.gz RWA.Support.DesktopApp-7411d37db68911c59016472e3aead0634cf555ae.tar.bz2 RWA.Support.DesktopApp-7411d37db68911c59016472e3aead0634cf555ae.zip | |
Move sources to src/ && lots of features
Diffstat (limited to 'src/main_qmladaptor.h')
| -rw-r--r-- | src/main_qmladaptor.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/main_qmladaptor.h b/src/main_qmladaptor.h new file mode 100644 index 0000000..30aae97 --- /dev/null +++ b/src/main_qmladaptor.h @@ -0,0 +1,56 @@ +#pragma once + +#include <QObject> +#include <QQmlApplicationEngine> +#include <QQuickItem> +#include <QMessageBox> +#include <QApplication> +#include <QClipboard> + +//#include "session.cpp" + +class MainQMLAdaptor : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool showMessageDialog READ getShowMessageDialog NOTIFY showMessageDialogChanged) // this makes showMessageDialog available as a QML property + Q_PROPERTY(QString _messageDialogTitle READ getMessageDialogTitle NOTIFY messageDialogTitleChanged) // this makes showMessageDialogTitle available as a QML property + Q_PROPERTY(QString _messageDialogText READ getMessageDialogText NOTIFY messageDialogTextChanged) // this makes showMessageDialogText available as a QML property + Q_PROPERTY(QMessageBox::Icon _messageDialogIcon READ getMessageDialogIcon NOTIFY messageDialogIconChanged) // this makes showMessageDialogIcon available as a QML property +public: + explicit MainQMLAdaptor(QObject *parent, QQmlApplicationEngine *engine = nullptr); + +// void setSession(Session session); + + bool setConnectButtonEnabled(bool enabled); + bool setConnectButtonChecked(bool checked); + + bool setStatusIndicator(bool active, QColor color = QColor(255,255,255)); + bool setStatus(QString status); + + bool openMessageDialog(QString title, QString text, QMessageBox::Icon); + QString getMessageDialogTitle(); + QString getMessageDialogText(); + QMessageBox::Icon getMessageDialogIcon(); + bool getShowMessageDialog(); +signals: + void showMessageDialogChanged(bool show); + void messageDialogTextChanged(QString text); + void messageDialogTitleChanged(QString title); + void messageDialogIconChanged(int iconindex); + +// static void onCloseSignal(); + +//protected: +// Session _session; +private: + QQmlApplicationEngine* _engine; + + bool _showMessageDialog; + QString _messageDialogTitle; + QString _messageDialogText; + QMessageBox::Icon _messageDialogIcon; + +public slots: + void handleCopyToClipboardButtonClick(QString copy_data); +// static void onCloseHandler(); +}; |
