#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 |
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.
QgsColorButton::QgsColorButton | ( | QWidget * | parent = 0 |
) |
Definition at line 35 of file qgscolorbutton.cpp.
QgsColorButton::~QgsColorButton | ( | ) |
Definition at line 41 of file qgscolorbutton.cpp.
void QgsColorButton::setColor | ( | const QColor & | color | ) |
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.
QColor QgsColorButton::mColor [private] |