GNU Octave  4.4.1
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) FZI Forschungszentrum Informatik Karlsruhe
7 Copyright (C) 2013-2018 Torsten
8 
9 This file is part of Octave.
10 
11 Octave is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
15 
16 Octave is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20 
21 You should have received a copy of the GNU General Public License
22 along with Octave; see the file COPYING. If not, see
23 <https://www.gnu.org/licenses/>.
24 
25 */
26 
27 // Author: Torsten <ttl@justmail.de>
28 
29 #if ! defined (octave_color_picker_h)
30 #define octave_color_picker_h 1
31 
32 #include <QPushButton>
33 #include <QColorDialog>
34 
35 namespace octave
36 {
37  class color_picker : public QPushButton
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  private slots:
48 
49  void select_color (void);
50 
51  private:
52 
53  virtual void update_button (void);
54 
55  QColor m_color;
56  };
57 }
58 
59 // FIXME: This is temporary and should be removed when all classes that
60 // use the color_picker class are also inside the octave namespace.
62 
63 #endif
QColor color(void) const
Definition: color-picker.h:45
virtual void update_button(void)
Definition: color-picker.cc:60
void select_color(void)
Definition: color-picker.cc:48
color_picker(QColor color=QColor(0, 0, 0), QWidget *parent=nullptr)
Definition: color-picker.cc:37