promoe/PixWidget.cpp
2006-02-15 21:09:38 -03:00

31 lines
491 B
C++

#include "PixWidget.h"
PixWidget::PixWidget (QWidget *parent) : QWidget (parent)
{
m_pixmap = QPixmap(0,0);
}
PixWidget::~PixWidget ()
{
}
/*
* Since almost every Widget I have here
* is done by drawing self.pixmap onto self
* we define this a generic PaintEvent handler
*/
void
PixWidget::paintEvent (QPaintEvent *event)
{
if (m_pixmap.isNull ()) {
return;
}
QPainter (paint);
paint.begin (this);
paint.drawPixmap (rect (), m_pixmap, m_pixmap.rect ());
paint.end ();
}