summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/offscreen/qoffscreenintegration.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-10-29 16:23:10 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-10-30 16:32:57 +0000
commitecd11e498f18a18a79a062c39c0917439479ae4d (patch)
tree87b0b918aaf6c05385e1035dcd2fc1dd519bd181 /src/plugins/platforms/offscreen/qoffscreenintegration.h
parentd017baac8993757c035d5ba2829e88e946c169cc (diff)
Offscreen QPA: implement a native interface
Many code paths simply expect to have a native interface available, and won't check if a plugin is returning nullptr for it. This leads to crashes or local workarounds (e.g. 3197932e6fb03fb9c0ff669af858cb94e3836d79). Instead, have offscreen implement a dummy native interface. This requires shuffling some code for the X11 integration. Pick-to: 5.15 Change-Id: I2bdceee379e4ded9b085ebbb4d03d1e074f60726 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/offscreen/qoffscreenintegration.h')
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.h b/src/plugins/platforms/offscreen/qoffscreenintegration.h
index be47313913..38d145eee3 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration.h
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration.h
@@ -71,19 +71,22 @@ public:
QPlatformFontDatabase *fontDatabase() const override;
QAbstractEventDispatcher *createEventDispatcher() const override;
+ QPlatformNativeInterface *nativeInterface() const override;
+
QStringList themeNames() const override;
QPlatformTheme *createPlatformTheme(const QString &name) const override;
static QOffscreenIntegration *createOffscreenIntegration(const QStringList& paramList);
QList<QPlatformScreen *> screens() const;
-private:
+protected:
QScopedPointer<QPlatformFontDatabase> m_fontDatabase;
#if QT_CONFIG(draganddrop)
QScopedPointer<QPlatformDrag> m_drag;
#endif
QScopedPointer<QPlatformInputContext> m_inputContext;
QScopedPointer<QPlatformServices> m_services;
+ mutable QScopedPointer<QPlatformNativeInterface> m_nativeInterface;
QList<QPlatformScreen *> m_screens;
bool m_windowFrameMarginsEnabled = true;
};