Q3Button Class Reference

#include <q3button.h>

Inheritance diagram for Q3Button:

Inheritance graph
[legend]
Collaboration diagram for Q3Button:

Collaboration graph
[legend]
List of all members.

Detailed Description

The Q3Button class is a compatibility base class of button widgets.

{In new code, use QAbstractButton.}

To subclass Q3Button, you must reimplement at least drawButton() (to draw the button's outline) and drawButtonLabel() (to draw its text or pixmap). It is generally advisable to reimplement sizeHint() as well, and sometimes hitButton() (to determine whether a button press is within the button).

Definition at line 33 of file q3button.h.

Public Member Functions

 Q3Button (QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0)
 ~Q3Button ()

Protected Member Functions

virtual void drawButton (QPainter *)
virtual void drawButtonLabel (QPainter *)
void paintEvent (QPaintEvent *)


Constructor & Destructor Documentation

Q3Button::Q3Button ( QWidget parent = 0,
const char *  name = 0,
Qt::WindowFlags  f = 0 
)

Constructs a standard button called name with parent parent, using the widget flags f.

Definition at line 48 of file q3button.cpp.

00049     : QAbstractButton( parent, name, f )
00050 {
00051 }

Q3Button::~Q3Button (  ) 

Destroys the button.

Definition at line 56 of file q3button.cpp.

00057 {
00058 }


Member Function Documentation

void Q3Button::drawButton ( QPainter painter  )  [protected, virtual]

Draws the button on the given painter. The default implementation does nothing.

This virtual function is reimplemented by subclasses to draw real buttons. At some point, these reimplementations should call drawButtonLabel().

See also:
drawButtonLabel(), paintEvent()

Definition at line 88 of file q3button.cpp.

Referenced by paintEvent().

00089 {
00090 }

void Q3Button::drawButtonLabel ( QPainter painter  )  [protected, virtual]

Draws the button text or pixmap on the given painter.

This virtual function is reimplemented by subclasses to draw real buttons. It is invoked by drawButton().

See also:
drawButton(), paintEvent()

Definition at line 103 of file q3button.cpp.

00104 {
00105 }

void Q3Button::paintEvent ( QPaintEvent event  )  [protected, virtual]

Handles paint events, received in event, for buttons. Small and typically complex buttons are painted double-buffered to reduce flicker. The actually drawing is done in the virtual functions drawButton() and drawButtonLabel().

See also:
drawButton(), drawButtonLabel()

Implements QAbstractButton.

Definition at line 70 of file q3button.cpp.

References drawButton(), and p.

00071 {
00072     QPainter p(this);
00073     drawButton( &p );
00074 }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 15:41:32 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1