QTfrontend/statsPage.cpp
changeset 1636 e528696f2177
parent 1625 37aae47943ce
child 1637 897b37fc4966
--- a/QTfrontend/statsPage.cpp	Sat Jan 10 15:45:15 2009 +0000
+++ b/QTfrontend/statsPage.cpp	Sat Jan 10 15:48:02 2009 +0000
@@ -19,10 +19,19 @@
 #include <QLabel>
 #include <QGridLayout>
 #include <QGraphicsScene>
-#include <QGraphicsView>
 
 #include "statsPage.h"
 
+FitGraphicsView::FitGraphicsView(QWidget* parent) : QGraphicsView(parent)
+{
+
+}
+
+void FitGraphicsView::resizeEvent(QResizeEvent * event)
+{
+	fitInView(sceneRect());
+}
+
 PageGameStats::PageGameStats(QWidget* parent) : AbstractPage(parent)
 {
 	QFont * font14 = new QFont("MS Shell Dlg", 14);
@@ -37,7 +46,7 @@
 	labelGameStats->setTextFormat(Qt::RichText);
 	pageLayout->addWidget(labelGameStats, 0, 0, 1, 3);
 
-	graphic = new QGraphicsView(this);
+	graphic = new FitGraphicsView(this);
 	graphic->scale(1.0, -1.0);
 	pageLayout->addWidget(graphic, 1, 0, 1, 3);
 }
@@ -76,7 +85,6 @@
 	}
 
 	graphic->setScene(scene);
-	graphic->fitInView(graphic->sceneRect());
 }
 
 void PageGameStats::GameStats(char type, const QString & info)