qwwcolorbutton.h

00001 //
00002 // C++ Interface: qcolorbutton
00003 //
00004 // Description:
00005 //
00006 //
00007 // Author: Witold Wysota <wysota@wysota.eu.org>, (C) 2007
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 #ifndef QWWCOLORBUTTON_H
00013 #define QWWCOLORBUTTON_H
00014 
00015 #ifndef WW_NO_COLORBUTTON
00016 
00017 #include <QPushButton>
00018 #include <QModelIndex>
00019 #include <wwglobal.h>
00020 
00021 
00022 class QwwColorButtonPrivate;
00023 class Q_WW_EXPORT QwwColorButton : public QPushButton, public QwwPrivatable {
00024     Q_OBJECT
00025     Q_PROPERTY(QList<QColor> colors READ colors WRITE setColors)
00026     Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor)
00027 public:
00028     QwwColorButton(QWidget *parent = 0);
00029     QColor currentColor() const;
00030     void addColor(const QColor &c, const QString &n = QString::null);
00031     void setStandardColors();
00032     void clear();
00033     ~QwwColorButton();
00034     QList<QColor> colors() const;
00035     void setColors(const QList<QColor> &);
00036 public slots:
00037     void setCurrentColor(const QColor &c);
00038 signals:
00039     void colorPicked(QColor);
00040 private:
00041     WW_DECLARE_PRIVATE(QwwColorButton);
00042 private slots:
00043     void _q_clicked();
00044     void _q_activated(const QModelIndex &);
00045     void _q_colorDialogRequested();
00046     void _q_setCurrentIndex(const QModelIndex &);
00047 };
00048 
00049 #endif // WW_NO_COLORBUTTON
00050 
00051 #endif // QWWCOLORBUTTON_H

Generated on Sat Apr 21 21:54:35 2007 for wwWidgets by  doxygen 1.5.1