The Q3Button class is a compatibility base class of button widgets 更多...
| 頭: | #include <Q3Button> |
| 繼承: | QAbstractButton |
| Q3Button (QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = 0) | |
| ~Q3Button () |
| virtual void | drawButton (QPainter * painter ) |
| virtual void | drawButtonLabel (QPainter * painter ) |
| virtual void | paintEvent (QPaintEvent * event ) |
The Q3Button class is a compatibility base class of button widgets
In new code, use QAbstractButton .
要子類化 Q3Button ,必須至少重實現 drawButton () (to draw the button's outline) and drawButtonLabel () (to draw its text or pixmap). It is generally advisable to reimplement sizeHint (),且有時是 hitButton () (to determine whether a button press is within the button).
Constructs a standard button called name 采用父級 parent , using the widget flags f .
銷毀按鈕。
[virtual protected]
void
Q3Button::
drawButton
(
QPainter
*
painter
)
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 ().
另請參閱 drawButtonLabel () 和 paintEvent ().
[virtual protected]
void
Q3Button::
drawButtonLabel
(
QPainter
*
painter
)
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 ().
另請參閱 drawButton () 和 paintEvent ().
[virtual protected]
void
Q3Button::
paintEvent
(
QPaintEvent
*
event
)
重實現自 QWidget::paintEvent ().
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 () 和 drawButtonLabel ().
另請參閱 drawButton () 和 drawButtonLabel ().