moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kbruch / src / statisticsview.h
blob9de0c24d2adf7216278d84290cbaf6ff33a808c5
1 /***************************************************************************
2 statisticsview.cpp - Header File
3 -------------------
4 begin : Tue Mar 08 17:20:00 CET 2002
5 copyright : (C) 2001 - 2004 by Sebastian Stein, Eva Brucherseifer
6 email : seb.kde@hpfsc.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #ifndef STATISTICSVIEW_H
19 #define STATISTICSVIEW_H
21 class QLabel;
22 class QPushButton;
23 class QVBoxLayout;
24 class QHBoxLayout;
25 class QGridLayout;
27 #include <qwidget.h>
29 /*!
30 * StatisticsView takes care of the statistics of a test.
31 * It saves the number of correct and wrong answers and
32 * displays this data to the user.
33 * \author Sebastian Stein
34 * \author Eva Brucherseifer
37 class StatisticsView : public QWidget
39 Q_OBJECT
41 public:
42 /** constructor */
43 StatisticsView(QWidget * parent = 0, const char * name = 0);
45 /** destructor */
46 ~StatisticsView();
48 public slots:
49 /** increment number of correct answers */
50 void addCorrect();
52 /** increment number of wrong answers */
53 void addWrong();
55 /** set statistics to zero.
56 * Triggered by internal button or when a new test is started
58 void resetStatistics();
59 private:
60 /** calculate percentages and update view */
61 void calc();
63 unsigned int m_count;
64 unsigned int m_correct;
66 QPushButton * resetBtn;
67 QHBoxLayout * buttonLayout;
68 QVBoxLayout * layout1;
69 QGridLayout * labelGrid;
70 QLabel * result1Label;
71 QLabel * result2Label;
72 QLabel * result3Label;
73 QLabel * info1Label;
74 QLabel * info2Label;
75 QLabel * info3Label;
78 #endif