-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
66 lines (46 loc) · 1.4 KB
/
mainwindow.h
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
57
58
59
60
61
62
63
64
65
66
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QString>
#include <QMessageBox>
#include <QCloseEvent>
#include "finddialog.h"
#include "highlighter.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public slots:
void on_textEdit_change();
void on_find_next(QString );
void on_find_prev(QString);
void on_text_cursor_move(QString &);
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void on_actionAbout_QNotePad_triggered();
void on_actionselect_all_Ctrl_A_triggered();
void on_actionCut_Ctrl_X_triggered();
void on_actionCopy_Ctrl_C_triggered();
void on_actionPaste_Ctrl_V_triggered();
void on_actionUndo_Ctrl_Z_triggered();
void on_actionRedo_Shift_Ctrl_Z_triggered();
bool on_actionNew_Ctrl_N_triggered();
bool on_actionOpen_Shift_Ctrl_N_triggered();
bool on_actionSave_Ctrl_S_triggered();
bool on_actionSave_as_Shift_Ctrl_S_triggered();
void on_actionFind_Ctrl_F_triggered();
private:
Ui::MainWindow *ui;
Highlighter *highlighter;
QString open_file;
bool unsaved_change;
FindDialog *find_dialog;
void setupEditor();
QMessageBox::StandardButton check_unsaved_changes();
void closeEvent(QCloseEvent *event);
};
#endif // MAINWINDOW_H