Locus No Pilotus
Project of four first grade MIPT DAFE/RSE students (for engineering practical work in the second semester) in Qt C++
Loading...
Searching...
No Matches
gui_json_file.h
Go to the documentation of this file.
1#pragma once
2
3// our code libs:
5
7 public:
8 GuiJsonFile() = default;
9 GuiJsonFile(QFile* file) : file_{file} {};
10
11 void Save(data_tools::DataManager* plot_area);
12 void Open(data_tools::DataManager* plot_area);
13 void Close() { file_->close(); }
14
15 QString GetFileName() const {
16 return QString::fromStdString(
17 file_->filesystemFileName().filename().string());
18 }
19
20 QString GetAbsolutePath() const {
21 return QString::fromStdString(file_->filesystemFileName().string());
22 }
23
24 QString GetParentPath() const {
25 return QString::fromStdString(
26 file_->filesystemFileName().parent_path().string());
27 }
28
29 void SetFile(const QString& file_name) { file_->setFileName(file_name); }
30 void SetUntitledFile();
31
32 bool IsExistsFile() const { return file_->exists(); }
33 bool IsChanged(data_tools::DataManager* plot_area) const;
34
35 private:
36 QFile* file_{new QFile};
37
38 QJsonObject LoadJson() const;
39};
Definition gui_json_file.h:6
QString GetAbsolutePath() const
Definition gui_json_file.h:20
void SetUntitledFile()
Нужно для того, чтобы при открытии приложения менялось имя "Untitled" файла, так как может быть такое...
Definition new.cpp:8
bool IsChanged(data_tools::DataManager *plot_area) const
Definition new.cpp:31
bool IsExistsFile() const
Definition gui_json_file.h:32
QJsonObject LoadJson() const
Definition new.cpp:25
QFile * file_
Definition gui_json_file.h:36
QString GetFileName() const
Definition gui_json_file.h:15
GuiJsonFile(QFile *file)
Definition gui_json_file.h:9
void Open(data_tools::DataManager *plot_area)
Definition open.cpp:41
void Save(data_tools::DataManager *plot_area)
Definition save.cpp:4
GuiJsonFile()=default
void Close()
Definition gui_json_file.h:13
QString GetParentPath() const
Definition gui_json_file.h:24
void SetFile(const QString &file_name)
Definition gui_json_file.h:29
Класс, хранящий gui объекты и связывающий их с QCustomPlot.
Definition data_manager.h:9