DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
TextEditor.h
Go to the documentation of this file.
1// This file is part of DynExp.
2
8#pragma once
9
11#include "stdafx.h"
12
13#include <QWidget>
14#include "ui_TextEditor.h"
15
16class TextEditor : public QWidget
17{
18 Q_OBJECT
19
20 // Better DynExp::ItemIDType, but this is incompatible with g++ compiler. Should equal ParamsConfigDialog::IndexType.
21 using IndexType = qulonglong;
22
23public:
24 TextEditor(QWidget* parent, const std::filesystem::path& Filename);
25 ~TextEditor() = default;
26
27 auto& GetFilename() const { return Filename; }
28
29private:
30 virtual void showEvent(QShowEvent* event) override;
31 virtual void closeEvent(QCloseEvent* event) override;
32
37 bool DoSave();
38
39 Ui::TextEditor ui;
40
41 const std::filesystem::path Filename;
42
43 QSyntaxHighlighter* SyntaxHighlighter = nullptr;
44
45private slots:
46 void OnSave();
47 void OnClose();
48};
~TextEditor()=default
QSyntaxHighlighter * SyntaxHighlighter
Definition TextEditor.h:43
virtual void showEvent(QShowEvent *event) override
Ui::TextEditor ui
Definition TextEditor.h:39
const std::filesystem::path Filename
Definition TextEditor.h:41
bool DoSave()
Saves the editor's content to the file Filename.
qulonglong IndexType
Definition TextEditor.h:21
auto & GetFilename() const
Definition TextEditor.h:27
virtual void closeEvent(QCloseEvent *event) override
void OnClose()
void OnSave()
Accumulates include statements to provide a precompiled header.