summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/kguiitem.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdeui/kguiitem.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kdeui/kguiitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/kguiitem.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/microkde/kdeui/kguiitem.cpp b/microkde/kdeui/kguiitem.cpp
index 828c5e6..c91ffb7 100644
--- a/microkde/kdeui/kguiitem.cpp
+++ b/microkde/kdeui/kguiitem.cpp
@@ -11,25 +11,25 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qregexp.h>
#include <qstring.h>
-#include <qiconset.h>
+#include <qicon.h>
#include <qpixmap.h>
#include <assert.h>
//US #include <kiconloader.h>
#include <kdebug.h>
#include "kguiitem.h"
class KGuiItem::KGuiItemPrivate
{
public:
KGuiItemPrivate()
@@ -53,45 +53,45 @@ public:
m_statusText = rhs.m_statusText;
m_enabled = rhs.m_enabled;
m_hasIcon = rhs.m_hasIcon;
return *this;
}
QString m_text;
QString m_toolTip;
QString m_whatsThis;
QString m_statusText;
QString m_iconName;
- QIconSet m_iconSet;
+ QIcon m_iconSet;
bool m_hasIcon : 1;
bool m_enabled : 1;
};
KGuiItem::KGuiItem() {
d = new KGuiItemPrivate;
}
KGuiItem::KGuiItem( const QString &text, const QString &iconName,
const QString &toolTip, const QString &whatsThis )
{
d = new KGuiItemPrivate;
d->m_text = text;
d->m_toolTip = toolTip;
d->m_whatsThis = whatsThis;
setIconName( iconName );
}
-KGuiItem::KGuiItem( const QString &text, const QIconSet &iconSet,
+KGuiItem::KGuiItem( const QString &text, const QIcon &iconSet,
const QString &toolTip, const QString &whatsThis )
{
d = new KGuiItemPrivate;
d->m_text = text;
d->m_toolTip = toolTip;
d->m_whatsThis = whatsThis;
setIconSet( iconSet );
}
KGuiItem::KGuiItem( const KGuiItem &rhs )
: d( 0 )
{
@@ -115,49 +115,49 @@ KGuiItem::~KGuiItem() {
}
QString KGuiItem::text() const {
return d->m_text;
}
QString KGuiItem::plainText() const {
QString stripped( d->m_text );
stripped.replace( QRegExp( "&(?!&)" ), QString::null );
return stripped;
}
-QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const
+QIcon KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const
{
if( d->m_hasIcon )
{
if( !d->m_iconName.isEmpty())
{
// some caching here would(?) come handy
//US return instance->iconLoader()->loadIconSet( d->m_iconName, group, size );
return KGlobal::iconLoader()->loadIconSet( d->m_iconName);
// here is a little problem that with delayed icon loading
// we can't check if the icon really exists ... so what ...
// if( set.isNull() )
// {
// d->m_hasIcon = false;
// return QIconSet();
// }
// return set;
}
else
{
return d->m_iconSet;
}
}
else
- return QIconSet();
+ return QIcon();
}
QString KGuiItem::iconName() const
{
return d->m_iconName;
}
QString KGuiItem::toolTip() const {
return d->m_toolTip;
}
QString KGuiItem::whatsThis() const {
return d->m_whatsThis;
@@ -168,35 +168,35 @@ bool KGuiItem::isEnabled() const
return d->m_enabled;
}
bool KGuiItem::hasIcon() const
{
return d->m_hasIcon;
}
void KGuiItem::setText( const QString &text ) {
d->m_text=text;
}
-void KGuiItem::setIconSet( const QIconSet &iconset )
+void KGuiItem::setIconSet( const QIcon &iconset )
{
d->m_iconSet = iconset;
d->m_iconName = QString::null;
d->m_hasIcon = !iconset.isNull();
}
void KGuiItem::setIconName( const QString &iconName )
{
d->m_iconName = iconName;
- d->m_iconSet = QIconSet();
+ d->m_iconSet = QIcon();
d->m_hasIcon = !iconName.isEmpty();
}
void KGuiItem::setToolTip( const QString &toolTip) {
d->m_toolTip = toolTip;
}
void KGuiItem::setWhatsThis( const QString &whatsThis ) {
d->m_whatsThis = whatsThis;
}
void KGuiItem::setEnabled( bool enabled ){
d->m_enabled = enabled;
}