00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef QWWCOLORCOMBOBOX_H
00013 #define QWWCOLORCOMBOBOX_H
00014
00015 #ifndef WW_NO_COLORCOMBOBOX
00016
00017 #include <QComboBox>
00018 #include <QModelIndex>
00019 #include <wwglobal.h>
00020
00026 class Q_WW_EXPORT QwwColorComboBox : public QComboBox {
00027 Q_OBJECT
00028 Q_PROPERTY(bool colorDialogEnabled READ isColorDialogEnabled WRITE setColorDialogEnabled)
00029 public:
00030 QwwColorComboBox(QWidget *parent = 0);
00031 ~QwwColorComboBox();
00032 void addColor ( const QColor & color, const QString & name );
00033 QColor color ( int index ) const;
00034 int colorCount () const;
00035 QColor currentColor () const;
00036 void insertColor ( int index, const QColor & color, const QString & name );
00037 bool isColorDialogEnabled () const;
00038 void setColorDialogEnabled ( bool enabled = true );
00039
00040 void setStandardColors ();
00041 void showPopup();
00042 public slots:
00043 void setCurrentColor ( const QColor & color );
00044 signals:
00045 void activated(const QColor &);
00046 void currentIndexChanged(const QColor &);
00047 void highlighted(const QColor &);
00048 void debug(const QString &);
00049 protected:
00050 bool eventFilter(QObject *o, QEvent *e);
00051 private:
00052 bool m_dlgEnabled;
00053 private slots:
00054 void _q_highlighted(int);
00055 void w_q_activated(int);
00056 void _q_currentIndexChanged(int);
00057 void _q_popup(const QModelIndex &);
00058
00059 void popupDialog();
00060 };
00061
00062 #endif
00063 #endif