Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
clickable_color_preview.h
Go to the documentation of this file.
1#ifndef CLICKABLE_COLOR_PREVIEW_H
2#define CLICKABLE_COLOR_PREVIEW_H
3
4#include <QWidget>
5
14class ClickableColorPreview final : public QWidget {
15 Q_OBJECT
16
17public:
23 explicit ClickableColorPreview(QWidget *parent = nullptr);
24
25public slots:
32 void SetColor(const QColor &color);
33
34signals:
38 void clicked();
39
40protected:
46 void mousePressEvent(QMouseEvent *event) override;
47
54 void paintEvent(QPaintEvent *event) override;
55};
56
57#endif //CLICKABLE_COLOR_PREVIEW_H
void SetColor(const QColor &color)
Sets the background color to be displayed by the preview widget. Updates the widget's palette and tri...
Definition clickable_color_preview.cpp:12
ClickableColorPreview(QWidget *parent=nullptr)
Constructs a ClickableColorPreview widget. Sets a fixed size, enables the pointing hand cursor,...
Definition clickable_color_preview.cpp:6
void paintEvent(QPaintEvent *event) override
Overridden paint event handler. Draws the widget's appearance. Fills the background with the color se...
Definition clickable_color_preview.cpp:31
void clicked()
Emitted when the widget is clicked with the left mouse button.
void mousePressEvent(QMouseEvent *event) override
Overridden mouse press event handler. Emits the clicked() signal if the left mouse button is pressed.
Definition clickable_color_preview.cpp:24