This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
ESGRAF48/source/mainwindow.h

51 lines
912 B
C
Raw Permalink Normal View History

2018-05-10 16:41:14 +00:00
#pragma once
#include "DataModel.h"
2018-05-10 16:41:14 +00:00
#include <QMainWindow>
#include <QString>
2019-01-12 15:50:04 +00:00
#include <QFont>
2018-05-10 16:41:14 +00:00
2018-05-16 05:02:12 +00:00
class DataModel;
class QDataWidgetMapper;
2018-05-10 16:41:14 +00:00
namespace Ui {
class MainWindow;
2018-05-10 16:41:14 +00:00
};
class MainWindow : public QMainWindow
{
2019-10-05 14:14:45 +00:00
Q_OBJECT
2018-05-10 16:41:14 +00:00
2018-05-16 05:02:12 +00:00
private:
2019-10-05 14:14:45 +00:00
Ui::MainWindow* ui;
DataModel m_dataModel;
QString m_filename;
bool m_saveOnClose = false;
2018-05-16 05:02:12 +00:00
public:
2019-10-05 14:14:45 +00:00
MainWindow(QWidget* parent);
MainWindow(QWidget* parent, const QString& filename);
~MainWindow();
2018-05-10 16:41:14 +00:00
public slots:
2019-10-05 14:14:45 +00:00
void newFile();
void openFile();
void openFile(const QString& filename);
void saveFile();
void saveFileAs();
void closeFile();
void print() const;
void dataModelChanged();
void savePdf();
void aboutDialog();
protected:
2019-10-05 14:14:45 +00:00
void closeEvent(QCloseEvent* event) override;
2018-05-24 09:54:24 +00:00
private:
2019-10-05 14:14:45 +00:00
void setupUi();
void saveFile(const QString& filename);
void savePdf(const QString& filename);
2018-05-10 16:41:14 +00:00
};