QgsColorButton Class Reference
[QGIS gui library.]

A cross platform button subclass for selecting colors. More...

#include <qgscolorbutton.h>

List of all members.

Public Member Functions

 QgsColorButton (QWidget *parent=0)
 ~QgsColorButton ()
void setColor (const QColor &color)
QColor color () const

Protected Member Functions

void paintEvent (QPaintEvent *e)

Private Attributes

QColor mColor

Detailed Description

A cross platform button subclass for selecting colors.

The QgsColorButton class provides a tool button widget displaying a color which can be altered by calling QColorDialog::getColor.

A subclass of QToolButton is needed to draw the button content because some platforms such as Mac OS X and Windows XP enforce a consistent GUI look by always using the button color of the current style and not allowing button backgrounds to be changed on a button by button basis.

This class is a simplified version of QtColorButton, an internal class used by Qt Designer to do the same thing.

Definition at line 25 of file qgscolorbutton.h.

Constructor & Destructor Documentation

QgsColorButton::QgsColorButton ( QWidget *  parent = 0  ) 

Definition at line 35 of file qgscolorbutton.cpp.

QgsColorButton::~QgsColorButton (  ) 

Definition at line 41 of file qgscolorbutton.cpp.

Member Function Documentation

void QgsColorButton::setColor ( const QColor &  color  ) 

Definition at line 64 of file qgscolorbutton.cpp.

References mColor.

QColor QgsColorButton::color ( void   )  const [inline]

Definition at line 32 of file qgscolorbutton.h.

void QgsColorButton::paintEvent ( QPaintEvent *  e  )  [protected]

Paints button in response to a paint event.

Definition at line 47 of file qgscolorbutton.cpp.

References mColor.

Member Data Documentation

QColor QgsColorButton::mColor [private]

Definition at line 38 of file qgscolorbutton.h.

Referenced by paintEvent(), and setColor().

The documentation for this class was generated from the following files:

Generated on Sat Feb 4 19:17:24 2012 for Quantum GIS API Documentation by  doxygen 1.5.6