summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-01-11 10:42:32 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-01-11 14:45:15 +0000
commit7352050562309668e55d46db2d8ab59cd76a7092 (patch)
treee5a572a8534c59eaa3c062a82ba56d99222d7e32 /tools
parent5c35bdfe3bb2646ec94244e12c0ed04d33b30639 (diff)
downloadqtactiveqt-7352050562309668e55d46db2d8ab59cd76a7092.tar.gz
Testcon: Add Help menu with "About..." entries
Add "About Qt" and "About Testcon" which displays Qt version and build. Change-Id: Iddedf0ccf4d1e753a9deb5812c3df482e5a2e480 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/testcon/mainwindow.cpp47
-rw-r--r--tools/testcon/mainwindow.h2
-rw-r--r--tools/testcon/mainwindow.ui18
3 files changed, 67 insertions, 0 deletions
diff --git a/tools/testcon/mainwindow.cpp b/tools/testcon/mainwindow.cpp
index ca47cec..f116a22 100644
--- a/tools/testcon/mainwindow.cpp
+++ b/tools/testcon/mainwindow.cpp
@@ -35,11 +35,14 @@
#include <QtWidgets/QMdiArea>
#include <QtWidgets/QMdiSubWindow>
+#include <QtWidgets/QDialogButtonBox>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QInputDialog>
#include <QtWidgets/QMessageBox>
#include <QtGui/QCloseEvent>
+#include <QtGui/QPixmap>
#include <QtCore/QDebug>
+#include <QtCore/QLibraryInfo>
#include <QtCore/qt_windows.h>
#include <ActiveQt/QAxScriptManager>
#include <ActiveQt/QAxSelect>
@@ -415,6 +418,50 @@ bool MainWindow::loadScript(const QString &file)
#endif
}
+void MainWindow::on_actionAbout_Qt_triggered()
+{
+ QApplication::aboutQt();
+}
+
+class VersionDialog : public QDialog
+{
+public:
+ explicit VersionDialog(QWidget *parent = nullptr);
+};
+
+const char aboutTextFormat[] = QT_TRANSLATE_NOOP("MainWindow",
+"<h3>Testcon - An ActiveX Test Container</h3>\nVersion: %1<br/><br/>\n"
+"This application implements a generic test container for ActiveX controls."
+"<br/><br/>Copyright (C) %2 The Qt Company Ltd.");
+
+VersionDialog::VersionDialog(QWidget *parent) : QDialog(parent)
+{
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+ setWindowTitle(tr("About Testcon"));
+ QGridLayout *layout = new QGridLayout(this);
+ QLabel *logoLabel = new QLabel;
+ logoLabel->setPixmap(QStringLiteral(":/qt-project.org/qmessagebox/images/qtlogo-64.png"));
+ const QString aboutText =
+ tr(aboutTextFormat).arg(QLatin1String(QLibraryInfo::build()),
+ QStringLiteral("2017"));
+ QLabel *aboutLabel = new QLabel(aboutText);
+ aboutLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
+ aboutLabel->setWordWrap(true);
+ aboutLabel->setOpenExternalLinks(true);
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
+ connect(buttonBox , &QDialogButtonBox::rejected, this, &QDialog::reject);
+ layout->addWidget(logoLabel, 0, 0, 1, 1);
+ layout->addWidget(aboutLabel, 0, 1, 4, 4);
+ layout->addWidget(buttonBox, 4, 2, 1, 1);
+}
+
+void MainWindow::on_actionAbout_Testcon_triggered()
+{
+ VersionDialog versionDialog(this);
+ versionDialog.exec();
+}
+
void MainWindow::updateGUI()
{
QAxWidget *container = activeAxWidget();
diff --git a/tools/testcon/mainwindow.h b/tools/testcon/mainwindow.h
index 2c8d687..84cd2ce 100644
--- a/tools/testcon/mainwindow.h
+++ b/tools/testcon/mainwindow.h
@@ -84,6 +84,8 @@ protected slots:
void on_actionScriptingRun_triggered();
void on_actionFreeUnusedDLLs_triggered();
+ void on_actionAbout_Qt_triggered();
+ void on_actionAbout_Testcon_triggered();
private:
QAxWidget *activeAxWidget() const;
diff --git a/tools/testcon/mainwindow.ui b/tools/testcon/mainwindow.ui
index ad3443c..2393c4c 100644
--- a/tools/testcon/mainwindow.ui
+++ b/tools/testcon/mainwindow.ui
@@ -366,11 +366,19 @@
<addaction name="LoggingMenu" />
<addaction name="actionFreeUnusedDLLs"/>
</widget>
+ <widget class="QMenu" name="menuHelp">
+ <property name="title">
+ <string>Help</string>
+ </property>
+ <addaction name="actionAbout_Testcon"/>
+ <addaction name="actionAbout_Qt"/>
+ </widget>
<addaction name="FileMenu" />
<addaction name="ContainerMenu" />
<addaction name="ControlMenu" />
<addaction name="ScriptMenu" />
<addaction name="OptionsMenu" />
+ <addaction name="menuHelp" />
</widget>
<action name="actionFileExit" >
<property name="objectName" >
@@ -608,6 +616,16 @@
<string>Free Unused DLLs</string>
</property>
</action>
+ <action name="actionAbout_Testcon">
+ <property name="text">
+ <string>About Testcon</string>
+ </property>
+ </action>
+ <action name="actionAbout_Qt">
+ <property name="text">
+ <string>About Qt</string>
+ </property>
+ </action>
<actiongroup name="actionGroupLogging" >
<action name="actionLogSignals" >
<property name="objectName" >