QCodeEdit  2.2
lib/widgets/qsimplecolorpicker.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
00004 **
00005 ** This file is part of the Edyuk project <http://edyuk.org>
00006 ** 
00007 ** This file may be used under the terms of the GNU General Public License
00008 ** version 3 as published by the Free Software Foundation and appearing in the
00009 ** file GPL.txt included in the packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ****************************************************************************/
00015 
00016 #ifndef _QSIMPLE_COLOR_PICKER_H_
00017 #define _QSIMPLE_COLOR_PICKER_H_
00018 
00019 #include "qce-config.h"
00020 
00026 #include <QToolButton>
00027 
00028 class QCE_EXPORT QSimpleColorPicker : public QToolButton
00029 {
00030     Q_OBJECT
00031     
00032     Q_PROPERTY(QColor color READ color WRITE setColor)
00033     
00034     public:
00035         QSimpleColorPicker(QWidget *w = 0);
00036         QSimpleColorPicker(const QColor& c, QWidget *w = 0);
00037         
00038         const QColor& color() const;
00039         
00040     protected:
00041         void resizeEvent(QResizeEvent *e);
00042         void contextMenuEvent(QContextMenuEvent *e);
00043         
00044     public slots:
00045         void setColor(const QColor& c);
00046         
00047         void updateIcon(const QSize& sz);
00048         
00049     private slots:
00050         void clicked();
00051         
00052     private:
00053         QColor m_color;
00054 };
00055 
00056 #endif