Skip to content

Commit bcce45e

Browse files
committed
Merge pull request #2441 from Diapolo/Qt_fix_copy_context_menu
Bitcoin-Qt: fix copy via context-menu broken
2 parents e960bf4 + 39ee862 commit bcce45e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/qt/guiutil.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ void copyEntryData(QAbstractItemView *view, int column, int role)
160160

161161
if(!selection.isEmpty())
162162
{
163-
// Copy first item
164-
QApplication::clipboard()->setText(selection.at(0).data(role).toString(),QClipboard::Selection);
163+
// Copy first item (global clipboard)
164+
qApp->clipboard()->setText(selection.at(0).data(role).toString(), QClipboard::Clipboard);
165+
// Copy first item (global mouse selection for e.g. X11 - NOP on Windows)
166+
qApp->clipboard()->setText(selection.at(0).data(role).toString(), QClipboard::Selection);
165167
}
166168
}
167169

@@ -213,7 +215,7 @@ QString getSaveFileName(QWidget *parent, const QString &caption,
213215

214216
Qt::ConnectionType blockingGUIThreadConnection()
215217
{
216-
if(QThread::currentThread() != QCoreApplication::instance()->thread())
218+
if(QThread::currentThread() != qApp->thread())
217219
{
218220
return Qt::BlockingQueuedConnection;
219221
}
@@ -457,4 +459,3 @@ void HelpMessageBox::showOrPrint()
457459
}
458460

459461
} // namespace GUIUtil
460-

0 commit comments

Comments
 (0)