57 QWidget::closeEvent(event);
60 if (
ui.TEText->toPlainText().toStdString() != Text)
62 auto Reply = QMessageBox::question(
this,
"DynExp - Save changes?",
63 QString::fromStdString(
"The file \"" +
Filename.string() +
"\" has been edited. Save the changes?"),
64 QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No | QMessageBox::StandardButton::Abort,
65 QMessageBox::StandardButton::Abort);
67 if (Reply == QMessageBox::StandardButton::Abort)
73 else if (Reply == QMessageBox::StandardButton::Yes)
84 QWidget::closeEvent(event);
Implements a dialog to edit and save small pieces of text or (Python) code.
TextEditor(QWidget *parent, const std::filesystem::path &Filename)
QSyntaxHighlighter * SyntaxHighlighter
virtual void showEvent(QShowEvent *event) override
const std::filesystem::path Filename
bool DoSave()
Saves the editor's content to the file Filename.
virtual void closeEvent(QCloseEvent *event) override