46 lines
1.1 KiB
C
46 lines
1.1 KiB
C
|
#ifndef WIDGETDIALOGUE_H
|
||
|
#define WIDGETDIALOGUE_H
|
||
|
|
||
|
#include "qw_abstractgamedialogue.h"
|
||
|
#include <QObject>
|
||
|
|
||
|
class QWWidgetDialogue : public QObject, public QWAbstractGameDialogue
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
Q_DISABLE_COPY_MOVE(QWWidgetDialogue)
|
||
|
Q_PROPERTY(int exit_code READ exitCode WRITE setExitCode)
|
||
|
Q_PROPERTY(QString custom_string READ customString WRITE setCustomString)
|
||
|
Q_PROPERTY(bool to_save_string READ isCustomStringToSave WRITE setCustomStringToSave)
|
||
|
private:
|
||
|
QString qml_path;
|
||
|
|
||
|
QString custom_string;
|
||
|
int exit_code;
|
||
|
bool to_save_string;
|
||
|
|
||
|
public:
|
||
|
explicit QWWidgetDialogue(const QString &path);
|
||
|
virtual ~QWWidgetDialogue() override {}
|
||
|
|
||
|
void onExit(int code) override;
|
||
|
|
||
|
////////////////////////
|
||
|
|
||
|
QString qmlPath() const;
|
||
|
|
||
|
QString customString() const;
|
||
|
void setCustomString(const QString &str);
|
||
|
|
||
|
int exitCode() const;
|
||
|
void setExitCode(int code);
|
||
|
|
||
|
bool isCustomStringToSave() const;
|
||
|
void setCustomStringToSave(bool to_save);
|
||
|
|
||
|
////////////////////////
|
||
|
|
||
|
void writeToJson(QJsonObject &savejson) override;
|
||
|
};
|
||
|
|
||
|
#endif // WIDGETDIALOGUE_H
|