From 0952786705da1cd36992f4f5e24bf744187a37f8 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Thu, 21 Jan 2016 13:27:54 +0100 Subject: Change version information in about dialog to be selectable This is to allow easy copy and paste of Swift version, Qt build version and Qt runtime version into potential bug reports. Test-Information: Tested changed UI behavior on OS X 10.11.2 with Qt 5.4.2. Change-Id: I6234f08e77402c3d1ec2f5b7a98c19b059a445ea diff --git a/Swift/QtUI/QtAboutWidget.cpp b/Swift/QtUI/QtAboutWidget.cpp index 7145384..9fb07ed 100644 --- a/Swift/QtUI/QtAboutWidget.cpp +++ b/Swift/QtUI/QtAboutWidget.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -39,15 +39,10 @@ QtAboutWidget::QtAboutWidget() : QDialog() { QLabel* appNameLabel = new QLabel("
" + QCoreApplication::applicationName() + "
", this); mainLayout->addWidget(appNameLabel); - QLabel* versionLabel = new QLabel(QString("
") + tr("Version %1").arg(QCoreApplication::applicationVersion()) + "
", this); + QLabel* versionLabel = new QLabel((QString("
") + tr("Version %1") + "

" + QString(tr("Built with Qt %2")) + QString("
") + QString(tr("Running with Qt %3")) + "
").arg(QCoreApplication::applicationVersion()).arg(QT_VERSION_STR).arg(qVersion())); + versionLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); mainLayout->addWidget(versionLabel); - QString buildString = QString("
") + QString(tr("Built with Qt %1")).arg(QT_VERSION_STR); - buildString += QString("
") + QString(tr("Running with Qt %1")).arg(qVersion()); - buildString += "
"; - QLabel* buildLabel = new QLabel(buildString, this); - mainLayout->addWidget(buildLabel); - if (QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_AUTHOR") != "TRANSLATION_AUTHOR") { mainLayout->addWidget(new QLabel(QString("
") + QString(tr("Using the English translation by\n%1")).arg(QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_AUTHOR")).replace("\n", "
") + "
", this)); } -- cgit v0.10.2-6-g49f6