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
stylepreviewswatch.h
Go to the documentation of this file.
1
13#ifndef OPENSWMMVIS_UI_WIDGETS_STYLEPREVIEWSWATCH_H
14#define OPENSWMMVIS_UI_WIDGETS_STYLEPREVIEWSWATCH_H
15
16#include <QColor>
17#include <QPen>
18#include <QWidget>
19#include <Qt>
20
21namespace openswmmvis::ui {
22
23class StylePreviewSwatch : public QWidget
24{
25 Q_OBJECT
26public:
28
29 explicit StylePreviewSwatch(QWidget *parent = nullptr);
30
31 void setKind(Kind k);
32
34 void setColor(const QColor &c);
35
37 void setStrokePen(const QPen &pen);
38
41 void setMarkerSizePx(double px);
42 void setMarkerShape(int shapeEnum);
43
45 void setLineWidthPx(double px);
46
49 void setShowArrows(bool v);
50
53 void setFillOpacity(double v);
54
55protected:
56 void paintEvent(QPaintEvent *event) override;
57 QSize sizeHint() const override { return QSize(180, 56); }
58 QSize minimumSizeHint() const override { return QSize(120, 40); }
59
60private:
61 Kind m_kind = PointKind;
62 QColor m_color = QColor(80, 130, 200);
63 QPen m_strokePen = QPen(QColor(40, 40, 40), 1.0);
64 double m_markerSizePx = 12.0;
65 int m_markerShape = 0;
66 double m_lineWidthPx = 2.0;
67 bool m_showArrows = false;
68 double m_fillOpacity = 0.55;
69};
70
71} // namespace openswmmvis::ui
72
73#endif // OPENSWMMVIS_UI_WIDGETS_STYLEPREVIEWSWATCH_H
Definition stylepreviewswatch.h:24
void paintEvent(QPaintEvent *event) override
Definition stylepreviewswatch.cpp:36
Kind
Definition stylepreviewswatch.h:27
@ PointKind
Definition stylepreviewswatch.h:27
@ LineKind
Definition stylepreviewswatch.h:27
@ PolygonKind
Definition stylepreviewswatch.h:27
void setColor(const QColor &c)
Definition stylepreviewswatch.cpp:28
void setFillOpacity(double v)
Definition stylepreviewswatch.cpp:34
void setKind(Kind k)
Definition stylepreviewswatch.cpp:27
void setMarkerShape(int shapeEnum)
Definition stylepreviewswatch.cpp:31
QSize minimumSizeHint() const override
Definition stylepreviewswatch.h:58
QSize sizeHint() const override
Definition stylepreviewswatch.h:57
void setLineWidthPx(double px)
Definition stylepreviewswatch.cpp:32
void setStrokePen(const QPen &pen)
Definition stylepreviewswatch.cpp:29
void setShowArrows(bool v)
Definition stylepreviewswatch.cpp:33
void setMarkerSizePx(double px)
Definition stylepreviewswatch.cpp:30
int k
Definition mesh2dresultsexport.cpp:549
Definition openswmmvislayer.h:43
QVector< int > v
pool vertex indices
Definition pslgminsize.cpp:159
QVector< int > parent
union-find
Definition pslgminsize.cpp:176