diff options
author | Lorn Potter <[email protected]> | 2018-02-22 04:35:25 +1000 |
---|---|---|
committer | Morten Johan Sørvig <[email protected]> | 2019-02-15 12:46:57 +0000 |
commit | 2c6c724949374b17bd3da2938fe8747b480d575a (patch) | |
tree | 6a2f6dfb2e291a2d2fdcf9fd4883fce9efb8601f /src/plugins/platforms/wasm/qwasmintegration.h | |
parent | ef2ddcf551dec13215cb45cb000731f94b2f8e34 (diff) |
wasm: add clipboard support
This feature uses the js Clipboard API and is supported only in Chrome,
as Firefox only supports reading the clipboard in browser extensions.
It also requires https or localhost access, otherwise access to the
clipboard is blocked by chrome.
Chrome users will be able to copy/paste text to and from the system
clipbaord.
Other browsers will be able to use the clipboard from within the same
application.
Currently only supports text and html.
Task-number: QTBUG-64638
Change-Id: Ie6de9d10812b776519bd6115593b433fe77059fe
Reviewed-by: Morten Johan Sørvig <[email protected]>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmintegration.h')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmintegration.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/qwasmintegration.h b/src/plugins/platforms/wasm/qwasmintegration.h index ebc3d9d4311..4c5aeb4ebca 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.h +++ b/src/plugins/platforms/wasm/qwasmintegration.h @@ -49,6 +49,7 @@ class QWasmEventDispatcher; class QWasmScreen; class QWasmCompositor; class QWasmBackingStore; +class QWasmClipboard; class QWasmIntegration : public QObject, public QPlatformIntegration { @@ -68,12 +69,14 @@ public: QVariant styleHint(QPlatformIntegration::StyleHint hint) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; + QPlatformClipboard *clipboard() const override; - static QWasmIntegration *get(); QWasmScreen *screen() { return m_screen; } QWasmCompositor *compositor() { return m_compositor; } QWasmEventTranslator *eventTranslator() { return m_eventTranslator; } + QWasmClipboard *getWasmClipboard() { return m_clipboard; } + static QWasmIntegration *get() { return s_instance; } static void QWasmBrowserExit(); static void updateQScreenAndCanvasRenderSize(); @@ -85,6 +88,9 @@ private: mutable QWasmEventDispatcher *m_eventDispatcher; static int uiEvent_cb(int eventType, const EmscriptenUiEvent *e, void *userData); mutable QHash<QWindow *, QWasmBackingStore *> m_backingStores; + + mutable QWasmClipboard *m_clipboard; + static QWasmIntegration *s_instance; }; QT_END_NAMESPACE |