1 /**************************************************************************
5 Copyright (c) Arto Hyvättinen 2010
7 This file is part of Chess Clock software.
9 Chess Clock is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Chess Clock is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
20 **************************************************************************/
22 #ifndef CHESSCLOCKWIDGET_H
23 #define CHESSCLOCKWIDGET_H
25 #include "chessclock.h"
32 /*! Simple chess clock widget
34 @author Arto Hyvättinen
39 class ChessClockWidget : public ChessClock
43 ChessClockWidget(bool white, QWidget *parent = 0);
44 /*! Set time begin of turn shown green.
46 Extra time of turn is shown green.
47 @param msecs Green time in msecs
49 void setGreenTime(int msecs);
54 virtual void repaintClock();
57 /*! Init pictures from resources */
58 virtual void initPictures();
60 virtual void initLabels();
61 /*! Init top: picture, details, loser mark */
62 virtual void initTop();
63 /*! Init time left in bottom.
64 Override to make different bottom area */
65 virtual void initBottom();
67 /*! Convert msecs to h:mm:ss QString */
68 static QString timeString(int msecs);
76 QLabel* pictureLabel_;
77 QLabel* timeUsedLabel_;
78 QLabel* timeAverageLabel_;
80 QLabel* turnTimeLabel_;
84 QVBoxLayout* mainLayout;
86 int greenTime_; /*! Green time in begin of turn */
91 #endif // CHESSCLOCKWIDGET_H