From 88abeaf783c40e37ab0fdd9b976bbf5fdcd4331e Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sun, 18 Jan 2009 17:28:04 +0000 Subject: [PATCH] icon() and setIcon() in the api, pretty foundamental in a tool button... svn path=/trunk/KDE/kdelibs/; revision=913027 --- widgets/toolbutton.cpp | 10 ++++++++++ widgets/toolbutton.h | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index 3098023e0..5b426eabb 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -209,6 +209,16 @@ void ToolButton::setImage(const QString &path) d->setPixmap(this); } +void ToolButton::setIcon(const QIcon &icon) +{ + nativeWidget()->setIcon(icon); +} + +QIcon ToolButton::icon() const +{ + return nativeWidget()->icon(); +} + QString ToolButton::image() const { return d->imagePath; diff --git a/widgets/toolbutton.h b/widgets/toolbutton.h index d1ff78571..fc08c11cc 100644 --- a/widgets/toolbutton.h +++ b/widgets/toolbutton.h @@ -104,6 +104,18 @@ public: */ 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: void clicked();