no need for aboutdialog.ui, can be done with QMessageBox with 6 lines

master
Denes Matetelki 14 years ago
parent 80321d75a2
commit 89afb2dd3a

@ -1,17 +0,0 @@
#include "aboutdialog.h"
#include "ui_aboutdialog.h"
AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent),
m_ui(new Ui::AboutDialog)
{
m_ui->setupUi(this);
connect(this, SIGNAL(finished(int)), parent,
SLOT(aboutDestroyed()));
}
AboutDialog::~AboutDialog()
{
delete m_ui;
}

@ -1,22 +0,0 @@
#ifndef ABOUTDIALOG_H
#define ABOUTDIALOG_H
#include <QDialog>
namespace Ui {
class AboutDialog;
}
class AboutDialog : public QDialog
{
Q_OBJECT
public:
explicit AboutDialog(QWidget *parent = 0);
~AboutDialog();
private:
Ui::AboutDialog *m_ui;
};
#endif // ABOUTDIALOG_H

@ -1,126 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>329</width>
<height>142</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>About QtMindMap</string>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>100</x>
<y>100</y>
<width>211</width>
<height>31</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>0</y>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>QtMindMap 0.1</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>30</x>
<y>40</y>
<width>181</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Mindmap software in QT</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>30</x>
<y>70</y>
<width>291</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Denes Matetelki &lt;a href=&quot;mailto:denes.matetelki@gmail.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#508ed8;&quot;&gt;denes.matetelki@gmail.com&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</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>

@ -1,9 +1,9 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "aboutdialog.h"
#include <QDebug> #include <QDebug>
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox>
//#include <QtConcurrentRun> //#include <QtConcurrentRun>
@ -32,8 +32,7 @@ extern void exportScaneToPng(QGraphicsScene *scene,
MainWindow::MainWindow(QWidget *parent) : MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
m_ui(new Ui::MainWindow), m_ui(new Ui::MainWindow)
m_aboutDialog(0)
{ {
m_graphicsView = new GraphWidget(this); m_graphicsView = new GraphWidget(this);
@ -56,7 +55,6 @@ MainWindow::MainWindow(QWidget *parent) :
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {
delete m_ui; delete m_ui;
if (m_aboutDialog) delete m_aboutDialog;
} }
void MainWindow::klakk() void MainWindow::klakk()
@ -104,15 +102,13 @@ void MainWindow::exportScene()
void MainWindow::about() void MainWindow::about()
{ {
setDisabled(true); QMessageBox msgBox(this);
if (m_aboutDialog == 0) m_aboutDialog = new AboutDialog(this); msgBox.setWindowTitle(tr("About QtMindMap"));
m_aboutDialog->setEnabled(true); // children inherits enabled status msgBox.setText(tr("MindMap software written in Qt."));
m_aboutDialog->show(); msgBox.setInformativeText(tr("Homepage: https://gitorious.org/qtmindmap\n\nReport bugs to: denes.matetelki@gmail.com"));
} QPixmap pixMap(":/heart.svg");
msgBox.setIconPixmap(pixMap.scaled(50,50));
void MainWindow::aboutDestroyed() msgBox.exec();
{
setEnabled(true);
} }
QStatusBar * MainWindow::getStatusBar() QStatusBar * MainWindow::getStatusBar()

@ -4,7 +4,6 @@
#include <QMainWindow> #include <QMainWindow>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include "aboutdialog.h"
#include "graphwidget.h" #include "graphwidget.h"
namespace Ui { namespace Ui {
@ -26,12 +25,10 @@ public slots:
void klakk(); void klakk();
void exportScene(); void exportScene();
void about(); void about();
void aboutDestroyed();
private: private:
Ui::MainWindow *m_ui; Ui::MainWindow *m_ui;
AboutDialog *m_aboutDialog;
GraphWidget *m_graphicsView; GraphWidget *m_graphicsView;
QString m_fileName; QString m_fileName;

@ -10,9 +10,8 @@ TARGET = qtmindmap
TEMPLATE = app TEMPLATE = app
SOURCES += main.cpp\ SOURCES += main.cpp \
mainwindow.cpp \ mainwindow.cpp \
aboutdialog.cpp \
graphwidget.cpp \ graphwidget.cpp \
node.cpp \ node.cpp \
edge.cpp \ edge.cpp \
@ -20,15 +19,13 @@ SOURCES += main.cpp\
argumentparser.cpp argumentparser.cpp
HEADERS += mainwindow.h \ HEADERS += mainwindow.h \
aboutdialog.h \
graphwidget.h \ graphwidget.h \
node.h \ node.h \
edge.h \ edge.h \
systemtray.h \ systemtray.h \
argumentparser.h argumentparser.h
FORMS += mainwindow.ui \ FORMS += mainwindow.ui
aboutdialog.ui
RESOURCES = qtmindmap.qrc RESOURCES = qtmindmap.qrc

Loading…
Cancel
Save