QTfrontend/SquareLabel.cpp
changeset 310 b95fd124cb09
parent 184 f97a7a3dc8f6
child 1066 1f1b3686a2b0
--- a/QTfrontend/SquareLabel.cpp	Sun Jan 07 17:48:18 2007 +0000
+++ b/QTfrontend/SquareLabel.cpp	Sun Jan 07 22:54:08 2007 +0000
@@ -21,7 +21,7 @@
 #include "SquareLabel.h"
 
 SquareLabel::SquareLabel(QWidget * parent) :
-  QLabel(parent)
+	QWidget(parent)
 {
 
 }
@@ -37,5 +37,11 @@
 		pixsize = width();
 		painter.translate(0, (height() - pixsize) / 2);
 	}
-	painter.drawPixmap(0, 0, pixsize, pixsize, pixmap()->scaled(pixsize, pixsize, Qt::KeepAspectRatio));
+	painter.drawPixmap(0, 0, pixsize, pixsize, pixmap.scaled(pixsize, pixsize, Qt::KeepAspectRatio));
 }
+
+void SquareLabel::setPixmap(const QPixmap & pixmap)
+{
+	this->pixmap = pixmap;
+	repaint();
+}