-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChessWindow.cpp
56 lines (44 loc) · 1.39 KB
/
ChessWindow.cpp
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
52
53
54
55
56
//
// Created by malcolm on 1/16/16.
//
#include <iostream>
#include "ChessWindow.h"
#include "EventHandlers.h"
ChessWindow::ChessWindow() {
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
shitAction = new QAction(tr("Shit!"), this);
quitAction = new QAction(tr("Avsluta"), this);
connect(shitAction, SIGNAL(triggered()), this, SLOT(shit()));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
fileMenu = menuBar()->addMenu("File");
fileMenu->addAction(shitAction);
fileMenu->addSeparator();
fileMenu->addAction(quitAction);
mainPanel = new QWidget;
QVBoxLayout* layout = new QVBoxLayout;
mainPanel->setLayout(layout);
comp = new ChessComponent;
//textEdit = new QTextEdit;
button = new QPushButton("KLICKA HÄR!");
//layout->addWidget(textEdit);
layout->addWidget(comp);
layout->addWidget(button);
QObject::connect(button, SIGNAL(clicked()), this, SLOT(hej()));
setCentralWidget(mainPanel);
setWindowTitle("WELL HELLO THERE");
layout->setSizeConstraint(QLayout::SetFixedSize);
}
ChessWindow::~ChessWindow() {
// delete mainPanel;
// delete comp;
// delete button;
// delete shitAction;
// delete quitAction;
// delete fileMenu;
}
void ChessWindow::shit() {
std::cout << "SHITS REAL" << std::endl;
}
void ChessWindow::hej() {
std::cout << "HEJHEJ" << std::endl;
}