.TH "KToolBarButton" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KToolBarButton \- A toolbar button.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <ktoolbarbutton.h>\fP
.PP
Inherits \fBQToolButton\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBmodeChange\fP ()"
.br
.RI "\fIThis slot should be called whenever the toolbar mode has potentially changed. \fP"
.ti -1c
.RI "virtual void \fBsetTextLabel\fP (const  \fBQString\fP &, bool tipToo)"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBclicked\fP (int)"
.br
.ti -1c
.RI "void \fBdoubleClicked\fP (int)"
.br
.ti -1c
.RI "void \fBpressed\fP (int)"
.br
.ti -1c
.RI "void \fBreleased\fP (int)"
.br
.ti -1c
.RI "void \fBtoggled\fP (int)"
.br
.ti -1c
.RI "void \fBhighlighted\fP (int, bool)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKToolBarButton\fP (const  \fBQString\fP &icon, int id, \fBQWidget\fP *parent, const  char *name=0L, const  \fBQString\fP &txt=QString::null, \fBKInstance\fP *_instance=\fBKGlobal::instance\fP())"
.br
.RI "\fIConstruct a button with an icon loaded by the button itself. \fP"
.ti -1c
.RI "\fBKToolBarButton\fP (const  \fBQPixmap\fP &pixmap, int id, \fBQWidget\fP *parent, const  char *name=0L, const  \fBQString\fP &txt=QString::null)"
.br
.RI "\fIConstruct a button with an existing pixmap. \fP"
.ti -1c
.RI "\fBKToolBarButton\fP (\fBQWidget\fP *parent=0L, const  char *name=0L)"
.br
.RI "\fIConstruct a separator button. \fP"
.ti -1c
.RI "\fB~KToolBarButton\fP ()"
.br
.RI "\fIStandard destructor. \fP"
.ti -1c
.RI "virtual void \fBsetPixmap\fP (const  \fBQPixmap\fP &pixmap)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP Set the pixmap directly for this button. \fP"
.ti -1c
.RI "void \fBsetDefaultPixmap\fP (const  \fBQPixmap\fP &pixmap)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP Force the button to use this pixmap as the default one rather then generating it using effects. \fP"
.ti -1c
.RI "void \fBsetDisabledPixmap\fP (const  \fBQPixmap\fP &pixmap)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP Force the button to use this pixmap when disabled one rather then generating it using effects. \fP"
.ti -1c
.RI "virtual void \fBsetText\fP (const  \fBQString\fP &text)"
.br
.RI "\fISet the text for this button. \fP"
.ti -1c
.RI "virtual void \fBsetIcon\fP (const  \fBQString\fP &icon)"
.br
.RI "\fISet the icon for this button. \fP"
.ti -1c
.RI "virtual void \fBsetIcon\fP (const  \fBQPixmap\fP &pixmap)"
.br
.RI "\fI\fBSince:\fP
.RS 4
3.1 
.RE
.PP
\fP"
.ti -1c
.RI "virtual void \fBsetIconSet\fP (const  \fBQIconSet\fP &iconset)"
.br
.RI "\fISet the pixmaps for this toolbar button from a \fBQIconSet\fP. \fP"
.ti -1c
.RI "void \fBsetIcon\fP (const  \fBQString\fP &icon, bool)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP Set the active icon for this button. \fP"
.ti -1c
.RI "void \fBsetDefaultIcon\fP (const  \fBQString\fP &icon)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP Force the button to use this icon as the default one rather then generating it using effects. \fP"
.ti -1c
.RI "void \fBsetDisabledIcon\fP (const  \fBQString\fP &icon)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP Force the button to use this icon when disabled one rather then generating it using effects. \fP"
.ti -1c
.RI "void \fBon\fP (bool flag=true)"
.br
.RI "\fITurn this button on or off. \fP"
.ti -1c
.RI "void \fBtoggle\fP ()"
.br
.RI "\fIToggle this button. \fP"
.ti -1c
.RI "void \fBsetToggle\fP (bool toggle=true)"
.br
.RI "\fITurn this button into a toggle button or disable the toggle aspects of it. \fP"
.ti -1c
.RI "\fBQPopupMenu\fP * \fBpopup\fP ()"
.br
.RI "\fIReturn a pointer to this button's popup menu (if it exists). \fP"
.ti -1c
.RI "void \fBsetPopup\fP (\fBQPopupMenu\fP *p, bool toggle=false)"
.br
.RI "\fIGive this button a popup menu. \fP"
.ti -1c
.RI "void \fBsetDelayedPopup\fP (\fBQPopupMenu\fP *p, bool toggle=false)"
.br
.RI "\fIGives this button a delayed popup menu. \fP"
.ti -1c
.RI "void \fBsetRadio\fP (bool f=true)"
.br
.RI "\fITurn this button into a radio button. \fP"
.ti -1c
.RI "void \fBsetNoStyle\fP (bool no_style=true)"
.br
.RI "\fIToolbar buttons naturally will assume the global styles concerning icons, icons sizes, etc. \fP"
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBslotClicked\fP ()"
.br
.ti -1c
.RI "void \fBslotPressed\fP ()"
.br
.ti -1c
.RI "void \fBslotReleased\fP ()"
.br
.ti -1c
.RI "void \fBslotToggled\fP ()"
.br
.ti -1c
.RI "void \fBslotDelayTimeout\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBpaletteChange\fP (const  \fBQPalette\fP &)"
.br
.ti -1c
.RI "void \fBleaveEvent\fP (\fBQEvent\fP *e)"
.br
.ti -1c
.RI "void \fBenterEvent\fP (\fBQEvent\fP *e)"
.br
.ti -1c
.RI "void \fBdrawButton\fP (\fBQPainter\fP *p)"
.br
.ti -1c
.RI "bool \fBeventFilter\fP (\fBQObject\fP *o, \fBQEvent\fP *e)"
.br
.ti -1c
.RI "void \fBshowMenu\fP ()"
.br
.ti -1c
.RI "\fBQSize\fP \fBsizeHint\fP () const "
.br
.ti -1c
.RI "\fBQSize\fP \fBminimumSizeHint\fP () const "
.br
.ti -1c
.RI "\fBQSize\fP \fBminimumSize\fP () const "
.br
.ti -1c
.RI "bool \fBisRaised\fP () const "
.br
.RI "\fI\fBSince:\fP
.RS 4
3.1 
.RE
.PP
\fP"
.ti -1c
.RI "bool \fBisActive\fP () const "
.br
.RI "\fI\fBSince:\fP
.RS 4
3.1 
.RE
.PP
\fP"
.ti -1c
.RI "int \fBiconTextMode\fP () const "
.br
.RI "\fI\fBSince:\fP
.RS 4
3.1 
.RE
.PP
\fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
A toolbar button. 

This is used internally by \fBKToolBar\fP, use the \fBKToolBar\fP methods instead. 
.PP
Definition at line 45 of file ktoolbarbutton.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KToolBarButton::KToolBarButton (const \fBQString\fP & icon, int id, \fBQWidget\fP * parent, const char * name = 0L, const \fBQString\fP & txt = QString::null, \fBKInstance\fP * _instance = \fBKGlobal::instance\fP())"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIicon\fP Name of icon to load (may be absolute or relative) 
.br
\fIid\fP Id of this button 
.br
\fIparent\fP This button's parent 
.br
\fIname\fP This button's internal name 
.br
\fItxt\fP This button's text (in a tooltip or otherwise) 
.RE
.PP
Definition at line 116 of file ktoolbarbutton.cpp.
.PP
References modeChange(), and QToolButton::setTextLabel().
.SS "KToolBarButton::KToolBarButton (const \fBQPixmap\fP & pixmap, int id, \fBQWidget\fP * parent, const char * name = 0L, const \fBQString\fP & txt = QString::null)"
.PP
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'.
.PP
\fBParameters:\fP
.RS 4
\fIicon\fP Name of icon to load (may be absolute or relative) 
.br
\fIid\fP Id of this button 
.br
\fIparent\fP This button's parent 
.br
\fIname\fP This button's internal name 
.br
\fItxt\fP This button's text (in a tooltip or otherwise) 
.RE
.PP
Definition at line 148 of file ktoolbarbutton.cpp.
.PP
References modeChange(), KStdAccel::name(), setIconSet(), and QToolButton::setTextLabel().
.SS "KToolBarButton::KToolBarButton (\fBQWidget\fP * parent = 0L, const char * name = 0L)"
.PP
Construct a separator button. \fBParameters:\fP
.RS 4
\fIparent\fP This button's parent 
.br
\fIname\fP This button's internal name 
.RE
.PP
Definition at line 106 of file ktoolbarbutton.cpp.
.SS "KToolBarButton::~\fBKToolBarButton\fP ()"
.PP
Standard destructor. Definition at line 178 of file ktoolbarbutton.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KToolBarButton::setPixmap (const \fBQPixmap\fP & pixmap)\fC [virtual]\fP"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP 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 \fBsetIcon\fP.
.PP
\fBParameters:\fP
.RS 4
\fIpixmap\fP The active pixmap 
.RE
.PP
Definition at line 298 of file ktoolbarbutton.cpp.
.PP
References QToolButton::iconSet(), QPixmap::isNull(), QToolButton::setIconSet(), and QIconSet::setPixmap().
.PP
Referenced by KToolBar::setButtonPixmap().
.SS "void KToolBarButton::setDefaultPixmap (const \fBQPixmap\fP & pixmap)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Force the button to use this pixmap as the default one rather then generating it using effects. \fBParameters:\fP
.RS 4
\fIpixmap\fP The pixmap to use as the default (normal) one 
.RE
.PP
Definition at line 310 of file ktoolbarbutton.cpp.
.PP
References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap().
.SS "void KToolBarButton::setDisabledPixmap (const \fBQPixmap\fP & pixmap)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Force the button to use this pixmap when disabled one rather then generating it using effects. \fBParameters:\fP
.RS 4
\fIpixmap\fP The pixmap to use when disabled 
.RE
.PP
Definition at line 317 of file ktoolbarbutton.cpp.
.PP
References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap().
.SS "void KToolBarButton::setText (const \fBQString\fP & text)\fC [virtual]\fP"
.PP
Set the text for this button. The text will be either used as a tooltip (IconOnly) or will be along side the icon
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The button (or tooltip) text 
.RE
.PP
Definition at line 273 of file ktoolbarbutton.cpp.
.PP
References modeChange(), and QToolButton::setTextLabel().
.SS "void KToolBarButton::setIcon (const \fBQString\fP & icon)\fC [virtual]\fP"
.PP
Set the icon for this button. The icon will be loaded internally with the correct size. This function is preferred over \fBsetIconSet\fP
.PP
\fBParameters:\fP
.RS 4
\fIicon\fP The name of the icon 
.RE
.PP
Definition at line 279 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setIconSet().
.PP
Referenced by modeChange(), KToolBar::setButtonIcon(), and setIcon().
.SS "virtual void KToolBarButton::setIcon (const \fBQPixmap\fP & pixmap)\fC [inline, virtual]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 141 of file ktoolbarbutton.h.
.SS "void KToolBarButton::setIconSet (const \fBQIconSet\fP & iconset)\fC [virtual]\fP"
.PP
Set the pixmaps for this toolbar button from a \fBQIconSet\fP. If you call this you don't need to call any of the other methods that set icons or pixmaps. 
.PP
\fBParameters:\fP
.RS 4
\fIiconset\fP The iconset to use 
.RE
.PP
Reimplemented from \fBQToolButton\fP.
.PP
Definition at line 292 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setIconSet().
.PP
Referenced by KToolBarButton(), and KToolBar::setButtonIconSet().
.SS "void KToolBarButton::setIcon (const \fBQString\fP & icon, bool)\fC [inline]\fP"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP 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 \fBgenerate\fP is true. This function is preferred over \fBsetPixmap\fP
.PP
\fBParameters:\fP
.RS 4
\fIicon\fP The name of the active icon 
.br
\fIgenerate\fP If true, then the other icons are automagically generated from this one 
.RE
.PP
Definition at line 164 of file ktoolbarbutton.h.
.PP
References setIcon().
.SS "void KToolBarButton::setDefaultIcon (const \fBQString\fP & icon)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Force the button to use this icon as the default one rather then generating it using effects. \fBParameters:\fP
.RS 4
\fIicon\fP The icon to use as the default (normal) one 
.RE
.PP
Definition at line 324 of file ktoolbarbutton.cpp.
.PP
References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap().
.SS "void KToolBarButton::setDisabledIcon (const \fBQString\fP & icon)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Force the button to use this icon when disabled one rather then generating it using effects. \fBParameters:\fP
.RS 4
\fIicon\fP The icon to use when disabled 
.RE
.PP
Definition at line 338 of file ktoolbarbutton.cpp.
.PP
References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap().
.SS "void KToolBarButton::on (bool flag = true)"
.PP
Turn this button on or off. \fBParameters:\fP
.RS 4
\fIflag\fP true or false 
.RE
.PP
Definition at line 743 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setOn().
.PP
Referenced by KToolBar::setButton().
.SS "void KToolBarButton::toggle ()"
.PP
Toggle this button. Reimplemented from \fBQToolButton\fP.
.PP
Definition at line 755 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setOn().
.PP
Referenced by KToolBar::toggleButton().
.SS "void KToolBarButton::setToggle (bool toggle = true)"
.PP
Turn this button into a toggle button or disable the toggle aspects of it. This does not toggle the button itself. Use \fBtoggle\fP() for that.
.PP
\fBParameters:\fP
.RS 4
\fItoggle\fP true or false 
.RE
.PP
Definition at line 761 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setToggleButton().
.PP
Referenced by KToolBar::setToggle().
.SS "\fBQPopupMenu\fP * KToolBarButton::popup ()"
.PP
Return a pointer to this button's popup menu (if it exists). Definition at line 359 of file ktoolbarbutton.cpp.
.SS "void KToolBarButton::setPopup (\fBQPopupMenu\fP * p, bool toggle = false)"
.PP
Give this button a popup menu. There will not be a delay when you press the button. Use \fBsetDelayedPopup\fP 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.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP The new popup menu 
.br
\fItoggle\fP if true, makes the button 'sticky' (toggled) 
.RE
.PP
Definition at line 352 of file ktoolbarbutton.cpp.
.PP
Referenced by KToolBar::insertButton(), KToolBarPopupAction::plug(), KActionMenu::plug(), and setDelayedPopup().
.SS "void KToolBarButton::setDelayedPopup (\fBQPopupMenu\fP * p, bool toggle = false)"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP the new popup menu 
.br
\fItoggle\fP if true, makes the button 'sticky' (toggled) 
.RE
.PP
Definition at line 364 of file ktoolbarbutton.cpp.
.PP
References setPopup().
.PP
Referenced by KToolBar::setDelayedPopup().
.SS "void KToolBarButton::setRadio (bool f = true)"
.PP
Turn this button into a radio button. \fBParameters:\fP
.RS 4
\fIf\fP true or false 
.RE
.PP
Definition at line 737 of file ktoolbarbutton.cpp.
.PP
Referenced by KToolBarRadioGroup::addButton().
.SS "void KToolBarButton::setNoStyle (bool no_style = true)"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIno_style\fP Will disable styles if true 
.RE
.PP
Definition at line 728 of file ktoolbarbutton.cpp.
.PP
References modeChange().
.PP
Referenced by KToolBar::setItemNoStyle().
.SS "void KToolBarButton::modeChange ()\fC [slot]\fP"
.PP
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.
.PP
References QToolTip::add(), QApplication::globalStrut(), QSize::height(), QFontMetrics::lineSpacing(), QToolTip::remove(), setIcon(), QSize::setWidth(), QToolButton::textLabel(), KGlobalSettings::toolBarFont(), QSize::width(), and QFontMetrics::width().
.PP
Referenced by KToolBarButton(), setNoStyle(), and setText().
.SS "bool KToolBarButton::isRaised () const\fC [protected]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 785 of file ktoolbarbutton.cpp.
.SS "bool KToolBarButton::isActive () const\fC [protected]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 790 of file ktoolbarbutton.cpp.
.SS "int KToolBarButton::iconTextMode () const\fC [protected]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 795 of file ktoolbarbutton.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
