GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
color-picker.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// This class provides a simple color picker based on tQColorButton
4// by Harald Jedele, 23.03.01, GPL version 2 or any later version.
5//
6// Copyright (C) 2013-2022 The Octave Project Developers
7//
8// See the file COPYRIGHT.md in the top-level directory of this
9// distribution or <https://octave.org/copyright/>.
10//
11// This file is part of Octave.
12//
13// Octave is free software: you can redistribute it and/or modify it
14// under the terms of the GNU General Public License as published by
15// the Free Software Foundation, either version 3 of the License, or
16// (at your option) any later version.
17//
18// Octave is distributed in the hope that it will be useful, but
19// WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with Octave; see the file COPYING. If not, see
25// <https://www.gnu.org/licenses/>.
26//
27////////////////////////////////////////////////////////////////////////
28
29#if ! defined (octave_color_picker_h)
30#define octave_color_picker_h 1
31
32#include <QColorDialog>
33#include <QPushButton>
34
35namespace octave
36{
38 {
39 Q_OBJECT
40
41 public:
42
43 color_picker (QColor color = QColor (0, 0, 0), QWidget *parent = nullptr);
44
45 QColor color (void) const { return m_color; }
46
47 void set_color (QColor new_color);
48
49 private slots:
50
51 void select_color (void);
52
53 private:
54
55 virtual void update_button (void);
56
57 QColor m_color;
58 };
59}
60
61#endif
virtual void update_button(void)
Definition: color-picker.cc:68
void set_color(QColor new_color)
Definition: color-picker.cc:61
QColor color(void) const
Definition: color-picker.h:45
void select_color(void)
Definition: color-picker.cc:49
color_picker(QColor color=QColor(0, 0, 0), QWidget *parent=nullptr)
Definition: color-picker.cc:38