Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ScriptEditor.h
Go to the documentation of this file.
1#pragma once
2#include <QMainWindow>
3#include <QSettings>
6#include <misc/qt/Editor.h>
7
8namespace Ui
9{
10class ScriptEditor;
11}
12
13namespace sf
14{
15
17 : public QWidget
18 , public PlainTextEditMdi
19{
20 Q_OBJECT
21
22 public:
23 explicit ScriptEditor(QSettings* settings, QWidget* parent = nullptr);
24
25 ~ScriptEditor() override;
26
27 [[nodiscard]] Editor* getEditor() const;
28
30
31 void setInterpreter(const QSharedPointer<ScriptInterpreter>& interpreter);
32
34
36
37 bool loadFile(const QString& fileName) override;
38
47
48 [[nodiscard]] QString newFileName() const override;
49
50 public:
52
54
56
58
60
61 void onClickInstruction(const QModelIndex& index);
62
63 void stateSaveRestore(bool save) override;
64
65 void adjustColumns() const;
66
67 void develop() override;
68
69 protected:
70 void closeEvent(QCloseEvent* event) override;
71
72 private:
73 Ui::ScriptEditor* ui;
74
75 struct Private;
76 Private& _p;
77};
78
79}// namespace sf
Definition Editor.h:18
Definition PlainTextEditMdi.h:17
bool save() override
Pure virtual needs to be implemented.
Definition ScriptEditor.h:19
QString newFileName() const override
TClosure< QSharedPointer< ScriptInterpreter >, const QString & > FindInterpreterClosure
Type definition for the callback closure.
Definition ScriptEditor.h:42
~ScriptEditor() override
void develop() override
Virtual function which is called during development only fro an action.
void onActionInitialize()
bool loadFile(const QString &fileName) override
Pure virtual needs to be implemented.
static FindInterpreterClosure callbackFindInterpreter
Holds a callback to find interpreter from the passed file.
Definition ScriptEditor.h:46
Editor * getEditor() const
ScriptEditor(QSettings *settings, QWidget *parent=nullptr)
void onClickInstruction(const QModelIndex &index)
void adjustColumns() const
ScriptInterpreter * getScriptInterpreter() const
void closeEvent(QCloseEvent *event) override
void setInterpreter(const QSharedPointer< ScriptInterpreter > &interpreter)
void onActionCompile()
void stateSaveRestore(bool save) override
Saves or restores the state of the MDI instance.
void moveCursorToInstruction(int row)
Script interpreter for running a loaded script.
Definition ScriptInterpreter.h:14
Encapsulates the std::function() template.
Definition TClosure.h:14
Definition ApplicationPropertyPage.h:7
Definition Application.h:10