KToolBarButton Class Reference
A toolbar button. More...
#include <ktoolbarbutton.h>
Inheritance diagram for KToolBarButton:

Public Slots | |
void | modeChange () |
This slot should be called whenever the toolbar mode has potentially changed. | |
virtual void | setTextLabel (const QString &, bool tipToo) |
Signals | |
void | clicked (int) |
void | doubleClicked (int) |
void | pressed (int) |
void | released (int) |
void | toggled (int) |
void | highlighted (int, bool) |
Public Member Functions | |
KToolBarButton (const QString &icon, int id, QWidget *parent, const char *name=0L, const QString &txt=QString::null, KInstance *_instance=KGlobal::instance()) | |
Construct a button with an icon loaded by the button itself. | |
KToolBarButton (const QPixmap &pixmap, int id, QWidget *parent, const char *name=0L, const QString &txt=QString::null) | |
Construct a button with an existing pixmap. | |
KToolBarButton (QWidget *parent=0L, const char *name=0L) | |
Construct a separator button. | |
~KToolBarButton () | |
Standard destructor. | |
virtual void | setPixmap (const QPixmap &pixmap) |
This class or method is obsolete, it is provided for compatibility only. Set the pixmap directly for this button. | |
void | setDefaultPixmap (const QPixmap &pixmap) |
This class or method is obsolete, it is provided for compatibility only. Force the button to use this pixmap as the default one rather then generating it using effects. | |
void | setDisabledPixmap (const QPixmap &pixmap) |
This class or method is obsolete, it is provided for compatibility only. Force the button to use this pixmap when disabled one rather then generating it using effects. | |
virtual void | setText (const QString &text) |
Set the text for this button. | |
virtual void | setIcon (const QString &icon) |
Set the icon for this button. | |
virtual void | setIcon (const QPixmap &pixmap) |
| |
virtual void | setIconSet (const QIconSet &iconset) |
Set the pixmaps for this toolbar button from a QIconSet. | |
void | setIcon (const QString &icon, bool) |
This class or method is obsolete, it is provided for compatibility only. Set the active icon for this button. | |
void | setDefaultIcon (const QString &icon) |
This class or method is obsolete, it is provided for compatibility only. Force the button to use this icon as the default one rather then generating it using effects. | |
void | setDisabledIcon (const QString &icon) |
This class or method is obsolete, it is provided for compatibility only. Force the button to use this icon when disabled one rather then generating it using effects. | |
void | on (bool flag=true) |
Turn this button on or off. | |
void | toggle () |
Toggle this button. | |
void | setToggle (bool toggle=true) |
Turn this button into a toggle button or disable the toggle aspects of it. | |
QPopupMenu * | popup () |
Return a pointer to this button's popup menu (if it exists). | |
void | setPopup (QPopupMenu *p, bool toggle=false) |
Give this button a popup menu. | |
void | setDelayedPopup (QPopupMenu *p, bool toggle=false) |
Gives this button a delayed popup menu. | |
void | setRadio (bool f=true) |
Turn this button into a radio button. | |
void | setNoStyle (bool no_style=true) |
Toolbar buttons naturally will assume the global styles concerning icons, icons sizes, etc. | |
Protected Slots | |
void | slotClicked () |
void | slotPressed () |
void | slotReleased () |
void | slotToggled () |
void | slotDelayTimeout () |
Protected Member Functions | |
void | paletteChange (const QPalette &) |
void | leaveEvent (QEvent *e) |
void | enterEvent (QEvent *e) |
void | drawButton (QPainter *p) |
bool | eventFilter (QObject *o, QEvent *e) |
void | showMenu () |
QSize | sizeHint () const |
QSize | minimumSizeHint () const |
QSize | minimumSize () const |
bool | isRaised () const |
| |
bool | isActive () const |
| |
int | iconTextMode () const |
| |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
A toolbar button.This is used internally by KToolBar, use the KToolBar methods instead.
Definition at line 45 of file ktoolbarbutton.h.
Constructor & Destructor Documentation
|
Construct a button with an icon loaded by the button itself. This will trust the button to load the correct icon with the correct size.
Definition at line 116 of file ktoolbarbutton.cpp. References modeChange(), and QToolButton::setTextLabel(). |
|
Construct a button with an existing pixmap. It is not recommended that you use this as the internal icon loading code will almost always get it "right".
Definition at line 148 of file ktoolbarbutton.cpp. References modeChange(), KStdAccel::name(), setIconSet(), and QToolButton::setTextLabel(). |
|
Construct a separator button.
Definition at line 106 of file ktoolbarbutton.cpp. |
|
Standard destructor.
Definition at line 178 of file ktoolbarbutton.cpp. |
Member Function Documentation
|
This class or method is obsolete, it is provided for compatibility only. Set the pixmap directly for this button. This pixmap should be the active one... the dimmed and disabled pixmaps are constructed based on this one. However, don't use this function unless you are positive that you don't want to use setIcon.
Definition at line 298 of file ktoolbarbutton.cpp. References QToolButton::iconSet(), QPixmap::isNull(), QToolButton::setIconSet(), and QIconSet::setPixmap(). Referenced by KToolBar::setButtonPixmap(). |
|
This class or method is obsolete, it is provided for compatibility only. Force the button to use this pixmap as the default one rather then generating it using effects.
Definition at line 310 of file ktoolbarbutton.cpp. References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap(). |
|
This class or method is obsolete, it is provided for compatibility only. Force the button to use this pixmap when disabled one rather then generating it using effects.
Definition at line 317 of file ktoolbarbutton.cpp. References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap(). |
|
Set the text for this button. The text will be either used as a tooltip (IconOnly) or will be along side the icon
Definition at line 273 of file ktoolbarbutton.cpp. References modeChange(), and QToolButton::setTextLabel(). |
|
Set the icon for this button. The icon will be loaded internally with the correct size. This function is preferred over setIconSet
Definition at line 279 of file ktoolbarbutton.cpp. References QToolButton::setIconSet(). Referenced by modeChange(), KToolBar::setButtonIcon(), and setIcon(). |
|
Definition at line 141 of file ktoolbarbutton.h. |
|
Set the pixmaps for this toolbar button from a QIconSet. If you call this you don't need to call any of the other methods that set icons or pixmaps.
Reimplemented from QToolButton. Definition at line 292 of file ktoolbarbutton.cpp. References QToolButton::setIconSet(). Referenced by KToolBarButton(), and KToolBar::setButtonIconSet(). |
|
This class or method is obsolete, it is provided for compatibility only. Set the active icon for this button. The pixmap itself is loaded internally based on the icon size... .. the disabled and default pixmaps, however will only be constructed if generate is true. This function is preferred over setPixmap
Definition at line 164 of file ktoolbarbutton.h. References setIcon(). |
|
This class or method is obsolete, it is provided for compatibility only. Force the button to use this icon as the default one rather then generating it using effects.
Definition at line 324 of file ktoolbarbutton.cpp. References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap(). |
|
This class or method is obsolete, it is provided for compatibility only. Force the button to use this icon when disabled one rather then generating it using effects.
Definition at line 338 of file ktoolbarbutton.cpp. References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap(). |
|
Turn this button on or off.
Definition at line 743 of file ktoolbarbutton.cpp. References QToolButton::setOn(). Referenced by KToolBar::setButton(). |
|
Toggle this button.
Reimplemented from QToolButton. Definition at line 755 of file ktoolbarbutton.cpp. References QToolButton::setOn(). Referenced by KToolBar::toggleButton(). |
|
Turn this button into a toggle button or disable the toggle aspects of it. This does not toggle the button itself. Use toggle() for that.
Definition at line 761 of file ktoolbarbutton.cpp. References QToolButton::setToggleButton(). Referenced by KToolBar::setToggle(). |
|
Return a pointer to this button's popup menu (if it exists).
Definition at line 359 of file ktoolbarbutton.cpp. |
|
Give this button a popup menu. There will not be a delay when you press the button. Use setDelayedPopup if you want that behavior. You can also make the popup-menu "sticky", i.e. visible until a selection is made or the mouse is clikced elsewhere, by simply setting the second argument to true. This "sticky" button feature allows you to make a selection without having to press and hold down the mouse while making a selection.
Definition at line 352 of file ktoolbarbutton.cpp. Referenced by KToolBar::insertButton(), KToolBarPopupAction::plug(), KActionMenu::plug(), and setDelayedPopup(). |
|
Gives this button a delayed popup menu. This function allows you to add a delayed popup menu to the button. The popup menu is then only displayed when the button is pressed and held down for about half a second. You can also make the popup-menu "sticky", i.e. visible until a selection is made or the mouse is clikced elsewhere, by simply setting the second argument to true. This "sticky" button feature allows you to make a selection without having to press and hold down the mouse while making a selection.
Definition at line 364 of file ktoolbarbutton.cpp. References setPopup(). Referenced by KToolBar::setDelayedPopup(). |
|
Turn this button into a radio button.
Definition at line 737 of file ktoolbarbutton.cpp. Referenced by KToolBarRadioGroup::addButton(). |
|
Toolbar buttons naturally will assume the global styles concerning icons, icons sizes, etc. You can use this function to explicitely turn this off, if you like.
Definition at line 728 of file ktoolbarbutton.cpp. References modeChange(). Referenced by KToolBar::setItemNoStyle(). |
|
This slot should be called whenever the toolbar mode has potentially changed. This includes such events as text changing, orientation changing, etc. Definition at line 183 of file ktoolbarbutton.cpp. References QToolTip::add(), QApplication::globalStrut(), QSize::height(), QFontMetrics::lineSpacing(), QToolTip::remove(), setIcon(), QSize::setWidth(), QToolButton::textLabel(), KGlobalSettings::toolBarFont(), QSize::width(), and QFontMetrics::width(). Referenced by KToolBarButton(), setNoStyle(), and setText(). |
|
Definition at line 785 of file ktoolbarbutton.cpp. |
|
Definition at line 790 of file ktoolbarbutton.cpp. |
|
Definition at line 795 of file ktoolbarbutton.cpp. |
The documentation for this class was generated from the following files: