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
15namespace Ui
16{
17 class TextEditor;
18}
19
20class TextEditor : public QWidget
21{
22 Q_OBJECT
23
24 // Better DynExp::ItemIDType, but this is incompatible with g++ compiler. Should equal ParamsConfigDialog::IndexType.
25 using IndexType = qulonglong;
26
27public:
28 TextEditor(QWidget* parent, const std::filesystem::path& Filename);
29 ~TextEditor() = default;
30
31 auto& GetFilename() const { return Filename; }
32
33private:
34 virtual void showEvent(QShowEvent* event) override;
35 virtual void closeEvent(QCloseEvent* event) override;
36
41 bool DoSave();
42
43 std::unique_ptr<Ui::TextEditor> ui;
44
45 const std::filesystem::path Filename;
46
47 QSyntaxHighlighter* SyntaxHighlighter = nullptr;
48
49private slots:
50 void OnSave();
51 void OnClose();
52};
~TextEditor()=default
QSyntaxHighlighter * SyntaxHighlighter
Definition TextEditor.h:47
virtual void showEvent(QShowEvent *event) override
std::unique_ptr< Ui::TextEditor > ui
Definition TextEditor.h:43
const std::filesystem::path Filename
Definition TextEditor.h:45
bool DoSave()
Saves the editor's content to the file Filename.
qulonglong IndexType
Definition TextEditor.h:25
auto & GetFilename() const
Definition TextEditor.h:31
virtual void closeEvent(QCloseEvent *event) override
void OnClose()
void OnSave()
Accumulates include statements to provide a precompiled header.