Quantum GIS API Documentation
1.8
|
A cross platform button subclass for selecting colors. More...
#include <qgscolorbutton.h>
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 |
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.
QgsColorButton::QgsColorButton | ( | QWidget * | parent = 0 | ) |
Definition at line 34 of file qgscolorbutton.cpp.
Definition at line 40 of file qgscolorbutton.cpp.
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.
QColor QgsColorButton::mColor [private] |
Definition at line 37 of file qgscolorbutton.h.
Referenced by paintEvent(), and setColor().