icon() and setIcon() in the api, pretty foundamental in a tool button...

svn path=/trunk/KDE/kdelibs/; revision=913027
This commit is contained in:
Marco Martin 2009-01-18 17:28:04 +00:00
parent 53658a106e
commit 88abeaf783
2 changed files with 22 additions and 0 deletions

View File

@ -209,6 +209,16 @@ void ToolButton::setImage(const QString &path)
d->setPixmap(this); d->setPixmap(this);
} }
void ToolButton::setIcon(const QIcon &icon)
{
nativeWidget()->setIcon(icon);
}
QIcon ToolButton::icon() const
{
return nativeWidget()->icon();
}
QString ToolButton::image() const QString ToolButton::image() const
{ {
return d->imagePath; return d->imagePath;

View File

@ -104,6 +104,18 @@ public:
*/ */
QToolButton *nativeWidget() const; QToolButton *nativeWidget() const;
/**
* sets the icon for this toolbutton
*
* @arg icon the icon we want to use
*/
void setIcon(const QIcon &icon);
/**
* @return the icon of this button
*/
QIcon icon() const;
Q_SIGNALS: Q_SIGNALS:
void clicked(); void clicked();