📄 qtoolbutton.3qt
字号:
'\" t.TH QToolButton 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQToolButton \- Quick-access button to commands or options, usually used inside a QToolBar.SH SYNOPSIS\fC#include <qtoolbutton.h>\fR.PPInherits QButton..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBTextPosition\fR { Right, Under }".br.ti -1c.BI "\fBQToolButton\fR ( QWidget * parent, const char * name = 0 )".br.ti -1c.BI "\fBQToolButton\fR ( const QIconSet & iconSet, const QString & textLabel, const QString & grouptext, QObject * receiver, const char * slot, QToolBar * parent, const char * name = 0 )".br.ti -1c.BI "\fBQToolButton\fR ( ArrowType type, QWidget * parent, const char * name = 0 )".br.ti -1c.BI "\fB~QToolButton\fR ()".br.ti -1c.BI "void setOnIconSet ( const QIconSet & ) \fI(obsolete)\fR".br.ti -1c.BI "void setOffIconSet ( const QIconSet & ) \fI(obsolete)\fR".br.ti -1c.BI "void setIconSet ( const QIconSet & set, bool on ) \fI(obsolete)\fR".br.ti -1c.BI "QIconSet onIconSet () const \fI(obsolete)\fR".br.ti -1c.BI "QIconSet offIconSet () const \fI(obsolete)\fR".br.ti -1c.BI "QIconSet iconSet ( bool on ) const \fI(obsolete)\fR".br.ti -1c.BI "virtual void \fBsetIconSet\fR ( const QIconSet & )".br.ti -1c.BI "QIconSet \fBiconSet\fR () const".br.ti -1c.BI "bool \fBusesBigPixmap\fR () const".br.ti -1c.BI "bool \fBusesTextLabel\fR () const".br.ti -1c.BI "QString \fBtextLabel\fR () const".br.ti -1c.BI "void \fBsetPopup\fR ( QPopupMenu * popup )".br.ti -1c.BI "QPopupMenu * \fBpopup\fR () const".br.ti -1c.BI "void \fBsetPopupDelay\fR ( int delay )".br.ti -1c.BI "int \fBpopupDelay\fR () const".br.ti -1c.BI "void \fBopenPopup\fR ()".br.ti -1c.BI "void \fBsetAutoRaise\fR ( bool enable )".br.ti -1c.BI "bool \fBautoRaise\fR () const".br.ti -1c.BI "TextPosition \fBtextPosition\fR () const".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "virtual void \fBsetUsesBigPixmap\fR ( bool enable )".br.ti -1c.BI "virtual void \fBsetUsesTextLabel\fR ( bool enable )".br.ti -1c.BI "virtual void \fBsetTextLabel\fR ( const QString & newLabel, bool tipToo )".br.ti -1c.BI "virtual void \fBsetToggleButton\fR ( bool enable )".br.ti -1c.BI "virtual void \fBsetOn\fR ( bool enable )".br.ti -1c.BI "void \fBtoggle\fR ()".br.ti -1c.BI "void \fBsetTextLabel\fR ( const QString & )".br.ti -1c.BI "void \fBsetTextPosition\fR ( TextPosition pos )".br.in -1c.SS "Properties".in +1c.ti -1c.BI "bool \fBautoRaise\fR - whether auto-raising is enabled".br.ti -1c.BI "QIconSet \fBiconSet\fR - the icon set providing the icon shown on the button".br.ti -1c.BI "QIconSet offIconSet - the icon set that is used when the button is in an ""off"" state \fI(obsolete)\fR".br.ti -1c.BI "bool \fBon\fR - whether this tool button is on".br.ti -1c.BI "QIconSet onIconSet - the icon set that is used when the button is in an ""on"" state \fI(obsolete)\fR".br.ti -1c.BI "int \fBpopupDelay\fR - the time delay between pressing the button and the appearance of the associated popup menu in milliseconds".br.ti -1c.BI "QString \fBtextLabel\fR - the label of this button".br.ti -1c.BI "TextPosition \fBtextPosition\fR - the position of the text label of this button".br.ti -1c.BI "bool \fBtoggleButton\fR - whether this tool button is a toggle button".br.ti -1c.BI "bool \fBusesBigPixmap\fR - whether this toolbutton uses big pixmaps".br.ti -1c.BI "bool \fBusesTextLabel\fR - whether the toolbutton displays a text label below the button pixmap".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "bool \fBuses3D\fR () const".br.in -1c.SH DESCRIPTIONThe QToolButton class provides a quick-access button to commands or options, usually used inside a QToolBar..PPA tool button is a special button that provides quick-access to specific commands or options. As opposed to a normal command button, a tool button usually doesn't show a text label, but shows an icon instead. Its classic usage is to select tools, for example the "pen" tool in a drawing program. This would be implemented with a QToolButton as toggle button (see setToggleButton() )..PPQToolButton supports auto-raising. In auto-raise mode, the button draws a 3D frame only when the mouse points at it. The feature is automatically turned on when a button is used inside a QToolBar. Change it with setAutoRaise()..PPA tool button's icon is set as QIconSet. This makes it possible to specify different pixmaps for the disabled and active state. The disabled pixmap is used when the button's functionality is not available. The active pixmap is displayed when the button is auto-raised because the mouse pointer is hovering over it..PPThe button's look and dimension is adjustable with setUsesBigPixmap() and setUsesTextLabel(). When used inside a QToolBar in a QMainWindow, the button automatically adjusts to QMainWindow's settings (see QMainWindow::setUsesTextLabel() and QMainWindow::setUsesBigPixmaps())..PPA tool button can offer additional choices in a popup menu. The feature is sometimes used with the "Back" button in a web browser. After pressing and holding the button down for a while, a menu pops up showing a list of possible pages to jump to. With QToolButton you can set a popup menu using setPopup(). The default delay is 600ms; you can adjust it with setPopupDelay()..PP<center>.ce 1.B "[Image Omitted]".PP</center> QToolbar with QToolbuttons.PPSee also QPushButton, QToolBar, QMainWindow, GUI Design Handbook: Push Button, and Basic Widgets..SS "Member Type Documentation".SH "QToolButton::TextPosition"The position of the tool button's text in relation to the tool button's icon..TP\fCQToolButton::Right\fR - The text appears to the right of the icon..TP\fCQToolButton::Under\fR - The text appears below the icon..SH MEMBER FUNCTION DOCUMENTATION.SH "QToolButton::QToolButton ( QWidget * parent, const char * name = 0 )"Constructs an empty tool button called \fIname\fR, with parent \fIparent\fR..SH "QToolButton::QToolButton ( const QIconSet & iconSet, const QString & textLabel, const QString & grouptext, QObject * receiver, const char * slot, QToolBar * parent, const char * name = 0 )"Constructs a tool button called \fIname\fR, that is a child of \fIparent\fR (which must be a QToolBar)..PPThe tool button will display \fIiconSet\fR, with its text label and tool tip set to \fItextLabel\fR and its status bar message set to \fIgrouptext\fR. It will be connected to the \fIslot\fR in object \fIreceiver\fR..SH "QToolButton::QToolButton ( ArrowType type, QWidget * parent, const char * name = 0 )"Constructs a tool button as an arrow button. The ArrowType \fItype\fR defines the arrow direction. Possible values are LeftArrow, RightArrow, UpArrow and DownArrow..PPAn arrow button has auto-repeat turned on by default..PPThe \fIparent\fR and \fIname\fR arguments are sent to the QWidget constructor..SH "QToolButton::~QToolButton ()"Destroys the object and frees any allocated resources..SH "bool QToolButton::autoRaise () const"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -