3 #include <score/command/Dispatchers/CommandDispatcher.hpp>
4 #include <score/command/PropertyCommand.hpp>
5 #include <score/document/DocumentContext.hpp>
6 #include <score/tools/Bind.hpp>
10 #include <score_lib_process_export.h>
12 #include <string_view>
26 QSize sizeHint()
const override {
return {800, 300}; }
27 QString text()
const noexcept;
29 void setText(
const QString& str);
30 void setError(
int line,
const QString& str);
33 virtual void on_accepted() = 0;
36 QTextEdit* m_textedit{};
37 QPlainTextEdit* m_error{};
40 template <
typename Process_T,
typename Property_T,
typename Spec_T>
49 setText((m_process.*Property_T::get)());
50 con(m_process, &Process_T::errorMessage,
this, &ProcessScriptEditDialog::setError);
52 &QWidget::deleteLater);
53 con(m_process, Property_T::notify,
this, &ProcessScriptEditDialog::setText);
56 void on_accepted()
override
58 this->setError(0, QString{});
59 if(this->text() != (m_process.*Property_T::get)())
63 if(m_process.validate(this->text()))
67 m_process, this->text(), m_context});
73 const Process_T& m_process;
74 void closeEvent(QCloseEvent* event)
override
76 const_cast<QWidget*&
>(m_process.externalUI) =
nullptr;
77 m_process.externalUIVisible(
false);
The CommandDispatcher class.
Definition: CommandDispatcher.hpp:13
void identified_object_destroying(IdentifiedObjectAbstract *o)
To be called by subclasses.
Definition: ScriptEditor.hpp:42
Definition: ScriptEditor.hpp:21
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Definition: DocumentContext.hpp:18
Definition: PropertyCommand.hpp:112