.TH "KToolBarButton" kde3 "11 Jun 2005" "Version Version 3.4.1" "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
.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 \fBbuttonClicked\fP (int, Qt::ButtonState state)"
.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
.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
.ti -1c
.RI "\fBKToolBarButton\fP (\fBQWidget\fP *parent=0L, const char *name=0L)"
.br
.ti -1c
.RI "\fB~KToolBarButton\fP ()"
.br
.ti -1c
.RI "virtual void \fBsetPixmap\fP (const \fBQPixmap\fP &pixmap) KDE_DEPRECATED"
.br
.ti -1c
.RI "void \fBsetDefaultPixmap\fP (const \fBQPixmap\fP &pixmap) KDE_DEPRECATED"
.br
.ti -1c
.RI "void \fBsetDisabledPixmap\fP (const \fBQPixmap\fP &pixmap) KDE_DEPRECATED"
.br
.ti -1c
.RI "virtual void \fBsetText\fP (const \fBQString\fP &text)"
.br
.ti -1c
.RI "virtual void \fBsetIcon\fP (const \fBQString\fP &icon)"
.br
.ti -1c
.RI "virtual void \fBsetIcon\fP (const \fBQPixmap\fP &pixmap)"
.br
.ti -1c
.RI "virtual void \fBsetIconSet\fP (const \fBQIconSet\fP &iconset)"
.br
.ti -1c
.RI "KDE_DEPRECATED void \fBsetIcon\fP (const \fBQString\fP &icon, bool generate)"
.br
.ti -1c
.RI "void \fBsetDefaultIcon\fP (const \fBQString\fP &icon) KDE_DEPRECATED"
.br
.ti -1c
.RI "void \fBsetDisabledIcon\fP (const \fBQString\fP &icon) KDE_DEPRECATED"
.br
.ti -1c
.RI "void \fBon\fP (bool flag=true)"
.br
.ti -1c
.RI "void \fBtoggle\fP ()"
.br
.ti -1c
.RI "void \fBsetToggle\fP (bool toggle=true)"
.br
.ti -1c
.RI "\fBQPopupMenu\fP * \fBpopup\fP ()"
.br
.ti -1c
.RI "int \fBid\fP () const "
.br
.ti -1c
.RI "void \fBsetPopup\fP (\fBQPopupMenu\fP *p, bool unused=false)"
.br
.ti -1c
.RI "void \fBsetDelayedPopup\fP (\fBQPopupMenu\fP *p, bool unused=false)"
.br
.ti -1c
.RI "void \fBsetRadio\fP (bool f=true)"
.br
.ti -1c
.RI "void \fBsetNoStyle\fP (bool no_style=true)"
.br
.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 \fBmousePressEvent\fP (\fBQMouseEvent\fP *)"
.br
.ti -1c
.RI "void \fBmouseReleaseEvent\fP (\fBQMouseEvent\fP *)"
.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
.ti -1c
.RI "bool \fBisActive\fP () const "
.br
.ti -1c
.RI "int \fBiconTextMode\fP () const "
.br
.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 44 of file ktoolbarbutton.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KToolBarButton::KToolBarButton (const \fBQString\fP & icon, int id, \fBQWidget\fP * parent, const char * name = \fC0L\fP, const \fBQString\fP & txt = \fCQString::null\fP, \fBKInstance\fP * _instance = \fC\fBKGlobal::instance\fP()\fP)"
.PP
Construct a button with an icon loaded by the button itself. 
.PP
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) 
.br
\fI_instance\fP the instance to use for this button 
.RE
.PP

.PP
Definition at line 110 of file ktoolbarbutton.cpp.
.PP
References clicked(), modeChange(), and QToolButton::setTextLabel().
.SS "KToolBarButton::KToolBarButton (const \fBQPixmap\fP & pixmap, int id, \fBQWidget\fP * parent, const char * name = \fC0L\fP, const \fBQString\fP & txt = \fCQString::null\fP)"
.PP
Construct a button with an existing pixmap. 
.PP
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
\fIpixmap\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

.PP
Definition at line 144 of file ktoolbarbutton.cpp.
.PP
References clicked(), modeChange(), setIconSet(), and QToolButton::setTextLabel().
.SS "KToolBarButton::KToolBarButton (\fBQWidget\fP * parent = \fC0L\fP, const char * name = \fC0L\fP)"
.PP
Construct a separator button. 
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP This button's parent 
.br
\fIname\fP This button's internal name 
.RE
.PP

.PP
Definition at line 100 of file ktoolbarbutton.cpp.
.SS "KToolBarButton::~\fBKToolBarButton\fP ()"
.PP
Standard destructor. 
.PP
Definition at line 176 of file ktoolbarbutton.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KToolBarButton::setPixmap (const \fBQPixmap\fP & pixmap)\fC [virtual]\fP"
.PP
\fBDeprecated\fP
.RS 4
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. 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIpixmap\fP The active pixmap 
.RE
.PP

.PP
Definition at line 299 of file ktoolbarbutton.cpp.
.PP
References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap().
.PP
Referenced by KToolBar::setButtonPixmap().
.SS "void KToolBarButton::setDefaultPixmap (const \fBQPixmap\fP & pixmap)"
.PP
\fBDeprecated\fP
.RS 4
Force the button to use this pixmap as the default one rather then generating it using effects. 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIpixmap\fP The pixmap to use as the default (normal) one 
.RE
.PP

.PP
Definition at line 311 of file ktoolbarbutton.cpp.
.PP
References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap().
.SS "void KToolBarButton::setDisabledPixmap (const \fBQPixmap\fP & pixmap)"
.PP
\fBDeprecated\fP
.RS 4
Force the button to use this pixmap when disabled one rather then generating it using effects. 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIpixmap\fP The pixmap to use when disabled 
.RE
.PP

.PP
Definition at line 318 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. 
.PP
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

.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. 
.PP
The icon will be loaded internally with the correct size. This function is preferred over setIconSet
.PP
\fBParameters:\fP
.RS 4
\fIicon\fP The name of the icon 
.RE
.PP

.PP
Definition at line 279 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setIconSet().
.PP
Referenced by modeChange(), and KToolBar::setButtonIcon().
.SS "virtual void KToolBarButton::setIcon (const \fBQPixmap\fP & pixmap)\fC [inline, virtual]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.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. 
.PP
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

.PP
Reimplemented from \fBQToolButton\fP.
.PP
Definition at line 293 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setIconSet().
.PP
Referenced by KToolBarButton(), and KToolBar::setButtonIconSet().
.SS "KDE_DEPRECATED void KToolBarButton::setIcon (const \fBQString\fP & icon, bool generate)\fC [inline]\fP"
.PP
\fBDeprecated\fP
.RS 4
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 
.RE
.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

.PP
Definition at line 164 of file ktoolbarbutton.h.
.SS "void KToolBarButton::setDefaultIcon (const \fBQString\fP & icon)"
.PP
\fBDeprecated\fP
.RS 4
Force the button to use this icon as the default one rather then generating it using effects. 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIicon\fP The icon to use as the default (normal) one 
.RE
.PP

.PP
Definition at line 325 of file ktoolbarbutton.cpp.
.PP
References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap().
.SS "void KToolBarButton::setDisabledIcon (const \fBQString\fP & icon)"
.PP
\fBDeprecated\fP
.RS 4
Force the button to use this icon when disabled one rather then generating it using effects. 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIicon\fP The icon to use when disabled 
.RE
.PP

.PP
Definition at line 339 of file ktoolbarbutton.cpp.
.PP
References QToolButton::iconSet(), QToolButton::setIconSet(), and QIconSet::setPixmap().
.SS "void KToolBarButton::on (bool flag = \fCtrue\fP)"
.PP
Turn this button on or off. 
.PP
\fBParameters:\fP
.RS 4
\fIflag\fP true or false 
.RE
.PP

.PP
Definition at line 696 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setOn().
.PP
Referenced by KToolBar::setButton().
.SS "void KToolBarButton::toggle ()"
.PP
Toggle this button. 
.PP
Reimplemented from \fBQToolButton\fP.
.PP
Definition at line 708 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setOn().
.PP
Referenced by KToolBar::toggleButton().
.SS "void KToolBarButton::setToggle (bool toggle = \fCtrue\fP)"
.PP
Turn this button into a toggle button or disable the toggle aspects of it. 
.PP
This does not toggle the button itself. Use \fBtoggle()\fP for that.
.PP
\fBParameters:\fP
.RS 4
\fItoggle\fP true or false 
.RE
.PP

.PP
Definition at line 714 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). 
.PP
Definition at line 353 of file ktoolbarbutton.cpp.
.PP
References QToolButton::popup().
.SS "int KToolBarButton::id () const"
.PP
Returns the button's id. 
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 753 of file ktoolbarbutton.cpp.
.SS "void KToolBarButton::setPopup (\fBQPopupMenu\fP * p, bool unused = \fCfalse\fP)"
.PP
Give this button a popup menu. 
.PP
There will not be a delay when you press the button. Use setDelayedPopup if you want that behavior.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP The new popup menu 
.br
\fIunused\fP Has no effect - ignore it. 
.RE
.PP

.PP
Definition at line 360 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setPopup(), and QToolButton::setPopupDelay().
.PP
Referenced by KToolBar::insertButton(), KToolBarPopupAction::plug(), and KActionMenu::plug().
.SS "void KToolBarButton::setDelayedPopup (\fBQPopupMenu\fP * p, bool unused = \fCfalse\fP)"
.PP
Gives this button a delayed popup menu. 
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP the new popup menu 
.br
\fIunused\fP Has no effect - ignore it. 
.RE
.PP

.PP
Definition at line 367 of file ktoolbarbutton.cpp.
.PP
References QToolButton::setPopup(), and QToolButton::setPopupDelay().
.PP
Referenced by KToolBar::setDelayedPopup().
.SS "void KToolBarButton::setRadio (bool f = \fCtrue\fP)"
.PP
Turn this button into a radio button. 
.PP
\fBParameters:\fP
.RS 4
\fIf\fP true or false 
.RE
.PP

.PP
Definition at line 690 of file ktoolbarbutton.cpp.
.PP
Referenced by KToolBarRadioGroup::addButton().
.SS "void KToolBarButton::setNoStyle (bool no_style = \fCtrue\fP)"
.PP
Toolbar buttons naturally will assume the global styles concerning icons, icons sizes, etc. 
.PP
You can use this function to explicitly turn this off, if you like.
.PP
\fBParameters:\fP
.RS 4
\fIno_style\fP Will disable styles if true 
.RE
.PP

.PP
Definition at line 681 of file ktoolbarbutton.cpp.
.PP
References modeChange().
.PP
Referenced by KToolBar::setItemNoStyle().
.SS "void KToolBarButton::clicked (int)\fC [signal]\fP"
.PP
Emitted when the toolbar button is clicked (with LMB or MMB). 
.PP
Referenced by KToolBarButton().
.SS "void KToolBarButton::buttonClicked (int, Qt::ButtonState state)\fC [signal]\fP"
.PP
Emitted when the toolbar button is clicked (with any mouse button). 
.PP
\fBParameters:\fP
.RS 4
\fIstate\fP makes it possible to find out which button was pressed, and whether any keyboard modifiers were held. 
.RE
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Referenced by mouseReleaseEvent().
.SS "void KToolBarButton::modeChange ()\fC [slot]\fP"
.PP
This slot should be called whenever the toolbar mode has potentially changed. 
.PP
This includes such events as text changing, orientation changing, etc. 
.PP
Definition at line 181 of file ktoolbarbutton.cpp.
.PP
References QToolTip::add(), 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 "void KToolBarButton::mousePressEvent (\fBQMouseEvent\fP *)\fC [protected]\fP"
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 449 of file ktoolbarbutton.cpp.
.SS "void KToolBarButton::mouseReleaseEvent (\fBQMouseEvent\fP *)\fC [protected]\fP"
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 463 of file ktoolbarbutton.cpp.
.PP
References buttonClicked().
.SS "bool KToolBarButton::isRaised () const\fC [protected]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 738 of file ktoolbarbutton.cpp.
.SS "bool KToolBarButton::isActive () const\fC [protected]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 743 of file ktoolbarbutton.cpp.
.SS "int KToolBarButton::iconTextMode () const\fC [protected]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 748 of file ktoolbarbutton.cpp.

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