diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index 0df1454849b..643372f729d 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -44,6 +45,8 @@ VersionDialog::VersionDialog(QWidget *parent) copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); + QPushButton *copyButton = buttonBox->addButton(Tr::tr("Copy and Close"), + QDialogButtonBox::ApplyRole); using namespace Layouting; Column { @@ -56,6 +59,10 @@ VersionDialog::VersionDialog(QWidget *parent) layout()->setSizeConstraint(QLayout::SetFixedSize); + connect(copyButton, &QPushButton::pressed, this, [this] { + Utils::setClipboardAndSelection(ICore::aboutInformationCompact()); + accept(); + }); connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); }