Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
QgsColorButton Class Reference

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

#include <qgscolorbutton.h>

Inheritance diagram for QgsColorButton:
Inheritance graph
[legend]
Collaboration diagram for QgsColorButton:
Collaboration graph
[legend]

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

QColor QgsColorButton::color ( void  ) const
inline

Definition at line 32 of file qgscolorbutton.h.

Referenced by setColor().

void QgsColorButton::paintEvent ( QPaintEvent *  e)
protected

Paints button in response to a paint event.

Definition at line 47 of file qgscolorbutton.cpp.

References mColor.

void QgsColorButton::setColor ( const QColor &  color)

Definition at line 64 of file qgscolorbutton.cpp.

References color(), and 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: