Skip to content
Permalink
Browse files

implemented AboutDialog.(refs #62)

  • Loading branch information...
haraki committed Jun 28, 2019
1 parent 7dda618 commit 1e180230c9d076ed779ee99901559a01ae877ca5
Showing with 210 additions and 0 deletions.
  1. +45 −0 aboutdialog.cpp
  2. +31 −0 aboutdialog.h
  3. +131 −0 aboutdialog.ui
  4. +3 −0 farman.pro
@@ -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
@@ -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
@@ -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>
@@ -22,6 +22,7 @@ DEFINES += APP_VERSION=\\\"$$VERSION\\\"
INCLUDEPATH += ./QHexView/include

SOURCES += main.cpp\
aboutdialog.cpp \
bookmarkeditdialog.cpp \
bookmarkinfomodel.cpp \
bookmarkmanagerdialog.cpp \
@@ -58,6 +59,7 @@ SOURCES += main.cpp\
xnix.cpp

HEADERS += mainwindow.h \
aboutdialog.h \
bookmarkeditdialog.h \
bookmarkinfo.h \
bookmarkinfomodel.h \
@@ -98,6 +100,7 @@ HEADERS += mainwindow.h \
xnix.h

FORMS += mainwindow.ui \
aboutdialog.ui \
bookmarkeditdialog.ui \
bookmarkmanagerdialog.ui \
folderform.ui \

0 comments on commit 1e18023

Please sign in to comment.
You can’t perform that action at this time.