From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmid/kmidbutton.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 kmid/kmidbutton.h (limited to 'kmid/kmidbutton.h') diff --git a/kmid/kmidbutton.h b/kmid/kmidbutton.h new file mode 100644 index 00000000..cda01f59 --- /dev/null +++ b/kmid/kmidbutton.h @@ -0,0 +1,32 @@ +#include +#include + +class KMidButton : public QPushButton +{ +protected: + + QPixmap pixmap1,pixmap2; + + virtual void drawButton(QPainter *paint) + { + if ((isOn())&&(!pixmap1.isNull())) paint->drawPixmap(0,0,pixmap1); + else if ((!isOn())&&(!pixmap2.isNull())) paint->drawPixmap(0,0,pixmap2); + }; + +public: + + KMidButton (QWidget *parent,const char *name) : QPushButton (parent,name) + { + }; + + ~KMidButton() + { + }; + + void setPixmaps(const QPixmap& p1, const QPixmap& p2) + { + pixmap1=p1; + pixmap2=p2; + }; + +}; -- cgit v1.2.1