Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The TQToolButton class provides a tquick-access button to commands or options, usually used inside a TQToolBar. More...
#include <qtoolbutton.h>
Inherits TQButton.
A tool button is a special button that provides tquick-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 TQToolButton as toggle button (see setToggleButton() ).
TQToolButton 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 TQToolBar. Change it with setAutoRaise().
A tool button's icon is set as TQIconSet. 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.
The button's look and dimension is adjustable with setUsesBigPixmap() and setUsesTextLabel(). When used inside a TQToolBar in a TQMainWindow, the button automatically adjusts to TQMainWindow's settings (see TQMainWindow::setUsesTextLabel() and TQMainWindow::setUsesBigPixmaps()). The pixmap set on a TQToolButton will be set to 22x22 if it is bigger than this size. If usesBigPixmap() is TRUE, then the pixmap will be set to 32x32.
A 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 TQToolButton you can set a popup menu using setPopup(). The default delay is 600ms; you can adjust it with setPopupDelay().
See also TQPushButton, TQToolBar, TQMainWindow, GUI Design Handbook: Push Button, and Basic Widgets.
The position of the tool button's textLabel in relation to the tool button's icon.
The tool button will display iconSet, with its text label and tool tip set to textLabel and its status bar message set to grouptext. It will be connected to the slot in object receiver.
An arrow button has auto-repeat turned on by default.
The parent and name arguments are sent to the TQWidget constructor.
Returns TRUE if auto-raising is enabled; otherwise returns FALSE. See the "autoRaise" property for details.
Returns the icon set providing the icon shown on the button. See the "iconSet" property for details.
This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
Since TQt 3.0, TQIconSet contains both the On and Off icons.
For ease of porting, this function ignores the on parameter and returns the iconSet property. If you relied on the on parameter, you probably want to update your code to use the TQIconSet On/Off mechanism.
Returns the icon set that is used when the button is in an "off" state. See the "offIconSet" property for details.
Returns the icon set that is used when the button is in an "on" state. See the "onIconSet" property for details.
See also setPopup().
Returns the time delay between pressing the button and the appearance of the associated popup menu in milliseconds. See the "popupDelay" property for details.
Sets whether auto-raising is enabled to enable. See the "autoRaise" property for details.
Sets the icon set providing the icon shown on the button. See the "iconSet" property for details.
This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
Since TQt 3.0, TQIconSet contains both the On and Off icons.
For ease of porting, this function ignores the on parameter and sets the iconSet property. If you relied on the on parameter, you probably want to update your code to use the TQIconSet On/Off mechanism.
See also iconSet and TQIconSet::State.
Sets the icon set that is used when the button is in an "off" state. See the "offIconSet" property for details.
Sets whether this tool button is on to enable. See the "on" property for details.
Sets the icon set that is used when the button is in an "on" state. See the "onIconSet" property for details.
The popup will be shown each time the tool button has been pressed down for a certain amount of time. A typical application example is the "back" button in some web browsers's tool bars. If the user clicks it, the browser simply browses back to the previous page. If the user presses and holds the button down for a while, the tool button shows a menu containing the current history list.
Ownership of the popup menu is not transferred to the tool button.
See also popup().
Sets the time delay between pressing the button and the appearance of the associated popup menu in milliseconds to delay. See the "popupDelay" property for details.
Sets the label of this button. See the "textLabel" property for details.
Sets the label of this button to newLabel and automatically sets it as a tool tip if tipToo is TRUE.
Sets the position of the text label of this button to pos. See the "textPosition" property for details.
Sets whether this tool button is a toggle button to enable. See the "toggleButton" property for details.
Sets whether this toolbutton uses big pixmaps to enable. See the "usesBigPixmap" property for details.
Sets whether the toolbutton displays a text label below the button pixmap to enable. See the "usesTextLabel" property for details.
Returns the label of this button. See the "textLabel" property for details.
Returns the position of the text label of this button. See the "textPosition" property for details.
This function has no effect on non-toggling buttons.
See also toggleButton and toggled().
See also drawButton().
Returns TRUE if this toolbutton uses big pixmaps; otherwise returns FALSE. See the "usesBigPixmap" property for details.
Returns TRUE if the toolbutton displays a text label below the button pixmap; otherwise returns FALSE. See the "usesTextLabel" property for details.
This property holds whether auto-raising is enabled.
The default is disabled (i.e. FALSE).
Set this property's value with setAutoRaise() and get this property's value with autoRaise().
This property holds the toolbutton's background mode.
Get this property with backgroundMode().
See also TQWidget::backgroundMode.
This property holds the icon set providing the icon shown on the button.
Setting this property sets TQToolButton::pixmap to a null pixmap. There is no default iconset.
See also pixmap, toggleButton, and on.
Set this property's value with setIconSet() and get this property's value with iconSet().
This property holds the icon set that is used when the button is in an "off" state.
This property is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
Since TQt 3.0, TQIconSet contains both the On and Off icons. There is now an TQToolButton::iconSet property that replaces both TQToolButton::onIconSet and TQToolButton::offIconSet.
For ease of porting, this property is a synonym for TQToolButton::iconSet. You probably want to go over your application code and use the TQIconSet On/Off mechanism.
See also iconSet and TQIconSet::State.
Set this property's value with setOffIconSet() and get this property's value with offIconSet().
This property holds whether this tool button is on.
This property has no effect on non-toggling buttons. The default is FALSE (i.e. off).
See also toggleButton and toggle().
Set this property's value with setOn().
This property holds the icon set that is used when the button is in an "on" state.
This property is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
Since TQt 3.0, TQIconSet contains both the On and Off icons. There is now an TQToolButton::iconSet property that replaces both TQToolButton::onIconSet and TQToolButton::offIconSet.
For ease of porting, this property is a synonym for TQToolButton::iconSet. You probably want to go over your application code and use the TQIconSet On/Off mechanism.
See also iconSet and TQIconSet::State.
Set this property's value with setOnIconSet() and get this property's value with onIconSet().
This property holds the pixmap of the button.
The pixmap property has no meaning for tool buttons. Use the iconSet property instead.
This property holds the time delay between pressing the button and the appearance of the associated popup menu in milliseconds.
Usually this is around half a second. A value of 0 draws the down arrow button to the side of the button which can be used to open up the popup menu.
See also setPopup().
Set this property's value with setPopupDelay() and get this property's value with popupDelay().
This property holds the label of this button.
Setting this property automatically sets the text as a tool tip too. There is no default text.
Set this property's value with setTextLabel() and get this property's value with textLabel().
This property holds the position of the text label of this button.
Set this property's value with setTextPosition() and get this property's value with textPosition().
This property holds whether this tool button is a toggle button.
Toggle buttons have an on/off state similar to check boxes. A tool button is not a toggle button by default.
Set this property's value with setToggleButton().
This property holds whether this toolbutton uses big pixmaps.
TQToolButton automatically connects this property to the relevant signal in the TQMainWindow in which it resides. We strongly recommend that you use TQMainWindow::setUsesBigPixmaps() instead.
This property's default is TRUE.
Warning: If you set some buttons (in a TQMainWindow) to have big pixmaps and others to have small pixmaps, TQMainWindow may not get the geometry right.
Set this property's value with setUsesBigPixmap() and get this property's value with usesBigPixmap().
This property holds whether the toolbutton displays a text label below the button pixmap.
The default is FALSE.
TQToolButton automatically connects this slot to the relevant signal in the TQMainWindow in which is resides.
Set this property's value with setUsesTextLabel() and get this property's value with usesTextLabel().
This file is part of the TQt toolkit. Copyright © 1995-2007 Trolltech. All Rights Reserved.
Copyright © 2007 Trolltech | Trademarks | TQt 3.3.8
|