KGuiItem
#include <KGuiItem>
Public Member Functions | |
KGuiItem () | |
KGuiItem (const KGuiItem &other) | |
KGuiItem (const QString &text, const QIcon &icon, const QString &toolTip=QString(), const QString &whatsThis=QString()) | |
KGuiItem (const QString &text, const QString &iconName=QString(), const QString &toolTip=QString(), const QString &whatsThis=QString()) | |
~KGuiItem () | |
bool | hasIcon () const |
QIcon | icon () const |
QString | iconName () const |
bool | isEnabled () const |
KGuiItem & | operator= (const KGuiItem &other) |
QString | plainText () const |
void | setEnabled (bool enable) |
void | setIcon (const QIcon &iconset) |
void | setIconName (const QString &iconName) |
void | setText (const QString &text) |
void | setToolTip (const QString &tooltip) |
void | setWhatsThis (const QString &whatsThis) |
QString | text () const |
QString | toolTip () const |
QString | whatsThis () const |
Static Public Member Functions | |
static void | assign (QPushButton *button, const KGuiItem &item) |
Detailed Description
An abstract class for setting the text, icon, tooltip and WhatsThis data on a GUI item (e.g. a QPushButton).
- See also
- KStandardGuiItem
Definition at line 33 of file kguiitem.h.
Constructor & Destructor Documentation
◆ KGuiItem() [1/4]
KGuiItem::KGuiItem | ( | ) |
Constructs an empty KGuiItem.
You can use the various methods provided by this class to set the text, icon... etc.
Definition at line 39 of file kguiitem.cpp.
◆ KGuiItem() [2/4]
|
explicit |
Constructs a KGuiItem with the provided arguments.
- Parameters
-
text the text to use with the GUI item iconName the name of the icon to display next to the text on the item; QIcon::fromTheme() is used to get a icon with that name from the icon themes available on the system tooltip the tooltip to use for this item whatsThis the text to use for the WhatThis help message
Definition at line 44 of file kguiitem.cpp.
◆ KGuiItem() [3/4]
KGuiItem::KGuiItem | ( | const QString & | text, |
const QIcon & | icon, | ||
const QString & | toolTip = QString(), | ||
const QString & | whatsThis = QString() ) |
Constructs a KGuiItem with the provided arguments.
- Parameters
-
text the text to use with the GUI item icon the QIcon object used to get an icon to display next to the text on this item tooltip the tooltip to use for this item whatsThis the text to use for the WhatThis help message
Definition at line 53 of file kguiitem.cpp.
◆ KGuiItem() [4/4]
|
default |
Constructs a copy of other
.
◆ ~KGuiItem()
|
default |
Destructor.
Member Function Documentation
◆ assign()
|
static |
A static method that can be used to set the text, icon, tooltip and WhatThis properties from item
on button
.
Definition at line 172 of file kguiitem.cpp.
◆ hasIcon()
bool KGuiItem::hasIcon | ( | ) | const |
Returns true
if this GUI item has an icon set for it and false
otherwise.
Definition at line 133 of file kguiitem.cpp.
◆ icon()
QIcon KGuiItem::icon | ( | ) | const |
Returns the icon used by this GUI item.
This will return a null QIcon if no icon was previously set for this item.
Definition at line 101 of file kguiitem.cpp.
◆ iconName()
QString KGuiItem::iconName | ( | ) | const |
Returns the name of the icon used by this GUI item.
This will return an empty string if no icon was previously set for this item.
Definition at line 113 of file kguiitem.cpp.
◆ isEnabled()
bool KGuiItem::isEnabled | ( | ) | const |
Returns true
if this GUI item is enabled and false
otherwise.
- See also
- QWidget::isEnabled()
Definition at line 128 of file kguiitem.cpp.
◆ operator=()
Assigns other
to this KGuiItem object and returns a reference to this object.
◆ plainText()
QString KGuiItem::plainText | ( | ) | const |
Returns the text used by this GUI item after stripping all existing '&' characters which denote keyboard accelerators.
- See also
- text()
Definition at line 73 of file kguiitem.cpp.
◆ setEnabled()
void KGuiItem::setEnabled | ( | bool | enable | ) |
Toggles the enabled property of this GUI item.
- See also
- QWidget::setEnabled()
Definition at line 167 of file kguiitem.cpp.
◆ setIcon()
void KGuiItem::setIcon | ( | const QIcon & | iconset | ) |
Sets the icon to be shown next to the text of this GUI item.
Definition at line 143 of file kguiitem.cpp.
◆ setIconName()
void KGuiItem::setIconName | ( | const QString & | iconName | ) |
Sets the name of the icon that will be shown next to the text of this GUI item.
The actual QIcon will be obtained by using QIcon::fromTheme().
Definition at line 150 of file kguiitem.cpp.
◆ setText()
void KGuiItem::setText | ( | const QString & | text | ) |
Sets the text to use for this GUI item.
Definition at line 138 of file kguiitem.cpp.
◆ setToolTip()
void KGuiItem::setToolTip | ( | const QString & | tooltip | ) |
Sets the tooltip text.
Definition at line 157 of file kguiitem.cpp.
◆ setWhatsThis()
void KGuiItem::setWhatsThis | ( | const QString & | whatsThis | ) |
Sets the WhatThis text.
Definition at line 162 of file kguiitem.cpp.
◆ text()
QString KGuiItem::text | ( | ) | const |
Returns the text used by this GUI item.
This may contain '&' characters which denote a keyboard accelerator shortcut that can be used to invoke the GUI item, e.g. Alt + 'O' for button "&OK". (Note that the '&' is not visible to the user).
You can get the plain text without the accelerator denoting character '&', by using plainText().
Definition at line 68 of file kguiitem.cpp.
◆ toolTip()
QString KGuiItem::toolTip | ( | ) | const |
Returns the tooltip used for this GUI item.
This will return an empty string if no tooltip was previously set for this item.
Definition at line 118 of file kguiitem.cpp.
◆ whatsThis()
QString KGuiItem::whatsThis | ( | ) | const |
Returns the WhatThis text used for this GUI item.
This will return an empty string if no WhatThis text was previously set for this item.
Definition at line 123 of file kguiitem.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.