Added an about dialog with version info
This commit is contained in:
parent
eff3b42cb0
commit
7c71733184
@ -1,6 +1,8 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include "version.h"
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <QFile>
|
||||
@ -58,6 +60,8 @@ void MainWindow::setupUi()
|
||||
connect(ui->actionPrint, &QAction::triggered, this, &MainWindow::print);
|
||||
connect(ui->actionExport_PDF, &QAction::triggered, this, qOverload<>(&MainWindow::savePdf));
|
||||
|
||||
connect(ui->actionAbout, &QAction::triggered, this, &MainWindow::aboutDialog);
|
||||
|
||||
connect(&m_dataModel, &DataModel::modelChanged, this, &MainWindow::dataModelChanged);
|
||||
}
|
||||
|
||||
@ -235,3 +239,10 @@ void MainWindow::savePdf(const QString &filename)
|
||||
|
||||
printDoc.print(&printer);
|
||||
}
|
||||
|
||||
void MainWindow::aboutDialog()
|
||||
{
|
||||
QString infoString =
|
||||
QString::fromUtf8(ESGRAF48_DESCRIPTION) + " Version " + QString::fromUtf8(ESGRAF48_VERSION);
|
||||
QMessageBox::information(this, ESGRAF48_DESCRIPTION, infoString);
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ public slots:
|
||||
void print() const;
|
||||
void dataModelChanged();
|
||||
void savePdf();
|
||||
void aboutDialog();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
@ -137,7 +137,14 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionQuit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
<property name="windowTitle">
|
||||
@ -237,6 +244,11 @@
|
||||
<string>Export as PDF file</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
Reference in New Issue
Block a user