Quantum GIS API Documentation  1.8
src/gui/qgscolorbutton.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     qgscolorbutton.h - Color button
00003      --------------------------------------
00004     Date                 : 12-Dec-2006
00005     Copyright            : (C) 2006 by Tom Elwertowski
00006     Email                : telwertowski at users dot sourceforge dot net
00007  ***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 #ifndef QGSCOLORBUTTON_H
00016 #define QGSCOLORBUTTON_H
00017 
00018 #include <QToolButton>
00019 #include <QPushButton>
00020 
00024 class GUI_EXPORT QgsColorButton: public QToolButton
00025 {
00026   public:
00027     QgsColorButton( QWidget *parent = 0 );
00028     ~QgsColorButton();
00029 
00030     void setColor( const QColor &color );
00031     QColor color() const { return mColor; }
00032 
00033   protected:
00034     void paintEvent( QPaintEvent *e );
00035 
00036   private:
00037     QColor mColor;
00038 };
00039 
00040 
00041 class GUI_EXPORT QgsColorButtonV2 : public QPushButton
00042 {
00043   public:
00044     QgsColorButtonV2( QWidget* parent = 0 );
00045     QgsColorButtonV2( QString text, QWidget* parent = 0 );
00046 
00047     void setColor( const QColor &color );
00048     QColor color() const { return mColor; }
00049 
00050   private:
00051     QColor mColor;
00052 };
00053 
00054 
00055 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines