Cute Chess 0.1
gamerepetitionspinbox.h
1/*
2 This file is part of Cute Chess.
3 Copyright (C) 2008-2018 Cute Chess authors
4
5 Cute Chess is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Cute Chess is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef GAMEREPETITIONSPINBOX_H
20#define GAMEREPETITIONSPINBOX_H
21
22#include <QSpinBox>
23#include <QRadioButton>
24#include <QPointer>
25
27{
28 Q_OBJECT
29
30 public:
32 explicit GameRepetitionSpinBox(QWidget *parent = nullptr);
33
34 // Inherited from QSpinBox
35 virtual QValidator::State validate(QString & input, int & pos) const override;
36 virtual void fixup(QString & input) const override;
37 virtual void stepBy(int steps) override;
38
39 public slots:
46 void setGamesPerEncounter(int gamesPerEncounter);
53 void setRounds(int rounds);
60 void setTournamentType(const QString& tournamentType);
61
62 private:
63 int limit() const;
64 QValidator::State examine(int value) const;
65
66 int m_gamesPerEncounter;
67 int m_rounds;
68 QString m_tournamentType;
69};
70
71#endif // GAMEREPETITIONSPINBOX_H
Definition: gamerepetitionspinbox.h:27
void setGamesPerEncounter(int gamesPerEncounter)
Definition: gamerepetitionspinbox.cpp:28
GameRepetitionSpinBox(QWidget *parent=nullptr)
Definition: gamerepetitionspinbox.cpp:21
void setTournamentType(const QString &tournamentType)
Definition: gamerepetitionspinbox.cpp:42
void setRounds(int rounds)
Definition: gamerepetitionspinbox.cpp:35