diff options
-rw-r--r-- | src/plugins/coreplugin/versiondialog.cpp | 15 | ||||
-rw-r--r-- | src/plugins/help/helpplugin.cpp | 16 |
2 files changed, 15 insertions, 16 deletions
diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index 7ef5abdf943..8042af83ba2 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -56,8 +56,12 @@ VersionDialog::VersionDialog() copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); - QPushButton *copyButton = buttonBox->addButton(Tr::tr("Copy and Close"), - QDialogButtonBox::ApplyRole); + QPushButton *copyButton = buttonBox->addButton(Tr::tr("Copy to Clipboard"), + QDialogButtonBox::ActionRole); + connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + connect(copyButton, &QPushButton::pressed, this, [] { + Utils::setClipboardAndSelection(ICore::aboutInformationCompact()); + }); using namespace Layouting; Column { @@ -69,13 +73,6 @@ VersionDialog::VersionDialog() }.attachTo(this); 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); } bool VersionDialog::event(QEvent *event) diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index a6e031e5f4f..cbe736a094b 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -63,6 +63,7 @@ #include <QLibraryInfo> #include <QMenu> #include <QPlainTextEdit> +#include <QPushButton> #include <QRegularExpression> #include <QSplitter> #include <QStackedLayout> @@ -595,16 +596,17 @@ void HelpPluginPrivate::slotSystemInformation() info->setFont(font); info->setPlainText(text); layout->addWidget(info); - auto buttonBox = new QDialogButtonBox; - buttonBox->addButton(QDialogButtonBox::Cancel); - buttonBox->addButton(Tr::tr("Copy to Clipboard"), QDialogButtonBox::AcceptRole); - connect(buttonBox, &QDialogButtonBox::accepted, dialog, &QDialog::accept); + + auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); + QPushButton *copyButton = buttonBox->addButton(Tr::tr("Copy to Clipboard"), + QDialogButtonBox::ActionRole); connect(buttonBox, &QDialogButtonBox::rejected, dialog, &QDialog::reject); - layout->addWidget(buttonBox); - connect(dialog, &QDialog::accepted, info, [info]() { + connect(copyButton, &QPushButton::pressed, info, [info] { setClipboardAndSelection(info->toPlainText()); }); - connect(dialog, &QDialog::rejected, dialog, [dialog]{ dialog->close(); }); + + layout->addWidget(buttonBox); + dialog->resize(700, 400); ICore::registerWindow(dialog, Context("Help.SystemInformation")); dialog->show(); |