OpenHantek
Loading...
Searching...
No Matches
colorbox.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3#pragma once
4
5#include <QColor>
6#include <QPushButton>
7
9class ColorBox : public QPushButton {
10 Q_OBJECT
11
12 public:
13 ColorBox( QColor color, QWidget *parent = nullptr );
14 ~ColorBox() override;
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 colorChanged(QColor color)
The color has been changed.
ColorBox(QColor color, QWidget *parent=nullptr)
Initializes the widget.
Definition colorbox.cpp:35
const QColor getColor()
Get the current color.
Definition colorbox.cpp:45
~ColorBox() override
Cleans up the widget.
Definition colorbox.cpp:41
void waitForColor()
Wait for the color dialog and apply chosen color.
Definition colorbox.cpp:57
void setColor(QColor color)
Sets the color.
Definition colorbox.cpp:49
QColor color
Definition colorbox.h:23