12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- /*
- * Chronometre.h
- * This file is part of ChronoCheckMate
- *
- * Copyright (C) 2010 - François Drouhard
- *
- * ChronoCheckMate 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.
- *
- * ChronoCheckMate is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ChronoCheckMate; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301 USA
- */
-
- #ifndef DEF_CHRONOMETRE
- #define DEF_CHRONOMETRE
-
- #include <QWidget>
- #include <QTime>
- class QGroupBox;
- class QLabel;
- class QHBoxLayout;
- class QTimer;
- class QString;
- class QPixmap;
- #define INTERVAL 1 // vitesse de défilement (1000ème de secondes)
- enum Couleur {
- Blanc,
- Noir,
- };
- enum Placement {
- Gauche,
- Droite
- };
- class Chronometre : public QWidget {
-
- Q_OBJECT
-
- public:
- Chronometre (const QString & nom , Couleur unecouleur, QTime const& tempsDepart, Placement placement = Placement::Gauche, QWidget * parent = nullptr);
- void start ();
- void stop ();
- void affichage ();
- void reinit ();
- void basculer ();
- void basculer (Chronometre & Chrono);
- void echangerCouleur (Chronometre & chrono);
- void setCouleur (Couleur const& color);
- Couleur getCouleur () const;
- void modifierNomJoueur (QString const& joueur);
- void definirTemps (QTime const& tempsDepart);
- QString operator+=(Chronometre const& joueur) const;
- void addSecs (unsigned int secondes);
- signals:
- void fin();
- void is_paused(Chronometre *chrono);
- private slots:
- void refresh ();
-
- private:
- QLabel *labelPion;
- Couleur couleur;
- QGroupBox *groupBox;
- QPixmap *pion;
- QTime temps;
- QTime msTempsDepart;
- QTimer *timer;
- QHBoxLayout *ecranLayout;
- QLabel *ecranTemps;
- };
- #endif
|