Skip to content

Commit 4a1751a

Browse files
author
MarcoFalke
committed
Merge bitcoin-core#277: Do not use QClipboard::Selection on Windows and macOS.
7f3a598 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 bitcoin-core#258. ACKs for top commit: promag: Code review ACK 7f3a598. jarolrod: ACK 7f3a598 Tree-SHA512: be2beeef7d25af6f4d4a4548325d8d29f08e4342f499666bc4a670ed468a63195d514077c2cd0dba197e12bd43316fd3e2813cdc0954364b6aa4ae6b90c118bf
2 parents f5e8bcf + 7f3a598 commit 4a1751a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/qt/guiutil.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,11 @@ bool SetStartOnSystemStartup(bool fAutoStart) { return false; }
630630

631631
void setClipboard(const QString& str)
632632
{
633-
QApplication::clipboard()->setText(str, QClipboard::Clipboard);
634-
QApplication::clipboard()->setText(str, QClipboard::Selection);
633+
QClipboard* clipboard = QApplication::clipboard();
634+
clipboard->setText(str, QClipboard::Clipboard);
635+
if (clipboard->supportsSelection()) {
636+
clipboard->setText(str, QClipboard::Selection);
637+
}
635638
}
636639

637640
fs::path qstringToBoostPath(const QString &path)

0 commit comments

Comments
 (0)