Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

QButton Class Reference

The QButton class is a compatibility base class of button widgets More...

#include <QButton>

This class is part of the Qt 3 compatibility library. It is provided to keep old source code working. We strongly advise against using it in new code.

Inherits QAbstractButton.

Writable Properties

Read-Only Properties

Public Functions

Public Slots

Signals

Static Public Members

Protected Functions


Detailed Description

The QButton class is a compatibility base class of button widgets

In new code, use QAbstractButton.

To subclass QButton, 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).


Member Function Documentation

QButton::QButton ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 )

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

QButton::~QButton ()

Destroys the button.

void QButton::drawButton ( QPainter * painter )   [virtual protected]

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() and paintEvent().

void QButton::drawButtonLabel ( QPainter * painter )   [virtual protected]

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() and paintEvent().

void QButton::paintEvent ( QPaintEvent * event )   [virtual protected]

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().

Reimplemented from QWidget.

See also drawButton() and drawButtonLabel().


Copyright © 2004 Trolltech. Trademarks
Qt 4.0.0-tp2