-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToolbar.cpp
More file actions
40 lines (25 loc) · 839 Bytes
/
Toolbar.cpp
File metadata and controls
40 lines (25 loc) · 839 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
33
34
35
36
37
38
39
40
#include "Toolbar.h"
#include"TextEditor.h"
#include <QAction>
ToolBar::ToolBar(TextEditor* editor, QWidget* parent) : QToolBar(tr("Main Toolbar"), parent)
{
setupToolBar();
connect(undoAction, &QAction::triggered, editor, &TextEditor::Undo);
connect(redoAction, &QAction::triggered, editor, &TextEditor::Redo);
}
ToolBar::~ToolBar()
{
}
void ToolBar::setupToolBar()
{
QAction* newAction = new QAction(QIcon("new.png"), tr("&New"), this);
addAction(newAction);
QAction* openAction = new QAction(QIcon("open.png"), tr("&Open"), this);
addAction(openAction);
undoAction = addAction(QIcon("undo.png"), tr("Undo"));
redoAction = addAction(QIcon("redo.png"), tr("Redo"));
}
void ToolBar::newFile() {
}
void ToolBar::openFile() {
}