File indexing completed on 2023-05-30 10:45:26

0001 /*
0002     SPDX-FileCopyrightText: 2009-2010 Peter Hedlund <peter.hedlund@kdemail.net>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef KWQSCOREWIDGET_H
0007 #define KWQSCOREWIDGET_H
0008 
0009 #include "ui_kwqscorewidgetbase.h"
0010 
0011 #include <QWidget>
0012 
0013 class KWQScoreWidget : public QWidget, public Ui::KWQScoreWidgetBase
0014 {
0015 public:
0016   enum CountDirection {cdCorrect, cdError};
0017   explicit KWQScoreWidget(QWidget *parent);
0018 
0019   void clear();
0020 
0021   void setAsPercent(bool p);
0022   void setQuestionCount(int c);
0023   void countIncrement(CountDirection d);
0024   /* if Mark Last Correct is selected */
0025   void swapCount();
0026 
0027   QString answerText();
0028   QString correctText();
0029   QString errorText();
0030 
0031 private:
0032   bool m_percent;
0033   int m_questionCount;
0034   int m_error;
0035   int m_correct;
0036   int m_answerCount;
0037   QString valueToString(int i);
0038   void update();
0039 };
0040 
0041 #endif // KWQSCOREWIDGET_H