-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
40 lines (31 loc) · 1023 Bytes
/
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QAbstractButton>
#include <QKeyEvent>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
//private:
public:
Ui::MainWindow *ui;
void BackspacePressed();
private slots: // slots are functions connected to buttons on windows (widgets)
void EnterPressed();
//// -- Method 1: installEventFilter on Input object -------------------------------
//private:
// bool eventFilter(QObject *target, QEvent *event) override;
// -- Method 2: Rewrite keyPressEvent() function -----------------------------------
// This overrides the default keyPressEvent implicit in the QObject or whatever
protected:
void keyPressEvent( /*QObject *target,*/ QKeyEvent *event );
void keyReleaseEvent(QKeyEvent *event);
// -- Method 3: shortcuts (note yet implemented) -----------------------------------
};
#endif // MAINWINDOW_H