-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchesscenterwidget.cpp
More file actions
51 lines (43 loc) · 1.42 KB
/
chesscenterwidget.cpp
File metadata and controls
51 lines (43 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "chesscenterwidget.h"
#include "chessmanualwidget.h"
#include "chessfunctionwidget.h"
#include "chessboardwidget.h"
#include "chesstipswidget.h"
#include "chesschatwidget.h"
#include "chesslog.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
ChessCenterWidget * ChessCenterWidget::INSTANCE = 0;
ChessCenterWidget * ChessCenterWidget::instance()
{
if(!INSTANCE)
{
INSTANCE = new ChessCenterWidget;
}
return INSTANCE;
}
ChessCenterWidget::ChessCenterWidget(QWidget *parent) :
QWidget(parent)
{
chessManualWidget = ChessManualWidget::instance();
chessFunctionWidget = ChessFunctionWidget::instance();
chessBoardWidget = ChessBoardWidget::instance();
chessTipsWidget = ChessTipsWidget::instance();
chessChatWidget = ChessChatWidget::instance();
QVBoxLayout *leftLayout = new QVBoxLayout;
leftLayout->addWidget(chessManualWidget);
leftLayout->addWidget(chessFunctionWidget);
QVBoxLayout *rightLayout = new QVBoxLayout;
rightLayout->addWidget(chessTipsWidget);
rightLayout->addWidget(chessChatWidget);
QHBoxLayout *layout = new QHBoxLayout;
layout->addLayout(leftLayout);
layout->addWidget(chessBoardWidget);
layout->addLayout(rightLayout);
setLayout(layout);
Chess_Trace(tr("new ChessCenterWidget"));
}
ChessCenterWidget::~ChessCenterWidget()
{
Chess_Trace(tr("delete ChessCenterWidget"));
}