Maki
Formally verified low-code orchestration
Loading...
Searching...
No Matches
base_dialog.h
1#pragma once
2
3#include <QDialog>
4#include <QVBoxLayout>
5
6class QDialogButtonBox;
7
11class BaseDialog : public QDialog
12{
13 Q_OBJECT
14public:
23 BaseDialog(const QString& title, double ratio, double screenFraction, QWidget* parent = nullptr);
24
25protected:
32 void setSize(double ratio, double screenFraction);
33
41 void setSize(double ratio, double screenFraction, qreal heightFraction);
42
43 void keyPressEvent(QKeyEvent* event) override;
44
50 QVBoxLayout* layout();
51
59 QDialogButtonBox* createButtons(const QString& ok, const QString& cancel);
60
66 void limitWidth(int minWidth);
67
73 void limitHeight(int minHeight);
74
75private:
76 int mMinimunWidth;
77 int mMinimunHeight;
78};
BaseDialog(const QString &title, double ratio, double screenFraction, QWidget *parent=nullptr)
Constructs a new BaseDialog instance.
Definition base_dialog.cpp:17
void limitHeight(int minHeight)
Defines the heigth limits for the dialog.
Definition base_dialog.cpp:117
void setSize(double ratio, double screenFraction)
Sets the size of the dialog based on the given ratio and screen fraction.
Definition base_dialog.cpp:31
void limitWidth(int minWidth)
Defines the width limits for the dialog.
Definition base_dialog.cpp:110
QDialogButtonBox * createButtons(const QString &ok, const QString &cancel)
Creates a button box with OK and Cancel buttons.
Definition base_dialog.cpp:71
QVBoxLayout * layout()
Returns the layout of the dialog.
Definition base_dialog.cpp:66