OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
coloreditor.hpp
Go to the documentation of this file.
1 #ifndef CSV_WIDGET_COLOREDITOR_HPP
2 #define CSV_WIDGET_COLOREDITOR_HPP
3 
4 #include <QPushButton>
5 
6 class QColor;
7 class QPoint;
8 class QSize;
9 
10 namespace CSVWidget
11 {
12  class ColorPickerPopup;
13 
14  class ColorEditor : public QPushButton
15  {
16  Q_OBJECT
17 
18  QColor mColor;
21 
22  QPoint calculatePopupPosition();
23 
24  public:
25  ColorEditor(const QColor &color, QWidget *parent = 0, bool popupOnStart = false);
26 
27  QColor color() const;
28  void setColor(const QColor &color);
29 
30  protected:
31  virtual void paintEvent(QPaintEvent *event);
32  virtual void showEvent(QShowEvent *event);
33 
34  private slots:
35  void showPicker();
36  void pickerHid();
37  void pickerColorChanged(const QColor &color);
38 
39  signals:
40  void pickingFinished();
41  };
42 }
43 
44 #endif
ColorEditor(const QColor &color, QWidget *parent=0, bool popupOnStart=false)
Definition: coloreditor.cpp:13
static const struct @2 signals[]
QColor mColor
Definition: coloreditor.hpp:18
virtual void paintEvent(QPaintEvent *event)
Definition: coloreditor.cpp:25
bool mPopupOnStart
Definition: coloreditor.hpp:20
QPoint calculatePopupPosition()
Definition: coloreditor.cpp:86
ColorPickerPopup * mColorPicker
Definition: coloreditor.hpp:19
Definition: colorpickerpopup.hpp:10
void pickerHid()
Definition: coloreditor.cpp:74
Definition: coloreditor.hpp:14
virtual void showEvent(QShowEvent *event)
Definition: coloreditor.cpp:40
void pickerColorChanged(const QColor &color)
Definition: coloreditor.cpp:80
QColor color() const
Definition: coloreditor.cpp:51
void setColor(const QColor &color)
Definition: coloreditor.cpp:56
void showPicker()
Definition: coloreditor.cpp:62