Chronometre.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Chronometre.h
  3. * This file is part of ChronoCheckMate
  4. *
  5. * Copyright (C) 2010 - François Drouhard
  6. *
  7. * ChronoCheckMate is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * ChronoCheckMate is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with ChronoCheckMate; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor,
  20. * Boston, MA 02110-1301 USA
  21. */
  22. #ifndef DEF_CHRONOMETRE
  23. #define DEF_CHRONOMETRE
  24. #include <QTimer>
  25. #include <QWidget>
  26. #include <QLCDNumber>
  27. #include <QObject>
  28. #include <QHBoxLayout>
  29. #include <QGroupBox>
  30. class Chronometre : public QGroupBox {
  31. Q_OBJECT
  32. public:
  33. Chronometre (const QString & nom , QWidget * parent);
  34. int getHeure ();
  35. int getMinute ();
  36. int getSeconde ();
  37. int getCentieme ();
  38. void start ();
  39. void stop ();
  40. void affichage ();
  41. void reinit ();
  42. void basculer ();
  43. private slots:
  44. void refresh ();
  45. private:
  46. int heure;
  47. int minute;
  48. int seconde;
  49. int centieme;
  50. QTimer *timer;
  51. QHBoxLayout *ecranLayout;
  52. QLCDNumber *ecranHeure;
  53. QLCDNumber *ecranMinute;
  54. QLCDNumber *ecranSeconde;
  55. QLCDNumber *ecranCentieme;
  56. };
  57. #endif