A button to show the current color and bring up the QColorDialog.
More...
#include <avogadro/colorbutton.h>
|
| ColorButton (QWidget *parent=0) |
| ColorButton (const QColor &initial, QWidget *parent=0) |
void | paintEvent (QPaintEvent *) |
void | setColor (const QColor &color) |
void | setDialogTitle (const QString title="") |
QColor | color () const |
|
QColor | m_color |
| The current color.
|
QString | m_title |
| The current dialog title.
|
- Author
- Geoffrey Hutchison
This class implements a QAbstractButton to display a colored rectangle. When clicked by the user, it brings up a color picker to select a new color.
The widget has a default minimum size of 35x20 pixels.
◆ paintEvent()
void paintEvent |
( |
QPaintEvent * | | ) |
|
Redraw the widget (i.e., refresh the colored rectangle)
◆ setColor()
void setColor |
( |
const QColor & | color | ) |
|
- Parameters
-
color | the new color to be used |
◆ setDialogTitle()
void setDialogTitle |
( |
const QString | title = "" | ) |
|
- Parameters
-
custom | title for color choice dialog |
◆ color()
◆ colorChanged
void colorChanged |
( |
const QColor & | | ) |
|
|
signal |
emit any time the color is changed, either by a user or by setColor()
◆ changeColor
Call for a change in the current color
◆ event()
Generic event handler, currently defaults to calling parent class (included for future compatibility)
The documentation for this class was generated from the following file: