OGS
ColorPickerPushButton.h
Go to the documentation of this file.
1
15#pragma once
16
17// ** INCLUDES **
18#include <QPushButton>
19
20class QColor;
21class QMouseEvent;
22
28class ColorPickerPushButton : public QPushButton
29{
30 Q_OBJECT
31
32public:
33 explicit ColorPickerPushButton(QWidget* parent = nullptr);
34
35public slots:
37 void mouseReleaseEvent(QMouseEvent* e) override;
38
40 void setColor(QColor color);
41 void setColor(double* color);
42
43private:
44 QString colorToCss(QColor color);
45 QString colorToString(QColor color);
46
47 QColor _color;
48
49signals:
51 void colorPicked(QColor);
52};
void mouseReleaseEvent(QMouseEvent *e) override
Calls the QColorDialog.
void colorPicked(QColor)
Is emitted when a color was picked from the dialog.
ColorPickerPushButton(QWidget *parent=nullptr)
void setColor(QColor color)
Sets the color.
QString colorToString(QColor color)
QString colorToCss(QColor color)