KDEUI
Go to the documentation of this file.
35 class KToggleAction::Private
39 : parent( _parent ), checkedGuiItem( 0L )
45 delete checkedGuiItem;
50 parent->setCheckable(
true );
51 connect( parent, SIGNAL(toggled(
bool)),
62 d( new Private( this ) )
69 d( new Private( this ) )
75 :
KAction( icon, text, parent ),
76 d( new Private( this ) )
89 delete d->checkedGuiItem;
90 d->checkedGuiItem =
new KGuiItem( checkedItem );
95 if ( d->checkedGuiItem ) {
96 QString
string = d->checkedGuiItem->text();
97 d->checkedGuiItem->setText( text() );
100 string = d->checkedGuiItem->toolTip();
101 d->checkedGuiItem->setToolTip( toolTip() );
102 setToolTip(
string );
104 if ( d->checkedGuiItem->hasIcon() ) {
105 KIcon icon = d->checkedGuiItem->icon();
106 d->checkedGuiItem->setIcon(
KIcon(this->icon()) );
107 QAction::setIcon( icon );
112 #include "ktoggleaction.moc"
A wrapper around QIcon that provides KDE icon features.
KToggleAction(QObject *parent)
Constructs an action with the specified parent.
Class to encapsulate user-driven action or event.
virtual ~KToggleAction()
Destructor.
virtual void slotToggled(bool checked)
void setCheckedState(const KGuiItem &checkedItem)
Defines the text (and icon, tooltip, whatsthis) that should be displayed instead of the normal text,...
An abstract class for GUI data such as ToolTip and Icon.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 27 2020 00:00:00 by
doxygen 1.8.20 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.