Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ScriptEditor.h
Go to the documentation of this file.
1#pragma once
2
3#include <QMainWindow>
4#include <QSettings>
7#include <misc/qt/Editor.h>
8
9namespace Ui
10{
11class ScriptEditor;
12}
13
14namespace sf
15{
16
18 : public QWidget
19 , public PlainTextEditMdi
20{
21 Q_OBJECT
22
23 public:
24 explicit ScriptEditor(QSettings* settings, QWidget* parent = nullptr);
25
26 ~ScriptEditor() override;
27
28 [[nodiscard]] Editor* getEditor() const;
29
31
32 void setInterpreter(const QSharedPointer<ScriptInterpreter>& interpreter);
33
35
37
38 bool loadFile(const QString& fileName) override;
39
48
49 [[nodiscard]] QString newFileName() const override;
50
51 public:
53
55
57
59
61
62 void onClickInstruction(const QModelIndex& index);
63
64 void stateSaveRestore(bool save) override;
65
66 void adjustColumns() const;
67
68 void develop() override;
69
70 protected:
71 void closeEvent(QCloseEvent* event) override;
72
73 private:
74 Ui::ScriptEditor* ui;
75
76 struct Private;
77 Private& _p;
78};
79
80}// namespace sf
Definition Editor.h:18
Definition PlainTextEditMdi.h:17
bool save() override
Pure virtual needs to be implemented.
Definition ScriptEditor.h:20
QString newFileName() const override
TClosure< QSharedPointer< ScriptInterpreter >, const QString & > FindInterpreterClosure
Type definition for the callback closure.
Definition ScriptEditor.h:43
~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:47
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:8
Definition Application.h:10