1 /* ColorCode, a free MasterMind clone with built in solver
2 * Copyright (C) 2009 Dirk Laebisch
3 * http://www.laebisch.com/
4 *
5 * ColorCode is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * ColorCode is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include <QtWidgets>
20 #include "gamenodisplay.h"
21 #include "settings.h"
22
23 using namespace std;
24
GameNoDisplay(QGraphicsItem * parent)25 GameNoDisplay::GameNoDisplay(QGraphicsItem* parent) : QGraphicsTextItem(parent)
26 {
27 mFont = QFont("Arial", 18, QFont::Normal, false);
28 mFont.setStyleHint(QFont::SansSerif);
29 mFont.setPixelSize(24);
30 setFont(mFont);
31 setDefaultTextColor(QColor("#808183"));
32
33 mUpdateRect = QRectF(0, 0, 600, 40);
34
35 setTextWidth(600);
36 setScale(0.5);
37 }
38
ShowStr(QString str)39 void GameNoDisplay::ShowStr(QString str)
40 {
41 str = QString("<center>") + str + QString("</center>");
42 setHtml(str);
43 }
44