21#ifndef OPENSWMM_RENDER_LEGENDOVERLAYSTYLE_H
22#define OPENSWMM_RENDER_LEGENDOVERLAYSTYLE_H
116 static QString
itemKey(
const QObject *layer,
const QString &classKey);
122 const QString &classKey)
const;
131 void setItemVisible(
const QString &layerKey,
const QString &classKey,
bool visible);
135 const QString &
label);
143 Q_INVOKABLE QString
displayLabelFor(
const QString &propertyName)
const;
148 [[nodiscard]] QJsonObject
toJson()
const;
149 void fromJson(
const QJsonObject &j);
152 [[nodiscard]]
bool showTitle() const noexcept {
return m_showTitle; }
153 [[nodiscard]] QString
title()
const {
return m_title; }
154 [[nodiscard]] QFont
titleFont()
const {
return m_titleFont; }
155 [[nodiscard]] QColor
titleColor() const noexcept {
return m_titleColor; }
156 [[nodiscard]] QFont
itemFont()
const {
return m_itemFont; }
157 [[nodiscard]] QColor
itemColor() const noexcept {
return m_itemColor; }
160 [[nodiscard]]
int rowSpacing() const noexcept {
return m_rowSpacing; }
161 [[nodiscard]]
int swatchSize() const noexcept {
return m_swatchSize; }
162 [[nodiscard]]
int padding() const noexcept {
return m_padding; }
164 [[nodiscard]] qreal
opacity() const noexcept {
return m_opacity; }
167 [[nodiscard]]
int explicitWidth() const noexcept {
return m_explicitWidth; }
169 [[nodiscard]]
int maxLabelWidth() const noexcept {
return m_maxLabelWidth; }
172 [[nodiscard]] QPoint
freePosition() const noexcept {
return m_freePosition; }
175 [[nodiscard]]
bool showFrame() const noexcept {
return m_showFrame; }
176 [[nodiscard]] QColor
frameColor() const noexcept {
return m_frameColor; }
177 [[nodiscard]] qreal
frameWidth() const noexcept {
return m_frameWidth; }
178 [[nodiscard]]
int cornerRadius() const noexcept {
return m_cornerRadius; }
255 bool m_showTitle =
false;
258 QColor m_titleColor = QColor(20, 20, 20);
260 QColor m_itemColor = QColor(20, 20, 20);
261 QFont m_layerHeaderFont;
262 QColor m_layerHeaderColor = QColor(20, 20, 20);
263 int m_rowSpacing = 2;
264 int m_swatchSize = 14;
267 qreal m_opacity = 1.0;
270 int m_explicitWidth = 0;
271 int m_explicitHeight = 0;
272 int m_maxLabelWidth = 220;
273 QPoint m_freePosition;
276 bool m_showFrame =
true;
277 QColor m_frameColor = QColor(80, 80, 80, 180);
278 qreal m_frameWidth = 1.0;
279 int m_cornerRadius = 6;
283 QColor m_backgroundColor = QColor(255, 255, 255, 225);
284 QColor m_gradientEndColor = QColor(240, 240, 240, 225);
285 Qt::Orientation m_gradientOrientation = Qt::Vertical;
290 QHash<QString, ItemOverride> m_itemOverrides;
Model object holding the on-canvas legend's chrome configuration.
Definition legendoverlaystyle.h:50
Anchor
Definition legendoverlaystyle.h:54
void setExplicitHeight(int px)
Definition legendoverlaystyle.cpp:387
void explicitWidthChanged(int)
bool showTitle() const noexcept
Definition legendoverlaystyle.h:152
qreal opacity
Definition legendoverlaystyle.h:77
void resetToDefaults()
Definition legendoverlaystyle.cpp:148
QFont itemFont() const
Definition legendoverlaystyle.h:156
QColor itemColor() const noexcept
Definition legendoverlaystyle.h:157
qreal opacity() const noexcept
Definition legendoverlaystyle.h:164
QColor layerHeaderColor() const noexcept
Definition legendoverlaystyle.h:159
QColor itemColor
Definition legendoverlaystyle.h:70
void itemColorChanged(const QColor &)
int maxLabelWidth
Definition legendoverlaystyle.h:82
BackgroundMode
Definition legendoverlaystyle.h:59
QFont titleFont() const
Definition legendoverlaystyle.h:154
void showTitleChanged(bool)
void layerHeaderFontChanged(const QFont &)
int cornerRadius() const noexcept
Definition legendoverlaystyle.h:178
int padding() const noexcept
Definition legendoverlaystyle.h:162
void setFrameWidth(qreal w)
void titleFontChanged(const QFont &)
qreal frameWidth() const noexcept
Definition legendoverlaystyle.h:177
void setBackgroundColor(const QColor &c)
void layerHeaderColorChanged(const QColor &)
int cornerRadius
Definition legendoverlaystyle.h:88
void setItemOverride(const QString &layerKey, const QString &classKey, const ItemOverride &override)
Replace the override entry. visible == true + empty label removes the entry (defaults)....
Definition legendoverlaystyle.cpp:102
void backgroundModeChanged(BackgroundMode)
int explicitWidth() const noexcept
Definition legendoverlaystyle.h:167
QColor frameColor() const noexcept
Definition legendoverlaystyle.h:176
void setLayerHeaderColor(const QColor &c)
void fromJson(const QJsonObject &j)
Definition legendoverlaystyle.cpp:274
Anchor anchor
Definition legendoverlaystyle.h:76
void backgroundColorChanged(const QColor &)
QFont layerHeaderFont
Definition legendoverlaystyle.h:71
QColor backgroundColor() const noexcept
Definition legendoverlaystyle.h:182
BackgroundMode backgroundMode
Definition legendoverlaystyle.h:91
QString title
Definition legendoverlaystyle.h:66
void setItemUserLabel(const QString &layerKey, const QString &classKey, const QString &label)
Convenience: set only the userLabel.
Definition legendoverlaystyle.cpp:132
bool showFrame() const noexcept
Definition legendoverlaystyle.h:175
void setItemVisible(const QString &layerKey, const QString &classKey, bool visible)
Convenience: set only the visible flag.
Definition legendoverlaystyle.cpp:124
qreal frameWidth
Definition legendoverlaystyle.h:87
void setTitleColor(const QColor &c)
ItemOverride itemOverride(const QString &layerKey, const QString &classKey) const
Read the override for layerKey + classKey, or a default-constructed ItemOverride (visible=true,...
Definition legendoverlaystyle.cpp:95
int swatchSize() const noexcept
Definition legendoverlaystyle.h:161
QColor backgroundColor
Definition legendoverlaystyle.h:92
int explicitWidth
Definition legendoverlaystyle.h:80
int padding
Definition legendoverlaystyle.h:75
int rowSpacing() const noexcept
Definition legendoverlaystyle.h:160
QString title() const
Definition legendoverlaystyle.h:153
void setGradientEndColor(const QColor &c)
void opacityChanged(qreal)
~LegendOverlayStyle() override=default
Anchor anchor() const noexcept
Definition legendoverlaystyle.h:163
void setFreePosition(const QPoint &p)
void setCornerRadius(int r)
void setBackgroundMode(BackgroundMode m)
void setItemColor(const QColor &c)
Qt::Orientation gradientOrientation() const noexcept
Definition legendoverlaystyle.h:184
void gradientEndColorChanged(const QColor &)
void itemOverrideChanged(const QString &layerKey, const QString &classKey)
Fine-grained signal for per-item override edits — lets views (e.g. the dock tree) update just one row...
void setMaxLabelWidth(int px)
Definition legendoverlaystyle.cpp:397
void setGradientOrientation(Qt::Orientation o)
void frameWidthChanged(qreal)
int maxLabelWidth() const noexcept
Definition legendoverlaystyle.h:169
void setSwatchSize(int v)
QFont titleFont
Definition legendoverlaystyle.h:67
bool showTitle
Definition legendoverlaystyle.h:65
QPoint freePosition() const noexcept
Definition legendoverlaystyle.h:172
Qt::Orientation gradientOrientation
Definition legendoverlaystyle.h:94
void setRowSpacing(int v)
Q_INVOKABLE QString displayLabelFor(const QString &propertyName) const
AT-style hook for QPropertyModel — returns human-readable, group-prefixed display labels (e....
Definition legendoverlaystyle.cpp:180
void rowSpacingChanged(int)
void setLayerHeaderFont(const QFont &f)
static QString itemKey(const QObject *layer, const QString &classKey)
Build the override hash key from a layer + classKey. Uses the layer's QObject::objectName (stable acr...
Definition legendoverlaystyle.cpp:76
QColor layerHeaderColor
Definition legendoverlaystyle.h:72
QFont itemFont
Definition legendoverlaystyle.h:69
void explicitHeightChanged(int)
QColor gradientEndColor
Definition legendoverlaystyle.h:93
bool showFrame
Definition legendoverlaystyle.h:85
QColor titleColor
Definition legendoverlaystyle.h:68
void setFrameColor(const QColor &c)
void setExplicitWidth(int px)
Definition legendoverlaystyle.cpp:377
void swatchSizeChanged(int)
void setTitleFont(const QFont &f)
void showFrameChanged(bool)
int explicitHeight
Definition legendoverlaystyle.h:81
void titleChanged(const QString &)
QColor frameColor
Definition legendoverlaystyle.h:86
void anchorChanged(Anchor)
QColor titleColor() const noexcept
Definition legendoverlaystyle.h:155
void setItemFont(const QFont &f)
void itemFontChanged(const QFont &)
int swatchSize
Definition legendoverlaystyle.h:74
QJsonObject toJson() const
Definition legendoverlaystyle.cpp:217
void gradientOrientationChanged(Qt::Orientation)
void setShowFrame(bool on)
QFont layerHeaderFont() const
Definition legendoverlaystyle.h:158
void maxLabelWidthChanged(int)
void setTitle(const QString &text)
void frameColorChanged(const QColor &)
void cornerRadiusChanged(int)
QColor gradientEndColor() const noexcept
Definition legendoverlaystyle.h:183
void freePositionChanged(const QPoint &)
int explicitHeight() const noexcept
Definition legendoverlaystyle.h:168
int rowSpacing
Definition legendoverlaystyle.h:73
void titleColorChanged(const QColor &)
BackgroundMode backgroundMode() const noexcept
Definition legendoverlaystyle.h:181
void clearItemOverrides()
Drop every per-item override.
Definition legendoverlaystyle.cpp:141
void setShowTitle(bool on)
const char * label
Human label for the filter entry.
Definition gdaldrivers.cpp:22
ArrowPlacement p
Definition linesymbollayer.cpp:27
MaskMode m
Definition maskspec.cpp:18
int w
Definition mesh2dresultsexport.cpp:387
int a
Definition meshquadmatch.cpp:46
Definition gisrasterlayer.h:40
QVector< int > v
pool vertex indices
Definition pslgminsize.cpp:159
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
QString text
Definition queryparser.cpp:35
Per-(layer, class) overrides for a legend row's visibility + label. Slice BB Phase 8....
Definition legendoverlaystyle.h:103
QString userLabel
Definition legendoverlaystyle.h:105