Check for selection support of clipboard

Setting the data on a non-supported MIME data will fail
and get deleted.
Checking beforehand gets rid of a warning printed by
QClipboard.

Change-Id: I5b5a371ce5b904f61a1aed5ea21a98908155357b
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2020-05-12 14:56:01 +02:00
parent c3946529ca
commit 5104798b8c
5 changed files with 12 additions and 6 deletions

View File

@@ -586,7 +586,8 @@ DebuggerToolTipWidget::DebuggerToolTipWidget()
<< item->name << '\t' << item->value << '\t' << item->type << '\n';
});
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(text, QClipboard::Selection);
if (clipboard->supportsSelection())
clipboard->setText(text, QClipboard::Selection);
clipboard->setText(text, QClipboard::Clipboard);
});