SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
userflagsdialog.h
Go to the documentation of this file.
1
15#ifndef USERFLAGSDIALOG_H
16#define USERFLAGSDIALOG_H
17
18#include <QDialog>
19
21
22class QTableWidget;
23class QPushButton;
24class QDialogButtonBox;
25
35class UserFlagsDialog : public QDialog
36{
37 Q_OBJECT
38
39public:
41 QWidget *parent = nullptr);
42
44 [[nodiscard]] bool wroteAnyChanges() const noexcept { return m_wroteAnyChanges; }
45
49 bool applyChanges(QString *outError = nullptr);
50
54 void setConfirmationsEnabled(bool enabled) { m_confirmationsEnabled = enabled; }
55
57 [[nodiscard]] QTableWidget *table() const noexcept { return m_table; }
58
60 void addRow(const QString &name,
62 const QString &description);
63
64private slots:
65 void onAddClicked();
66 void onRemoveClicked();
67 void onApplyClicked();
68 void onAccepted();
69
70private:
71 void reloadFromModel();
72 [[nodiscard]] openswmmvis::ui::UserFlagsModel::FlagType rowType(int row) const;
73
74 openswmmvis::ui::UserFlagsModel *m_model = nullptr;
75 QTableWidget *m_table = nullptr;
76 QPushButton *m_addButton = nullptr;
77 QPushButton *m_removeButton = nullptr;
78 QDialogButtonBox *m_buttonBox = nullptr;
79 bool m_wroteAnyChanges = false;
80 bool m_confirmationsEnabled = true;
81};
82
83#endif // USERFLAGSDIALOG_H
Staged editor for user-flag definitions.
Definition userflagsdialog.h:36
QTableWidget * table() const noexcept
Definition userflagsdialog.h:57
bool wroteAnyChanges() const noexcept
Definition userflagsdialog.h:44
void setConfirmationsEnabled(bool enabled)
Definition userflagsdialog.h:54
bool applyChanges(QString *outError=nullptr)
Definition userflagsdialog.cpp:162
void addRow(const QString &name, openswmmvis::ui::UserFlagsModel::FlagType type, const QString &description)
Definition userflagsdialog.cpp:113
Definition userflagsmodel.h:32
FlagType
Definition userflagsmodel.h:36
enum OpenSWMM::Render::@788::Value::Type type
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
QString name
Definition sectionmodelbuilders.cpp:474
Engine-scoped store for user flags ([USER_FLAGS] / [USER_FLAG_VALUES]) — Phase 1 of docs/USER_FLAGS_U...