Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
210 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,45 @@ | |||
#include <QMessageBox> | |||
#include "aboutdialog.h" | |||
#include "ui_aboutdialog.h" | |||
#include "licensedialog.h" | |||
|
|||
#ifdef Q_OS_WIN | |||
# include "win32.h" | |||
#else | |||
# include "xnix.h" | |||
#endif | |||
|
|||
namespace Farman | |||
{ | |||
|
|||
AboutDialog::AboutDialog(QWidget *parent) : | |||
QDialog(parent), | |||
ui(new Ui::AboutDialog) | |||
{ | |||
ui->setupUi(this); | |||
|
|||
ui->appNameLabel->setText(tr("<p><font size = '+4'>%1<font size = '+1'> Version %2</font></font></p>") | |||
.arg(qApp->applicationName()) | |||
.arg(qApp->applicationVersion())); | |||
|
|||
ui->appDescriptionLabel->setText(tr("<p>Based on Qt %1 ").arg(qVersion()) | |||
+ tr("(%1)").arg(getCompilerVersion()) | |||
+ tr("<p>Copyright 2019 %1 All right reserved.</p>").arg(qApp->organizationName())); | |||
} | |||
|
|||
AboutDialog::~AboutDialog() | |||
{ | |||
delete ui; | |||
} | |||
|
|||
void AboutDialog::on_aboutQtPushButton_clicked() | |||
{ | |||
QMessageBox::aboutQt(this); | |||
} | |||
|
|||
void AboutDialog::on_licensePushButton_clicked() | |||
{ | |||
LicenseDialog(this).exec(); | |||
} | |||
|
|||
} // namespace Farman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
#ifndef ABOUTDIALOG_H | |||
#define ABOUTDIALOG_H | |||
|
|||
#include <QDialog> | |||
|
|||
namespace Ui { | |||
class AboutDialog; | |||
} | |||
|
|||
namespace Farman | |||
{ | |||
|
|||
class AboutDialog : public QDialog | |||
{ | |||
Q_OBJECT | |||
|
|||
public: | |||
explicit AboutDialog(QWidget *parent = nullptr); | |||
~AboutDialog(); | |||
|
|||
private Q_SLOTS: | |||
void on_aboutQtPushButton_clicked(); | |||
void on_licensePushButton_clicked(); | |||
|
|||
private: | |||
Ui::AboutDialog *ui; | |||
}; | |||
|
|||
} // namespace Farman | |||
|
|||
#endif // ABOUTDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,131 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<ui version="4.0"> | |||
<class>AboutDialog</class> | |||
<widget class="QDialog" name="AboutDialog"> | |||
<property name="geometry"> | |||
<rect> | |||
<x>0</x> | |||
<y>0</y> | |||
<width>347</width> | |||
<height>144</height> | |||
</rect> | |||
</property> | |||
<property name="windowTitle"> | |||
<string>About farman</string> | |||
</property> | |||
<layout class="QVBoxLayout" name="verticalLayout"> | |||
<item> | |||
<widget class="QLabel" name="appNameLabel"> | |||
<property name="text"> | |||
<string>TextLabel</string> | |||
</property> | |||
<property name="alignment"> | |||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | |||
</property> | |||
</widget> | |||
</item> | |||
<item> | |||
<widget class="QLabel" name="appDescriptionLabel"> | |||
<property name="text"> | |||
<string>TextLabel</string> | |||
</property> | |||
<property name="alignment"> | |||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> | |||
</property> | |||
</widget> | |||
</item> | |||
<item> | |||
<layout class="QHBoxLayout" name="horizontalLayout"> | |||
<item> | |||
<spacer name="horizontalSpacer"> | |||
<property name="orientation"> | |||
<enum>Qt::Horizontal</enum> | |||
</property> | |||
<property name="sizeHint" stdset="0"> | |||
<size> | |||
<width>83</width> | |||
<height>20</height> | |||
</size> | |||
</property> | |||
</spacer> | |||
</item> | |||
<item> | |||
<widget class="QPushButton" name="aboutQtPushButton"> | |||
<property name="text"> | |||
<string>About Qt</string> | |||
</property> | |||
</widget> | |||
</item> | |||
<item> | |||
<widget class="QPushButton" name="licensePushButton"> | |||
<property name="text"> | |||
<string>License</string> | |||
</property> | |||
</widget> | |||
</item> | |||
<item> | |||
<spacer name="horizontalSpacer_2"> | |||
<property name="orientation"> | |||
<enum>Qt::Horizontal</enum> | |||
</property> | |||
<property name="sizeHint" stdset="0"> | |||
<size> | |||
<width>40</width> | |||
<height>20</height> | |||
</size> | |||
</property> | |||
</spacer> | |||
</item> | |||
</layout> | |||
</item> | |||
<item> | |||
<widget class="QDialogButtonBox" name="buttonBox"> | |||
<property name="orientation"> | |||
<enum>Qt::Horizontal</enum> | |||
</property> | |||
<property name="standardButtons"> | |||
<set>QDialogButtonBox::Ok</set> | |||
</property> | |||
<property name="centerButtons"> | |||
<bool>true</bool> | |||
</property> | |||
</widget> | |||
</item> | |||
</layout> | |||
</widget> | |||
<resources/> | |||
<connections> | |||
<connection> | |||
<sender>buttonBox</sender> | |||
<signal>accepted()</signal> | |||
<receiver>AboutDialog</receiver> | |||
<slot>accept()</slot> | |||
<hints> | |||
<hint type="sourcelabel"> | |||
<x>248</x> | |||
<y>254</y> | |||
</hint> | |||
<hint type="destinationlabel"> | |||
<x>157</x> | |||
<y>274</y> | |||
</hint> | |||
</hints> | |||
</connection> | |||
<connection> | |||
<sender>buttonBox</sender> | |||
<signal>rejected()</signal> | |||
<receiver>AboutDialog</receiver> | |||
<slot>reject()</slot> | |||
<hints> | |||
<hint type="sourcelabel"> | |||
<x>316</x> | |||
<y>260</y> | |||
</hint> | |||
<hint type="destinationlabel"> | |||
<x>286</x> | |||
<y>274</y> | |||
</hint> | |||
</hints> | |||
</connection> | |||
</connections> | |||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters