15#include <QtWidgets/qdialog.h>
33 CenterOnParent = 1 << 0,
35 IdealFit = CenterOnParent | FitOnScreen
41 MousePressed = 1 << 0,
46 Dialog(QWidget* _parent = (QWidget*)
nullptr);
51 virtual QWidget*
getQWidget(
void)
override {
return this; };
52 virtual const QWidget*
getQWidget(
void)
const override {
return this; };
55 DialogResult showDialog(
const ShowFlags& _showFlags = ShowFlags(IdealFit));
68 const std::string&
dialogName(
void)
const {
return m_dialogName; };
77 void close(DialogResult _result);
81 void closeRetry(
void);
82 void closeCancel(
void);
89 virtual void keyPressEvent(QKeyEvent* _event)
override;
90 virtual void mousePressEvent(QMouseEvent* _event)
override;
91 virtual void mouseMoveEvent(QMouseEvent* _event)
override;
92 virtual void mouseReleaseEvent(QMouseEvent* _event)
override;
93 virtual void closeEvent(QCloseEvent* _event)
override;
98 DialogStateFlags m_state;
99 QPoint m_lastMousePos;
101 DialogResult m_result;
102 std::string m_dialogName;
#define OT_ADD_FLAG_FUNCTIONS(___enumName)
Will add the default bitwise operations for the provided private 32/64 bit bitfield....
Definition Flags.h:129
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
void close(int _exitCode)
Definition main.cpp:178
Definition DialogCfg.h:22
DialogFlag
Definition DialogCfg.h:24
DialogResult dialogResult(void) const
Definition Dialog.h:65
DialogResult
Definition Dialog.h:23
@ Retry
Definition Dialog.h:27
@ No
Definition Dialog.h:26
@ Ok
Definition Dialog.h:24
@ Yes
Definition Dialog.h:25
const DialogStateFlags & getDialogState(void) const
Definition Dialog.h:70
Flags< DialogState > DialogStateFlags
Definition Dialog.h:44
virtual bool mayCloseDialogWindow(void) const
Definition Dialog.h:95
virtual const QWidget * getQWidget(void) const override
Definition Dialog.h:52
void setDialogFlags(DialogCfg::DialogFlags _flags)
Definition Dialog.h:62
void setDialogFlag(DialogCfg::DialogFlag _flag, bool _active=true)
Definition Dialog.h:61
const std::string & dialogName(void) const
Definition Dialog.h:68
void setDialogName(const std::string &_name)
Definition Dialog.h:67
virtual QWidget * getQWidget(void) override
Returns a pointer to the root widget of this object.
Definition Dialog.h:51
ShowFlag
Definition Dialog.h:31
Flags< ShowFlag > ShowFlags
Definition Dialog.h:37
DialogState
Definition Dialog.h:39
DialogCfg::DialogFlags dialogFlags(void) const
Definition Dialog.h:63
The Flags class is a wrapper around a enum that allows bitwise operations (flags)....
Definition Flags.h:214