diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-05-17 18:24:26 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-05-23 14:30:10 +0000 |
commit | 9d2df53348d907ad682e5e4e3c7dab64637a7657 (patch) | |
tree | 754b4739de3788f0bc05aa3a7906e84c0538790e | |
parent | ad8bc45732eeb2efa6e885d564c10761e7154889 (diff) |
Fix ClipboardChangeObserver
The meta type for QClipboard::Mode must be registered, because we're
passing it from the application thread to the IO thread.
Without this registration, one can trigger Qt metaobject warnings by
alternating between copying text and copying images to the clipboard.
Change-Id: I0f7f69a3e80c6b2326be0a0c562c867063449fa5
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
-rw-r--r-- | src/core/clipboard_qt.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp index e632c5583..93f239f63 100644 --- a/src/core/clipboard_qt.cpp +++ b/src/core/clipboard_qt.cpp @@ -53,6 +53,13 @@ namespace QtWebEngineCore { +static void registerMetaTypes() +{ + qRegisterMetaType<QClipboard::Mode>("QClipboard::Mode"); +} + +Q_CONSTRUCTOR_FUNCTION(registerMetaTypes) + Q_GLOBAL_STATIC(ClipboardChangeObserver, clipboardChangeObserver) ClipboardChangeObserver::ClipboardChangeObserver() |