Seamly2D
Code documentation
color_combobox.h
Go to the documentation of this file.
1 /******************************************************************************
2  * color_combobox.h *
3  *****************************************************************************/
4 
5 #ifndef COLOR_COMBOBOX_H
6 #define COLOR_COMBOBOX_H
7 
8 #include <QComboBox>
9 #include <QString>
10 #include <QWidget>
11 #include <memory>
12 
13 /**
14  * A comboBox for choosing a color.
15  */
16 class ColorComboBox: public QComboBox
17 {
18  Q_OBJECT
19 
20 public:
21  ColorComboBox(QWidget *parent = nullptr , const char *name = nullptr );
22  ColorComboBox(int width, int height, QWidget *parent = nullptr , const char *name = nullptr );
23  virtual ~ColorComboBox();
24 
25  QString getColor() const;
26  void setColor(const QString &color);
28  int getIconWidth();
29  int getIconHeight();
30 
31 private slots:
32  void colorChanged(int index);
33 
34 signals:
35  void colorChangedSignal(const QString &color);
36 
37 private:
38  void init();
39  QString m_currentColor;
42 };
43 
44 #endif
void setColor(const QString &color)
void colorChangedSignal(const QString &color)
virtual ~ColorComboBox()
void colorChanged(int index)
ColorComboBox(QWidget *parent=nullptr, const char *name=nullptr)
QString getColor() const
void setItems(QMap< QString, QString > map)
QString m_currentColor