-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathttkapplication.cpp
More file actions
32 lines (25 loc) · 881 Bytes
/
ttkapplication.cpp
File metadata and controls
32 lines (25 loc) · 881 Bytes
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
#include "ttkapplication.h"
#include "sudokutable.h"
#include <QAction>
#include <QToolBar>
TTKApplication::TTKApplication(QWidget * parent)
: QMainWindow(parent)
{
setWindowTitle("TTKApplication");
m_sudokuTable = new SudokuTable(this);
setCentralWidget(m_sudokuTable);
createActions();
setFixedSize(317, 351);
}
void TTKApplication::createActions()
{
QAction *newAction = new QAction("New", this);
newAction->setIcon(QIcon(":/data/images/new.png"));
connect(newAction, SIGNAL(triggered()), m_sudokuTable, SLOT(newGame()));
QAction *eraseAction = new QAction("Clear", this);
eraseAction->setIcon(QIcon(":/data/images/clear.png"));
connect(eraseAction, SIGNAL(triggered()), m_sudokuTable, SLOT(erase()));
QToolBar *toolBar = addToolBar("ToolBar");
toolBar->addAction(newAction);
toolBar->addAction(eraseAction);
}