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
dialogregistry.h
Go to the documentation of this file.
1
42#ifndef OPENSWMMVIS_UI_DIALOGS_DIALOGREGISTRY_H
43#define OPENSWMMVIS_UI_DIALOGS_DIALOGREGISTRY_H
44
45#include <QList>
46#include <QObject>
47#include <QPointer>
48// Qt 6's QPointer<T> needs T complete wherever it is assigned or compared,
49// and a forward declaration is not enough — same reasoning as the note in
50// ui/panels/legenddock.h.
51#include <QDialog>
52
53class QEvent;
54
55namespace openswmmvis::ui {
56
57class DialogRegistry : public QObject
58{
59 Q_OBJECT
60
61public:
67 Q_ENUM(StackingMode)
68
69
71 static DialogRegistry *instance();
72
76
77 StackingMode stackingMode() const { return mMode; }
79
86 QList<QPointer<QDialog>> openDialogs() const;
87
91 void raiseAllInOrder();
92
93signals:
97
98protected:
99 bool eventFilter(QObject *watched, QEvent *event) override;
100
101private:
102 explicit DialogRegistry(QObject *parent = nullptr);
103
106 static QDialog *trackableDialog(QObject *watched);
107
108 void trackOrPromote(QDialog *dlg);
109 void forget(QDialog *dlg);
110 void scheduleRestack();
111
112 QList<QPointer<QDialog>> mOrder;
114 bool mRestackQueued = false;
115};
116
117} // namespace openswmmvis::ui
118
119#endif // OPENSWMMVIS_UI_DIALOGS_DIALOGREGISTRY_H
Definition dialogregistry.h:58
static DialogRegistry * instance()
The process-wide instance. Created on first use; install it on the QApplication as an event filter to...
Definition dialogregistry.cpp:34
StackingMode stackingMode() const
Definition dialogregistry.h:77
void raiseAllInOrder()
Raise every registered dialog in MRU order, so the most recently used ends up on top....
Definition dialogregistry.cpp:141
QList< QPointer< QDialog > > openDialogs() const
Open modeless top-level dialogs, least-recently-used first.
Definition dialogregistry.cpp:130
static StackingMode configuredStackingMode()
Resolve the configured mode: OPENSWMM_DIALOG_STACKING env var, then the "Window/DialogStacking" setti...
Definition dialogregistry.cpp:40
void setStackingMode(StackingMode mode)
Definition dialogregistry.cpp:65
void openDialogsChanged()
A dialog was registered, removed, or reordered — the Window menu rebuilds from this.
bool eventFilter(QObject *watched, QEvent *event) override
Definition dialogregistry.cpp:167
StackingMode
How modeless dialogs are kept above the application's windows.
Definition dialogregistry.h:63
@ QtRaiseOnActivate
Portable raise() pass driven by activation.
@ NativeChildWindow
macOS AppKit -addChildWindow: (current default)
QuadRegionMode mode
Resolved mode.
Definition meshgenerator.cpp:154
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176