loadSettings();
- QWidget *centralWidget = new QWidget(this);
+ centralWidget = new QWidget(this);
setCentralWidget(centralWidget);
viewCourseAct = new QAction(tr("&View Courses"), this);
connect(viewCourseAct, SIGNAL(triggered()), this, SLOT(viewCourse()));
-
- viewStatisticAct = new QAction(tr("&View Statistics"), this);
- connect(viewStatisticAct, SIGNAL(triggered()), this, SLOT(viewStatistic()));
#endif
+ statAct = new QAction(tr("Statistics"), this);
+ connect(statAct, SIGNAL(triggered()), this, SLOT(viewStatistics()));
+
nextAct = new QAction(tr( " Next "), this);
connect(nextAct, SIGNAL(triggered()), this, SLOT(nextButtonClicked()));
menu->addAction(newCourseAct);
menu->addAction(editScoreAct);
menu->addAction(editCourseAct);
+ menu->addAction(statAct);
}
void MainWindow::updateStatusBar()
}
}
+void MainWindow::viewStatistics()
+{
+ QMainWindow *statWindow = new QMainWindow(this);
+
+ //QWidget *centralWidget = new QWidget(statWindow);
+
+ //setCentralWidget(centralWidget);
+
+
+ QString foo = "some longer text is needed here : 17";
+ QTextEdit *textEdit = new QTextEdit(foo);
+
+ QLabel *label = new QLabel;
+ label->setScaledContents(true);
+
+ QString text = "foo : bar";
+
+ text.append("Scores: 17");
+
+ label->setAlignment(Qt::AlignCenter);
+ label->setText(text);
+
+ QString title = "Statistics";
+ statWindow->setWindowTitle(title);
+
+ QVBoxLayout *layout = new QVBoxLayout;
+ //layout->addWidget(label);
+ layout->addWidget(textEdit);
+
+ //statWindow->setLayout(layout);
+
+ //setCentralWidget(statWindow);
+ statWindow->show();
+}
+
void MainWindow::loadScoreFile(QString &fileName, QList<Score *> &list)
{
ScoreXmlHandler handler(list);