Langmuir
Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
colorbutton.h
Go to the documentation of this file.
1 #ifndef COLORBUTTON_H
2 #define COLORBUTTON_H
3 
4 #include <QColorDialog>
5 #include <QPushButton>
6 #include <QColor>
7 #include <QDebug>
8 
9 namespace LangmuirView {
10 
14 class ColorButton : public QPushButton
15 {
16  Q_OBJECT
17 public:
22  explicit ColorButton(QWidget *parent = 0);
23 
28  QColorDialog& colorDialog();
29 
33  ~ColorButton();
34 
35 signals:
40  void selectedColor(QColor color);
41 
42 public slots:
47  void setButtonColor(QColor color);
48 
52  void getColor();
53 
54 protected:
56  static QColorDialog *m_colordialog;
57 
59  QColor m_color;
60 };
61 
62 }
63 
64 #endif // COLORBUTTON_H
QColorDialog & colorDialog()
Get a reference to the dialog.
Definition: axis.h:6
void selectedColor(QColor color)
signal that the color of has changed
void getColor()
open dialog and get user selected color
QColor m_color
current color
Definition: colorbutton.h:59
A class to open color dialogs by clicking.
Definition: colorbutton.h:14
static QColorDialog * m_colordialog
static dialog
Definition: colorbutton.h:56
ColorButton(QWidget *parent=0)
create the ColorButton
~ColorButton()
destroy the ColorButton
void setButtonColor(QColor color)
set the current color