QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCMapPalette.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtGui/QColor>
5#include <QtQmlIntegration/QtQmlIntegration>
6
29class QGCMapPalette : public QObject
30{
31 Q_OBJECT
32 QML_ELEMENT
33
34 Q_PROPERTY(bool lightColors READ lightColors WRITE setLightColors NOTIFY paletteChanged)
35
36 Q_PROPERTY(QColor text READ text NOTIFY paletteChanged)
37 Q_PROPERTY(QColor textOutline READ textOutline NOTIFY paletteChanged)
38
39public:
40 QGCMapPalette(QObject* parent = nullptr);
41
43 QColor text(void) const { return _text[_lightColors ? 0 : 1]; }
44 QColor textOutline(void) const { return _textOutline[_lightColors ? 0 : 1]; }
45
46 bool lightColors(void) const { return _lightColors; }
47 void setLightColors(bool lightColors);
48
49signals:
50 void paletteChanged(void);
51 void lightColorsChanged(bool lightColors);
52
53private:
54 bool _lightColors = false;
55
56 static const int _cColorGroups = 2;
57
58 static QColor _text[_cColorGroups];
59 static QColor _textOutline[_cColorGroups];
60};
void lightColorsChanged(bool lightColors)
void paletteChanged(void)