QPushButton Class Reference


The QPushButton widget provides a push button with a text label. (details) (complete member list)

#include <qpushbt.h>

Inherits QButton.

Inherited by QIconButton.

Public Members

Protected Members


Detailed Description

The QPushButton widget provides a push button with a text label.

A default push button in a dialog emits the clicked signal if the user presses the Enter key.


Member Function Documentation

QPushButton::QPushButton (QWidget *parent=0, const char *name=0)

Constructs a push button with no text.

The parent and name arguments are sent to the QWidget constructor.

QPushButton::QPushButton (const char *text, QWidget *parent=0, const char *name=0)

Constructs a push button with a text.

The parent and name arguments are sent to the QWidget constructor.

void QPushButton::adjustSize ()

Adjusts the size of the push button to fit the contents.

This function is called automatically whenever the contents change and auto-resizing is enabled.

See also: setAutoResizing(). Reimplemented in QIconButton.

bool QPushButton::autoDefault () const

Returns TRUE if the button is an auto-default button.

See also: setAutoDefault().

void QPushButton::drawButton (QPainter *paint)

Draws the button, but not the button face.

See also: drawButtonFace().

void QPushButton::drawButtonFace (QPainter *paint)

Draws the button face. The default implementation draws the button text.

This virtual function can be reimplemented by subclasses. Reimplemented in QIconButton.

bool QPushButton::isDefault () const

Returns TRUE if the button is default.

See also: setDefault().

void QPushButton::setAutoDefault (bool enable)

Sets the push buttons to an auto-default button if enable is TRUE, or to a normal button if enable is FALSE.

An auto-default button becomes the default push button automatically when it receives the keyboard input focus.

See also: autoDefault() and setDefault().

void QPushButton::setDefault (bool enable)

Sets the button to be the default button if enable is TRUE, or to be a normal button if enable is FALSE.

A default push button in a dialog (QDialog) emits the QButton::clicked() signal if the user presses the Enter key. Only one push button in the dialog can be default.

Default push buttons are only allowed in dialogs.

See also: default() and setAutoDefault().


This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.

It was generated from the following files:


Generated at 16:17, 1995/06/30 by the webmaster at Troll Tech