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
2018-12-09 11:11:55 +01:00

50 lines
809 B
C++

#pragma once
#include "DataModel.h"
#include <QMainWindow>
#include <QString>
class DataModel;
class QDataWidgetMapper;
namespace Ui {
class MainWindow;
};
class MainWindow : public QMainWindow
{
Q_OBJECT
private:
Ui::MainWindow *ui;
DataModel m_dataModel;
QString m_filename;
bool m_saveOnClose = false;
public:
MainWindow(QWidget *parent);
MainWindow(QWidget *parent, const QString &filename);
~MainWindow();
public slots:
void newFile();
void openFile();
void openFile(const QString &filename);
void saveFile();
void saveFileAs();
void closeFile();
void print() const;
void dataModelChanged();
void savePdf();
protected:
void closeEvent(QCloseEvent *event) override;
private:
void setupUi();
void saveFile(const QString &filename);
void savePdf(const QString &filename);
};