OGS
ColorPickerPushButton.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2
// SPDX-License-Identifier: BSD-3-Clause
3
4
#pragma once
5
6
// ** INCLUDES **
7
#include <QPushButton>
8
9
class
QColor;
10
class
QMouseEvent;
11
17
class
ColorPickerPushButton
:
public
QPushButton
18
{
19
Q_OBJECT
20
21
public
:
22
explicit
ColorPickerPushButton
(QWidget* parent =
nullptr
);
23
24
public
slots:
26
void
mouseReleaseEvent
(QMouseEvent* e)
override
;
27
29
void
setColor
(QColor color);
30
void
setColor
(
double
* color);
31
32
private
:
33
QString
colorToCss
(QColor color);
34
QString
colorToString
(QColor color);
35
36
QColor
_color
;
37
38
signals:
40
void
colorPicked
(QColor);
41
};
ColorPickerPushButton::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *e) override
Calls the QColorDialog.
Definition
ColorPickerPushButton.cpp:16
ColorPickerPushButton::colorPicked
void colorPicked(QColor)
Is emitted when a color was picked from the dialog.
ColorPickerPushButton::ColorPickerPushButton
ColorPickerPushButton(QWidget *parent=nullptr)
Definition
ColorPickerPushButton.cpp:9
ColorPickerPushButton::setColor
void setColor(QColor color)
Sets the color.
Definition
ColorPickerPushButton.cpp:51
ColorPickerPushButton::_color
QColor _color
Definition
ColorPickerPushButton.h:36
ColorPickerPushButton::colorToString
QString colorToString(QColor color)
Definition
ColorPickerPushButton.cpp:38
ColorPickerPushButton::colorToCss
QString colorToCss(QColor color)
Definition
ColorPickerPushButton.cpp:30
Applications
DataExplorer
Base
ColorPickerPushButton.h
Generated by
1.14.0