ColorButton Class Reference

#include <colorbutton.h>

List of all members.


Detailed Description

Provides a button for selecting a color.

This class is an extension of the QPushButton class. It shows the color on the button and presents a QColorDialog when clicked.

Definition at line 33 of file colorbutton.h.

Signals

void resized ()
void newColor (QColor *color)

Public Member Functions

 ColorButton (QWidget *parent=0, const char *name=0)
 ColorButton (const QColor &color, QWidget *parent=0, const char *name=0)
 ~ColorButton ()
 The default destructor.
QColor color () const
 Returns the color of the button.
void setColor (const QColor color)
 Sets the color of the button.

Protected Member Functions

virtual void resizeEvent (QResizeEvent *e)
 Overridden from QPushButton::resizeEvent().

Private Slots

void selectColor ()
 Allows the selection of a new color.
void updatePixmap ()
 Updates the size and color of the pixmap representing the current color.

Private Attributes

QColor fillColor
 the color of the pixmap
QPixmap * pixmap
 the pixmap itself


Constructor & Destructor Documentation

ColorButton::ColorButton QWidget *  parent = 0,
const char *  name = 0
 

Definition at line 44 of file colorbutton.cpp.

ColorButton::ColorButton const QColor &  color,
QWidget *  parent = 0,
const char *  name = 0
 

Definition at line 55 of file colorbutton.cpp.

ColorButton::~ColorButton  ) 
 

The default destructor.

Definition at line 66 of file colorbutton.cpp.


Member Function Documentation

QColor ColorButton::color  )  const
 

Returns the color of the button.

Definition at line 73 of file colorbutton.cpp.

void ColorButton::setColor const QColor  color  ) 
 

Sets the color of the button.

Definition at line 80 of file colorbutton.cpp.

void ColorButton::resized  )  [signal]
 

void ColorButton::newColor QColor *  color  )  [signal]
 

void ColorButton::resizeEvent QResizeEvent *  e  )  [protected, virtual]
 

Overridden from QPushButton::resizeEvent().

Definition at line 93 of file colorbutton.cpp.

void ColorButton::selectColor  )  [private, slot]
 

Allows the selection of a new color.

Definition at line 106 of file colorbutton.cpp.

void ColorButton::updatePixmap  )  [private, slot]
 

Updates the size and color of the pixmap representing the current color.

Definition at line 118 of file colorbutton.cpp.


Member Data Documentation

QColor ColorButton::fillColor [private]
 

the color of the pixmap

Definition at line 57 of file colorbutton.h.

QPixmap* ColorButton::pixmap [private]
 

the pixmap itself

Definition at line 58 of file colorbutton.h.


Generated on Fri May 19 14:31:57 2006 for Brabosphere by  doxygen 1.4.6-NO