• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • actions
kdualaction.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 *
3 * Copyright (c) 2010 Aurélien Gâteau <agateau@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 */
20#ifndef KDUALACTION_H
21#define KDUALACTION_H
22
23#include <kdeui_export.h>
24#include <kaction.h>
25
26class KDualActionPrivate;
27
58class KDEUI_EXPORT KDualAction : public KAction
59{
60 Q_OBJECT
61public:
66 explicit KDualAction(QObject *parent);
67
71 KDualAction(const QString &inactiveText, const QString &activeText, QObject *parent);
72
73 ~KDualAction();
74
78 void setActiveGuiItem(const KGuiItem &);
79
83 KGuiItem activeGuiItem() const;
84
88 void setInactiveGuiItem(const KGuiItem &);
89
93 KGuiItem inactiveGuiItem() const;
94
98 void setActiveIcon(const QIcon &);
99
103 QIcon activeIcon() const;
104
108 void setInactiveIcon(const QIcon &);
109
113 QIcon inactiveIcon() const;
114
118 void setActiveText(const QString &);
119
123 QString activeText() const;
124
128 void setInactiveText(const QString &);
129
133 QString inactiveText() const;
134
138 void setActiveToolTip(const QString &);
139
143 QString activeToolTip() const;
144
148 void setInactiveToolTip(const QString &);
149
153 QString inactiveToolTip() const;
154
158 void setIconForStates(const QIcon &icon);
159
164 bool isActive() const;
165
170 void setAutoToggle(bool);
171
176 bool autoToggle() const;
177
178public Q_SLOTS:
183 void setActive(bool state);
184
185Q_SIGNALS:
190 void activeChanged(bool);
191
196 void activeChangedByUser(bool);
197
198private:
199 Q_PRIVATE_SLOT(d, void slotTriggered())
200 KDualActionPrivate *const d;
201 friend class KDualActionPrivate;
202};
203
204#endif /* KDUALACTION_H */
KAction
Class to encapsulate user-driven action or event.
Definition: kaction.h:217
KDualAction
An action which can alternate between two texts/icons when triggered.
Definition: kdualaction.h:59
KDualAction::activeChanged
void activeChanged(bool)
Emitted when the state changes.
KDualAction::activeChangedByUser
void activeChangedByUser(bool)
Only emitted when the state changes because the user triggered the action.
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:37
QObject
kaction.h
kdeui_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal