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

KDEUI

  • kdeui
  • util
kguiitem.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2001 Holger Freyther (freyher@yahoo.com)
3 based on ideas from Martijn and Simon
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18
19 Many thanks to Simon tronical Hausmann
20*/
21
22#ifndef kguiitem_h
23#define kguiitem_h
24
25#include <QtCore/QString>
26
27#include <kicontheme.h>
28#include <kicon.h>
29
36class KDEUI_EXPORT KGuiItem
37{
38public:
39 KGuiItem();
40
41 // This is explicit because it's easy to get subtle bugs otherwise. The
42 // icon name, tooltip and whatsthis text get changed behind your back if
43 // you do 'setButtonFoo( "Bar" );' It gives the wrong impression that you
44 // just change the text.
45 explicit KGuiItem( const QString &text,
46 const QString &iconName = QString(),
47 const QString &toolTip = QString(),
48 const QString &whatsThis = QString() );
49
50 KGuiItem( const QString &text, const KIcon &icon,
51 const QString &toolTip = QString(),
52 const QString &whatsThis = QString() );
53
54 KGuiItem( const KGuiItem &rhs );
55 KGuiItem &operator=( const KGuiItem &rhs );
56
57 ~KGuiItem();
58
59 QString text() const;
60 QString plainText() const;
61
63#ifndef KDE_NO_DEPRECATED
64 KDE_DEPRECATED QIcon iconSet( KIconLoader::Group=KIconLoader::Small, int size = 0) const;
65#endif
66
67 KIcon icon( ) const;
68
69 QString iconName() const;
70 QString toolTip() const;
71 QString whatsThis() const;
72 bool isEnabled() const;
73 bool hasIcon() const;
74#if !defined(KDE_NO_COMPAT) && !defined(KDE_NO_DEPRECATED)
75 KDE_DEPRECATED bool hasIconSet() const { return hasIcon(); }
76#endif
77
78 void setText( const QString &text );
79 void setIcon( const KIcon &iconset );
80 void setIconName( const QString &iconName );
81 void setToolTip( const QString &tooltip );
82 void setWhatsThis( const QString &whatsThis );
83 void setEnabled( bool enable );
84
85private:
86 class KGuiItemPrivate;
87 KGuiItemPrivate *d; //krazy:exclude=dpointer (implicitly shared)
88};
89
90/* vim: et sw=4
91 */
92
93#endif
94
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:37
KGuiItem::hasIconSet
bool hasIconSet() const
Definition: kguiitem.h:75
KIconLoader::Group
Group
The group of the icon.
Definition: kiconloader.h:127
KIconLoader::Small
@ Small
Small icons, e.g. for buttons.
Definition: kiconloader.h:139
KIcon
A wrapper around QIcon that provides KDE icon features.
Definition: kicon.h:41
kicon.h
kicontheme.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