Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

QwtPushButton Class Reference

Inheritance diagram for QwtPushButton:

QwtLegendButton List of all members.

Detailed Description

A push button that allows alignment of button labels, and use of rich texts, as provided by QLabel.


Public Member Functions

 QwtPushButton (QWidget *=NULL, const char *name=NULL)
 QwtPushButton (const QString &text, QWidget *=NULL, const char *name=NULL)
 QwtPushButton (const QIconSet &, const QString &, QWidget *=NULL, const char *name=NULL)
TextFormat textFormat () const
void setTextFormat (TextFormat)
virtual Qt::TextFormat usedTextFormat () const
int alignment () const
virtual void setAlignment (int alignment)
void setIndent (int)
int indent () const
virtual QSize sizeHint () const
virtual int heightForWidth (int) const

Protected Member Functions

virtual void drawButtonLabel (QPainter *)


Constructor & Destructor Documentation

QwtPushButton::QwtPushButton QWidget *  parent = NULL,
const char *  name = NULL
 

Constructs a push button with no text.

QwtPushButton::QwtPushButton const QString &  text,
QWidget *  parent = NULL,
const char *  name = NULL
 

Constructs a push button called name with the parent parent and the text text.

QwtPushButton::QwtPushButton const QIconSet &  iconSet,
const QString &  text,
QWidget *  parent = NULL,
const char *  name = NULL
 

Constructs a push button with an icon and a text.


Member Function Documentation

int QwtPushButton::alignment  )  const
 

Returns:
Alignment of the button label's contents.
See also:
QwtPushButton::setAlignment

void QwtPushButton::drawButtonLabel QPainter *   )  [protected, virtual]
 

Draws the button text or pixmap.

int QwtPushButton::heightForWidth int  width  )  const [virtual]
 

Find the preferred height, given the width w.

Parameters:
width Width
Returns:
preferred height

int QwtPushButton::indent  )  const
 

Returns:
Indent of the button label's contents.
See also:
QwtPushButton::setIndent

void QwtPushButton::setAlignment int  alignment  )  [virtual]
 

Sets the alignment of the button labelīs contents.

The default format is Qt::AlignCenter | Qt::ExpandTabs | Qt::WordBreak.

Parameters:
alignment Bitwise OR of Qt::AlignmentFlags and Qt::TextFlags values.
See also:
QwtPushButton::alignment()

void QwtPushButton::setIndent int  indent  ) 
 

Sets the button label's contents indent in pixels.

The default value is 4 pixels.

Parameters:
indent Indent
See also:
QwtPushButton::indent()

void QwtPushButton::setTextFormat TextFormat  textFormat  ) 
 

Sets the button label's text format. The default format is AutoText.

Parameters:
textFormat Text format for the button label text
See also:
QwtPushButton::textFormat()

QSize QwtPushButton::sizeHint  )  const [virtual]
 

Return sizeHint.

Qt::TextFormat QwtPushButton::textFormat  )  const
 

Returns:
The button label's text format
See also:
QwtPushButton::setTextFormat

Qt::TextFormat QwtPushButton::usedTextFormat  )  const [virtual]
 

Find the text format that is used for painting the button label.

In case of Qt::AutoText the format is found by evaluating text(), otherwise it is textFormat()

Returns:
Text format that is used for painting
See also:
textFormat(), setTextFormat(), QStyleSheet::mightBeRichText()


Generated on Tue Nov 25 21:15:08 2003 for Qwt User's Guide by doxygen 1.3.4