30 class KGuiItem::KGuiItemPrivate
39 KGuiItemPrivate(
const KGuiItemPrivate &rhs )
44 KGuiItemPrivate &
operator=(
const KGuiItemPrivate &rhs )
48 m_iconName = rhs.m_iconName;
49 m_toolTip = rhs.m_toolTip;
50 m_whatsThis = rhs.m_whatsThis;
51 m_statusText = rhs.m_statusText;
52 m_enabled = rhs.m_enabled;
53 m_hasIcon = rhs.m_hasIcon;
70 d =
new KGuiItemPrivate;
76 d =
new KGuiItemPrivate;
86 d =
new KGuiItemPrivate;
107 d =
new KGuiItemPrivate( *rhs.d );
125 const int len = d->m_text.length();
133 int resultLength = 0;
134 stripped.resize(len);
136 const QChar* data = d->m_text.unicode();
137 for (
int pos = 0; pos < len; ++pos )
139 if ( data[ pos ] !=
'&' )
140 stripped[ resultLength++ ] = data[ pos ];
141 else if ( pos + 1 < len && data[ pos + 1 ] ==
'&' )
142 stripped[ resultLength++ ] = data[ pos++ ];
145 stripped.truncate(resultLength);
154 if (!d->m_iconName.isEmpty()) {
164 #ifndef KDE_NO_DEPRECATED 168 if( !d->m_iconName.isEmpty()) {
170 return iconLoader->
loadIconSet( d->m_iconName, group, size );
181 return d->m_iconName;
191 return d->m_whatsThis;
212 d->m_iconName.clear();
213 d->m_hasIcon = !icon.isNull();
220 d->m_hasIcon = !iconName.isEmpty();
235 d->m_enabled = enabled;
QString whatsThis() const
static KIconLoader * global()
Returns the global icon loader initialized with the global KComponentData.
void setText(const QString &text)
void setToolTip(const QString &tooltip)
An abstract class for GUI data such as ToolTip and Icon.
QIcon iconSet(KIconLoader::Group=KIconLoader::Small, int size=0) const
QString plainText() const
A wrapper around QIcon that provides KDE icon features.
void setEnabled(bool enable)
void setIconName(const QString &iconName)
Group
The group of the icon.
const KComponentData & mainComponent()
void setWhatsThis(const QString &whatsThis)
QIcon loadIconSet(const QString &name, KIconLoader::Group group, int size=0, bool canReturnNull=false)
Creates an icon set, that will do on-demand loading of the icon.
void setIcon(const KIcon &iconset)
KGuiItem & operator=(const KGuiItem &rhs)