00001 /************************************************************************** 00002 00003 Chess Clock 00004 00005 Copyright (c) Arto Hyvättinen 2010 00006 00007 This file is part of Chess Clock software. 00008 00009 Chess Clock is free software: you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation, either version 3 of the License, or 00012 (at your option) any later version. 00013 00014 Chess Clock is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 00020 **************************************************************************/ 00021 00022 #ifndef CHESSCLOCKWIDGET_H 00023 #define CHESSCLOCKWIDGET_H 00024 00025 #include "chessclock.h" 00026 #include <QPixmap> 00027 #include <QString> 00028 00029 class QVBoxLayout; 00030 class QLabel; 00031 00039 class ChessClockWidget : public ChessClock 00040 { 00041 Q_OBJECT 00042 public: 00043 ChessClockWidget(bool white, QWidget *parent = 0); 00044 00045 signals: 00046 00047 public slots: 00048 virtual void repaintClock(); 00049 00050 protected: 00052 virtual void initPictures(); 00054 virtual void initLabels(); 00056 virtual void initTop(); 00059 virtual void initBottom(); 00060 00062 QString timeString(int msecs); 00063 00064 protected: 00065 00066 QPixmap picActive_; 00067 QPixmap picPassive_; 00068 QPixmap picLoser_; 00069 00070 QLabel* pictureLabel_; 00071 QLabel* timeUsedLabel_; 00072 QLabel* timeAverageLabel_; 00073 QLabel* turnLabel_; 00074 QLabel* loserLabel_; 00075 QLabel* leftLabel_; 00076 00077 QVBoxLayout* mainLayout; 00078 00079 00080 }; 00081 00082 #endif // CHESSCLOCKWIDGET_H