1 /**************************************************************************
5 This file is part of Chess Clock software.
7 (This file) Copyright (c) Heli Hyvättinen 2011
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 **************************************************************************/
23 #include "wrappedclockswidget.h"
26 WrappedClocksWidget::WrappedClocksWidget(QObject *parent) :
27 QGraphicsProxyWidget(parent)
29 pClocksWidget_ = NULL;
34 WrappedClocksWidget::startGame(QString timeControl, int whiteInitialTime, int whiteAdditionalTime, int whiteTurnsPerAddition, int blackInitialTime, int blackAdditionalTime, int blackTurnsPerAddition)
39 pWhiteClock_ = new ChessClockWidget(true);
40 pWhiteClock_->setTimeAvailable(whiteInitialTime);
42 pBlackClock_ = new ChessClockWidget(false);
43 pBlackClock_->setTimeAvailable(blackInitialTime);
45 pClocksWidget_ = new ClocksWidget(pWhiteClock_, pBlackClock_);
48 pClocksWidget_->setAttribute(Qt::WA_NoSystemBackground);
49 setWidget(pClocksWidget_);
54 WrappedClocksWidget::~WrappedClocksWidget()
59 WrappedClocksWidget::isPlayStarted()
64 return pClocksWidget_->isPlayStarted();
67 WrappedClocksWidget::deleteOldWidgets()
71 delete pClocksWidget_;
72 pClocksWidget_ = NULL;