use QIcon in the public API
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=698752
This commit is contained in:
parent
777d23d06b
commit
b80d526229
@ -285,7 +285,7 @@ Icon::Icon(const QString &text, QGraphicsItem *parent)
|
||||
init();
|
||||
}
|
||||
|
||||
Icon::Icon(const KIcon &icon, const QString &text, QGraphicsItem *parent)
|
||||
Icon::Icon(const QIcon &icon, const QString &text, QGraphicsItem *parent)
|
||||
: Plasma::Widget(parent),
|
||||
d(new Private)
|
||||
{
|
||||
@ -871,7 +871,7 @@ QString Icon::infoText() const
|
||||
return d->infoText;
|
||||
}
|
||||
|
||||
KIcon Icon::icon() const
|
||||
QIcon Icon::icon() const
|
||||
{
|
||||
return d->icon;
|
||||
}
|
||||
@ -879,14 +879,14 @@ KIcon Icon::icon() const
|
||||
void Icon::setIcon(const QString& icon)
|
||||
{
|
||||
if (icon.isEmpty()) {
|
||||
setIcon(KIcon());
|
||||
setIcon(QIcon());
|
||||
return;
|
||||
}
|
||||
|
||||
setIcon(KIcon(icon));
|
||||
setIcon(QIcon(icon));
|
||||
}
|
||||
|
||||
void Icon::setIcon(const KIcon& icon)
|
||||
void Icon::setIcon(const QIcon& icon)
|
||||
{
|
||||
d->icon = icon;
|
||||
calculateSize();
|
||||
|
@ -23,8 +23,7 @@
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtGui/QGraphicsTextItem>
|
||||
|
||||
#include <KDE/KIcon>
|
||||
#include <QtGui/QIcon>
|
||||
|
||||
#include <plasma/dataengine.h>
|
||||
#include <plasma/phase.h>
|
||||
@ -50,7 +49,7 @@ class PLASMA_EXPORT Icon : public Plasma::Widget
|
||||
Q_OBJECT
|
||||
Q_PROPERTY( QString text READ text WRITE setText )
|
||||
Q_PROPERTY( QString infoText READ infoText WRITE setInfoText )
|
||||
Q_PROPERTY( KIcon icon READ icon WRITE setIcon )
|
||||
Q_PROPERTY( QIcon icon READ icon WRITE setIcon )
|
||||
Q_PROPERTY( QSizeF iconSize READ iconSize WRITE setIconSize )
|
||||
public:
|
||||
/**
|
||||
@ -72,7 +71,7 @@ public:
|
||||
* @param text the text that will be displayed with this icon.
|
||||
* @param parent The QGraphicsItem this icon is parented to.
|
||||
*/
|
||||
Icon(const KIcon & icon, const QString &text, QGraphicsItem *parent = 0);
|
||||
Icon(const QIcon &icon, const QString &text, QGraphicsItem *parent = 0);
|
||||
|
||||
/**
|
||||
* Destroys this Plasma::Icon.
|
||||
@ -105,13 +104,13 @@ public:
|
||||
/**
|
||||
* @return the icon associated with this icon.
|
||||
*/
|
||||
KIcon icon() const;
|
||||
QIcon icon() const;
|
||||
|
||||
/**
|
||||
* Sets the graphical icon for this Plasma::Icon.
|
||||
* @param icon the KIcon to associate with this icon.
|
||||
*/
|
||||
void setIcon(const KIcon& icon);
|
||||
void setIcon(const QIcon& icon);
|
||||
|
||||
/**
|
||||
* Convenience method to set the icon of this Plasma::Icon
|
||||
|
@ -22,12 +22,11 @@
|
||||
|
||||
#include <QtCore/QEvent>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtGui/QStyleOptionGraphicsItem>
|
||||
#include <QtGui/QTextLayout>
|
||||
#include <QtGui/QTextOption>
|
||||
|
||||
#include <KIcon>
|
||||
|
||||
#include <plasma/plasma_export.h>
|
||||
#include <plasma/svg.h>
|
||||
|
||||
@ -170,7 +169,7 @@ public:
|
||||
int svgElements;
|
||||
QSizeF size;
|
||||
QSizeF iconSize;
|
||||
KIcon icon;
|
||||
QIcon icon;
|
||||
ButtonState state;
|
||||
Qt::Orientation orientation;
|
||||
bool calculateSizeRequested;
|
||||
|
Loading…
Reference in New Issue
Block a user