kicon and qicon are treated differnetly internally by KPushButton, so we unforunately we need to provide an overload here
svn path=/trunk/KDE/kdelibs/; revision=1022998
This commit is contained in:
parent
1b53393043
commit
f2af7e8087
@ -262,11 +262,16 @@ QAction *PushButton::action() const
|
||||
return d->action;
|
||||
}
|
||||
|
||||
void PushButton::setIcon(const QIcon &icon)
|
||||
void PushButton::setIcon(const KIcon &icon)
|
||||
{
|
||||
nativeWidget()->setIcon(icon);
|
||||
}
|
||||
|
||||
void PushButton::setIcon(const QIcon &icon)
|
||||
{
|
||||
setIcon(KIcon(icon));
|
||||
}
|
||||
|
||||
QIcon PushButton::icon() const
|
||||
{
|
||||
return nativeWidget()->icon();
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include <QtGui/QGraphicsProxyWidget>
|
||||
|
||||
#include <kicon.h>
|
||||
|
||||
class KPushButton;
|
||||
|
||||
#include <plasma/plasma_export.h>
|
||||
@ -46,6 +48,7 @@ class PLASMA_EXPORT PushButton : public QGraphicsProxyWidget
|
||||
Q_PROPERTY(QString stylesheet READ styleSheet WRITE setStyleSheet)
|
||||
Q_PROPERTY(KPushButton *nativeWidget READ nativeWidget)
|
||||
Q_PROPERTY(QAction *action READ action WRITE setAction)
|
||||
Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
|
||||
|
||||
public:
|
||||
explicit PushButton(QGraphicsWidget *parent = 0);
|
||||
@ -116,12 +119,21 @@ public:
|
||||
/**
|
||||
* sets the icon for this push button
|
||||
*
|
||||
* @arg icon the icon we want to use
|
||||
* @arg icon the icon to use
|
||||
*
|
||||
* @since 4.3
|
||||
*/
|
||||
void setIcon(const QIcon &icon);
|
||||
|
||||
/**
|
||||
* sets the icon for this push button using a KIcon
|
||||
*
|
||||
* @arg icon the icon to use
|
||||
*
|
||||
* @since 4.4
|
||||
*/
|
||||
void setIcon(const KIcon &icon);
|
||||
|
||||
/**
|
||||
* @return the icon of this button
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user