-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
47 lines (39 loc) · 1.31 KB
/
Copy pathmainwindow.cpp
File metadata and controls
47 lines (39 loc) · 1.31 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
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
setStyleSheet(".MainWindow{"
"background-color: #616161;"
"}");
ui->pushButton->setStyleSheet("QPushButton{"
"background-color: #232323;"
"color: white;"
"border-radius: 10px;"
"}"
""
"QPushButton:hover{"
"border: 3px solid;"
"border-radius: 10px;"
"border-color: #a7dbb5;"
"}");
setupMenuBar();
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::setupMenuBar(){
QMenu* fileMenu = new QMenu("File");
QMenu* editMenu = new QMenu("Edit");
fileMenu->addAction("New", this, SLOT(New()), Qt::CTRL | Qt::Key_N);
editMenu->addAction("Undo");;
m_menubar = new QMenuBar;
m_menubar->addMenu(fileMenu);
m_menubar->addMenu(editMenu);
}
void MainWindow::New(){
qDebug() << "New was clicked!";
}