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
legenddock.h
Go to the documentation of this file.
1
20#ifndef OPENSWMMVIS_UI_PANELS_LEGENDDOCK_H
21#define OPENSWMMVIS_UI_PANELS_LEGENDDOCK_H
22
23#include <QDockWidget>
24#include <QPointer>
25
26// Qt 6's QPointer<T> requires T to be a complete QObject-derived type so
27// the static_cast<QObject *> inside QPointer::operator= compiles. A bare
28// forward declaration (`class MapCanvas;`) is no longer enough.
29#include "map/mapcanvas.h"
30
31class QTreeView;
32
33namespace openswmmvis::ui {
34
35class LegendLayerTreeModel;
36
37class LegendDock : public QDockWidget
38{
39 Q_OBJECT
40public:
41 explicit LegendDock(QWidget *parent = nullptr);
42 ~LegendDock() override = default;
43
48
53 [[nodiscard]] MapCanvas *canvas() const noexcept;
54
55private slots:
60 void onCustomContextMenuRequested(const QPoint &pos);
61
62private:
63 QPointer<MapCanvas> m_canvas;
64 QTreeView *m_tree = nullptr;
65 LegendLayerTreeModel *m_model = nullptr;
66};
67
68} // namespace openswmmvis::ui
69
70#endif // OPENSWMMVIS_UI_PANELS_LEGENDDOCK_H
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
Definition legenddock.h:38
void setCanvas(MapCanvas *canvas)
Re-bind to a (possibly null) canvas. Replaces the internal LegendLayerTreeModel so it reads from the ...
Definition legenddock.cpp:102
MapCanvas * canvas() const noexcept
Currently bound canvas, or nullptr if unbound.
Definition legenddock.cpp:97
~LegendDock() override=default
Definition legendlayertreemodel.h:43
Central map display — QGIS-style hybrid rendering.
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
int pos
Definition queryparser.cpp:36