24#include <QtQuick/QQuickPaintedItem>
41 QML_NAMED_ELEMENT(Scale)
60 [[nodiscard]] QColor
color()
const {
return m_color;}
75 [[nodiscard]]
auto pixelPer10km() const -> qreal {
return m_pixelPer10km;}
87 void paint(QPainter* painter)
override;
99 [[nodiscard]]
auto vertical() const ->
bool {
return m_vertical;}
120 qreal m_pixelPer10km {0.0};
121 bool m_vertical {
false};
122 QColor m_color {Qt::black};
void setPixelPer10km(qreal _pxp10k)
Setter function for the property with the same name.
qreal pixelPer10km
Number of pixel that represent a distance of 10km on the map.
void setColor(QColor _color)
Setter function for the property with the same name.
void verticalChanged()
Notification signal for property with the same name.
void setVertical(bool newVertical)
Setter function for the property with the same name.
auto vertical() const -> bool
Getter function for the property with the same name.
void colorChanged()
Notification signal for property with the same name.
QColor color
Foreground color.
void paint(QPainter *painter) override
Re-implemented from QQuickPaintedItem to implement painting.
bool vertical
Determines whether the scale should be drawn vertically or horizontally.
void pixelPer10kmChanged()
Notification signal for property with the same name.
auto pixelPer10km() const -> qreal
Getter function for the property with the same name.
QColor color() const
Getter function for the property with the same name.
ScaleQuickItem(QQuickItem *parent=nullptr)
Standard constructor.