Quantum GIS API Documentation  1.8
Public Member Functions | Protected Member Functions | Private Attributes
QgsColorButton Class Reference

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 24 of file qgscolorbutton.h.


Constructor & Destructor Documentation

QgsColorButton::QgsColorButton ( QWidget *  parent = 0)

Definition at line 34 of file qgscolorbutton.cpp.

Definition at line 40 of file qgscolorbutton.cpp.


Member Function Documentation

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

Definition at line 31 of file qgscolorbutton.h.

Referenced by setColor().

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

Paints button in response to a paint event.

Definition at line 46 of file qgscolorbutton.cpp.

References mColor.

void QgsColorButton::setColor ( const QColor &  color)

Definition at line 63 of file qgscolorbutton.cpp.

References color(), and mColor.


Member Data Documentation

QColor QgsColorButton::mColor [private]

Definition at line 37 of file qgscolorbutton.h.

Referenced by paintEvent(), and setColor().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines