FlightGear next
TipBackgroundBox.hxx
Go to the documentation of this file.
1#pragma once
2
3#include <QQuickPaintedItem>
4#include <QColor>
5
7
8class TipBackgroundBox : public QQuickPaintedItem
9{
10 Q_OBJECT
11
13
14 Q_PROPERTY(QColor fill READ fill WRITE setFill NOTIFY fillChanged)
15 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
16 Q_PROPERTY(int borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged)
17
18public:
19 TipBackgroundBox(QQuickItem* parent = nullptr);
20
21 GettingStartedTip::Arrow arrowPosition() const;
22
23 QColor borderColor() const;
24
25 int borderWidth() const;
26
27 QColor fill() const;
28
29 static int arrowSideOffset();
30
31 static int arrowHeight();
32
33public slots:
35
36 void setBorderColor(QColor borderColor);
37
39
40 void setFill(QColor fill);
41
42signals:
44
46
48
49 void fillChanged(QColor fill);
50
51protected:
52 void paint(QPainter* painter) override;
53
54private:
55 GettingStartedTip::Arrow _arrow = GettingStartedTip::Arrow::TopCenter;
56
57 QColor _borderColor;
58 int _borderWidth = -1; // off
59 QColor _fill;
60};
61
void setBorderWidth(int borderWidth)
void setFill(QColor fill)
TipBackgroundBox(QQuickItem *parent=nullptr)
GettingStartedTip::Arrow arrowPosition() const
void fillChanged(QColor fill)
void setArrowPosition(GettingStartedTip::Arrow arrow)
void borderWidthChanged(int borderWidth)
static int arrowSideOffset()
void setBorderColor(QColor borderColor)
void borderColorChanged(QColor borderColor)
void arrowPositionChanged(GettingStartedTip::Arrow arrow)
GettingStartedTip::Arrow arrow
void paint(QPainter *painter) override