Added a new widget pixmapbutton, which will be the new baseclass for all

buttons used in promoe
This commit is contained in:
Thomas Frauendorfer 2008-01-27 07:54:47 +01:00
parent b7ae919014
commit e2fdb4e009
3 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,30 @@
#include "pixmapbutton.h"
#include <QIcon>
#include <QPainter>
#include <QPaintEvent>
#include <QPixmap>
PixmapButton::PixmapButton (QWidget *parent) : QAbstractButton (parent)
{
}
PixmapButton::~PixmapButton ()
{
}
void
PixmapButton::paintEvent( QPaintEvent * event )
{
QPixmap pixmap = icon().pixmap (size(),
isDown() ? QIcon::Active : QIcon::Normal,
isChecked() ? QIcon::On : QIcon::Off);
QPainter p;
p.begin(this);
p.drawPixmap( rect(), pixmap, pixmap.rect() );
p.end();
}