Quantum GIS API Documentation  1.7.4
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 /* $Id: qgscolorbutton.h 6251 2006-12-13 23:23:50Z telwertowski $ */
00016 #ifndef QGSCOLORBUTTON_H
00017 #define QGSCOLORBUTTON_H
00018 
00019 #include <QToolButton>
00020 #include <QPushButton>
00021 
00025 class GUI_EXPORT QgsColorButton: public QToolButton
00026 {
00027   public:
00028     QgsColorButton( QWidget *parent = 0 );
00029     ~QgsColorButton();
00030 
00031     void setColor( const QColor &color );
00032     QColor color() const { return mColor; }
00033 
00034   protected:
00035     void paintEvent( QPaintEvent *e );
00036 
00037   private:
00038     QColor mColor;
00039 };
00040 
00041 
00042 class GUI_EXPORT QgsColorButtonV2 : public QPushButton
00043 {
00044   public:
00045     QgsColorButtonV2( QWidget* parent = 0 );
00046     QgsColorButtonV2( QString text, QWidget* parent = 0 );
00047 
00048     void setColor( const QColor &color );
00049     QColor color() const { return mColor; }
00050 
00051   private:
00052     QColor mColor;
00053 };
00054 
00055 
00056 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines