You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MorseStat.h 744B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef MORSESTAT_H
  2. #define MORSESTAT_H
  3. #include <QObject>
  4. #include <QtCore/QSettings>
  5. class MorseStat : public QObject
  6. {
  7. Q_OBJECT
  8. public:
  9. explicit MorseStat(QObject *parent = 0);
  10. const int maxTimeCount;
  11. float getAverageTime();
  12. int getTryCount();
  13. int getGoodCount();
  14. int getGoodPercentage(int minStartingGood = 0);
  15. void addStat(float newtime, bool successful);
  16. private:
  17. void addTime(float newtime);
  18. signals:
  19. public slots:
  20. void saveStats(QSettings &settings, const QString &statSetName);
  21. void loadStats(QSettings &settings, const QString &statSetName);
  22. private:
  23. int m_tryCount;
  24. int m_goodCount;
  25. QList<float> m_timeList;
  26. };
  27. #endif // MORSESTAT_H