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
legendcolordelegate.h
Go to the documentation of this file.
1
16#ifndef OPENSWMMVIS_UI_DELEGATES_LEGENDCOLORDELEGATE_H
17#define OPENSWMMVIS_UI_DELEGATES_LEGENDCOLORDELEGATE_H
18
19#include <QStyledItemDelegate>
20
21namespace openswmmvis::ui {
22
23class LegendColorDelegate : public QStyledItemDelegate
24{
25 Q_OBJECT
26public:
27 explicit LegendColorDelegate(QObject *parent = nullptr);
28
29 void paint(QPainter *painter, const QStyleOptionViewItem &option,
30 const QModelIndex &index) const override;
31
32 bool editorEvent(QEvent *event, QAbstractItemModel *model,
33 const QStyleOptionViewItem &option,
34 const QModelIndex &index) override;
35
36 // No createEditor: QColorDialog is modal and feels native opened from
37 // editorEvent() on click, matching how every GIS legend behaves.
38};
39
40} // namespace openswmmvis::ui
41
42#endif // OPENSWMMVIS_UI_DELEGATES_LEGENDCOLORDELEGATE_H
Definition legendcolordelegate.h:24
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition legendcolordelegate.cpp:22
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
Definition legendcolordelegate.cpp:65
int index
Position in m_quadRegions / m_quadReports.
Definition meshgenerator.cpp:153
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176