From 2b2aef94d95d00949e9ed6a4bfa7b1d685b78e2a Mon Sep 17 00:00:00 2001 From: houchengqiu Date: Thu, 22 Feb 2024 15:33:17 +0800 Subject: [PATCH] fix: Fixed the issue where the clipboard may have no color value after absorbing color MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The color absorber delays exiting by 100ms so that the color values ​​can be stored in the clipboard normally. Log: Fixed the issue where the clipboard may have no color value after absorbing color Bug: https://pms.uniontech.com/bug-view-237007.html --- src/clipboard.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/clipboard.cpp b/src/clipboard.cpp index 6fa2242..03bfe78 100644 --- a/src/clipboard.cpp +++ b/src/clipboard.cpp @@ -66,6 +66,8 @@ void Clipboard::copyToClipboard(QColor color, QString colorType) QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(colorString); - // Quit application. - QApplication::quit(); + // Quit application. Delay exit by 100ms so that the color value can be stored in the clipboard normally + QTimer::singleShot(100, this,[=](){ + QApplication::quit(); + }); }