summaryrefslogtreecommitdiffstats
path: root/kbruch/src/statisticsview.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch)
treed3bb9f5d25a2dc09ca81adecf39621d871534297 /kbruch/src/statisticsview.h
downloadtdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz
tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbruch/src/statisticsview.h')
-rw-r--r--kbruch/src/statisticsview.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/kbruch/src/statisticsview.h b/kbruch/src/statisticsview.h
new file mode 100644
index 00000000..9de0c24d
--- /dev/null
+++ b/kbruch/src/statisticsview.h
@@ -0,0 +1,78 @@
+/***************************************************************************
+ statisticsview.cpp - Header File
+ -------------------
+ begin : Tue Mar 08 17:20:00 CET 2002
+ copyright : (C) 2001 - 2004 by Sebastian Stein, Eva Brucherseifer
+ email : seb.kde@hpfsc.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef STATISTICSVIEW_H
+#define STATISTICSVIEW_H
+
+class QLabel;
+class QPushButton;
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+
+#include <qwidget.h>
+
+/*!
+ * StatisticsView takes care of the statistics of a test.
+ * It saves the number of correct and wrong answers and
+ * displays this data to the user.
+ * \author Sebastian Stein
+ * \author Eva Brucherseifer
+ */
+
+class StatisticsView : public QWidget
+{
+ Q_OBJECT
+
+public:
+ /** constructor */
+ StatisticsView(QWidget * parent = 0, const char * name = 0);
+
+ /** destructor */
+ ~StatisticsView();
+
+public slots:
+ /** increment number of correct answers */
+ void addCorrect();
+
+ /** increment number of wrong answers */
+ void addWrong();
+
+ /** set statistics to zero.
+ * Triggered by internal button or when a new test is started
+ */
+ void resetStatistics();
+private:
+ /** calculate percentages and update view */
+ void calc();
+
+ unsigned int m_count;
+ unsigned int m_correct;
+
+ QPushButton * resetBtn;
+ QHBoxLayout * buttonLayout;
+ QVBoxLayout * layout1;
+ QGridLayout * labelGrid;
+ QLabel * result1Label;
+ QLabel * result2Label;
+ QLabel * result3Label;
+ QLabel * info1Label;
+ QLabel * info2Label;
+ QLabel * info3Label;
+};
+
+#endif