From d365d66413fa2012e8ab10bf68173d8aa7f99e22 Mon Sep 17 00:00:00 2001 From: BMaxV <5713211+BMaxV@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:59:49 +0100 Subject: [PATCH] Change button text to confirm copy. (#17696) * Change button text to confirm copy. * translation and timer->reset * timer->single shot + text variable --------- Co-authored-by: Chris Hennes --- src/Gui/DlgAbout.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Gui/DlgAbout.cpp b/src/Gui/DlgAbout.cpp index 78044e868a..8eb2384e3e 100644 --- a/src/Gui/DlgAbout.cpp +++ b/src/Gui/DlgAbout.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #endif @@ -701,6 +702,13 @@ void AboutDialog::copyToClipboard() } str << "\n"; + + QClipboard* cb = QApplication::clipboard(); + cb->setText(data); + auto copytext = ui->copyButton->text(); + ui->copyButton->setText(tr("Copied!")); + QTimer::singleShot(2000, [this,copytext]() { ui->copyButton->setText(copytext); }); + } }