OpenHantek
colorbox.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include <QColor>
6 #include <QPushButton>
7 
9 class ColorBox : public QPushButton {
10  Q_OBJECT
11 
12  public:
13  ColorBox(QColor color, QWidget *parent = nullptr);
14  ~ColorBox();
15 
16  const QColor getColor();
17 
18  public slots:
19  void setColor(QColor color);
20  void waitForColor();
21 
22  private:
23  QColor color;
24 
25  signals:
26  void colorChanged(QColor color);
27 };
void setColor(QColor color)
Sets the color.
Definition: colorbox.cpp:49
const QColor getColor()
Get the current color.
Definition: colorbox.cpp:45
void waitForColor()
Wait for the color dialog and apply chosen color.
Definition: colorbox.cpp:57
~ColorBox()
Cleans up the widget.
Definition: colorbox.cpp:41
void colorChanged(QColor color)
The color has been changed.
ColorBox(QColor color, QWidget *parent=nullptr)
Initializes the widget.
Definition: colorbox.cpp:35
A widget for the selection of a color.
Definition: colorbox.h:9
QColor color
Definition: colorbox.h:23