AvogadroLibs 1.98.1
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ColorButton Class Reference

A button to show the current color and bring up the QColorDialog. More...

#include <avogadro/colorbutton.h>

Inheritance diagram for ColorButton:

Public Slots

void changeColor ()
 

Signals

void colorChanged (const QColor &)
 

Public Member Functions

 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
 

Protected Member Functions

bool event (QEvent *e)
 

Protected Attributes

QColor m_color
 The current color.
 
QString m_title
 The current dialog title.
 

Detailed Description

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.

Member Function Documentation

◆ paintEvent()

void paintEvent ( QPaintEvent *  )

Redraw the widget (i.e., refresh the colored rectangle)

◆ setColor()

void setColor ( const QColor &  color)
Parameters
colorthe new color to be used

◆ setDialogTitle()

void setDialogTitle ( const QString  title = "")
Parameters
customtitle for color choice dialog

◆ color()

QColor color ( ) const
Returns
the current color

◆ colorChanged

void colorChanged ( const QColor &  )
signal

emit any time the color is changed, either by a user or by setColor()

◆ changeColor

void changeColor ( )
slot

Call for a change in the current color

◆ event()

bool event ( QEvent *  e)
protected

Generic event handler, currently defaults to calling parent class (included for future compatibility)


The documentation for this class was generated from the following file: