src/modelsubwindow.h

Sun, 09 Apr 2023 16:23:05 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Sun, 09 Apr 2023 16:23:05 +0300
changeset 365
9d5cb5635c18
parent 364
39fbdee0c0c8
permissions
-rw-r--r--

Add undo, redo, cut, copy and paste actions to MainWindow which pass onto the editor widget

364
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
1 #pragma once
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
2 #include <QMdiSubWindow>
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
3 #include <QCloseEvent>
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
4 #include "src/basics.h"
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
5
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
6 class ModelSubWindow : public QMdiSubWindow
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
7 {
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
8 Q_OBJECT
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
9 public:
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
10 const ModelId modelId;
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
11 explicit ModelSubWindow(ModelId modelId, QWidget* widget = nullptr) :
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
12 QMdiSubWindow{widget},
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
13 modelId{modelId}
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
14 {
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
15 }
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
16 protected:
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
17 void closeEvent(QCloseEvent* event) override
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
18 {
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
19 event->ignore();
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
20 }
39fbdee0c0c8 I forgot to add files again... this time it's modelsubwindow.h
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
diff changeset
21 };

mercurial