aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-04-17 13:28:22 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-04-17 13:28:25 +0200
commit4a1751a929cc5727d4941543baf2238f041b4b70 (patch)
treebf04e7673a6575cffef5c593f3b8bbeb8937e46d
parentf5e8bcf985df212c901b1e3e1ed0b68933c321f6 (diff)
parent7f3a5980c1d54988a707b961fd2ef647cebb4c5b (diff)
Merge bitcoin-core/gui#277: Do not use QClipboard::Selection on Windows and macOS.
7f3a5980c1d54988a707b961fd2ef647cebb4c5b qt: Do not use QClipboard::Selection on Windows and macOS. (Hennadii Stepanov) Pull request description: Windows and macOS do [not support](https://doc.qt.io/qt-5/qclipboard.html#notes-for-windows-and-macos-users) the global mouse selection. Fixes #258. ACKs for top commit: promag: Code review ACK 7f3a5980c1d54988a707b961fd2ef647cebb4c5b. jarolrod: ACK 7f3a5980c1d54988a707b961fd2ef647cebb4c5b Tree-SHA512: be2beeef7d25af6f4d4a4548325d8d29f08e4342f499666bc4a670ed468a63195d514077c2cd0dba197e12bd43316fd3e2813cdc0954364b6aa4ae6b90c118bf
-rw-r--r--src/qt/guiutil.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 0e91f9f385..d10bf9f9ae 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -630,8 +630,11 @@ bool SetStartOnSystemStartup(bool fAutoStart) { return false; }
void setClipboard(const QString& str)
{
- QApplication::clipboard()->setText(str, QClipboard::Clipboard);
- QApplication::clipboard()->setText(str, QClipboard::Selection);
+ QClipboard* clipboard = QApplication::clipboard();
+ clipboard->setText(str, QClipboard::Clipboard);
+ if (clipboard->supportsSelection()) {
+ clipboard->setText(str, QClipboard::Selection);
+ }
}
fs::path qstringToBoostPath(const QString &path)