From f4a66e5c4c4be97a7511b372930e20f330ea0813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 3 Feb 2020 23:03:29 +0100 Subject: QPA offscreen: make platform plugin configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ability to load a json config file containing screen configuration at startup. The config file location is specified using platform options: -platform offscfreen:configfile=/path/to/file Config file format example: { “screens”: [ { "name", "screen-1", "x", 0, "y", 0, "width", 640, "height", 480, "dpi", 96, "dpr", 1, }, … ] } Change-Id: Iac21aaafa6d0f361bdd6f6e9168b7e68db6ae011 Reviewed-by: Paul Olav Tvete Reviewed-by: Friedemann Kleint --- src/plugins/platforms/offscreen/qoffscreencommon.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/offscreen/qoffscreencommon.cpp') diff --git a/src/plugins/platforms/offscreen/qoffscreencommon.cpp b/src/plugins/platforms/offscreen/qoffscreencommon.cpp index de75a3e012..3d02721869 100644 --- a/src/plugins/platforms/offscreen/qoffscreencommon.cpp +++ b/src/plugins/platforms/offscreen/qoffscreencommon.cpp @@ -38,8 +38,10 @@ ****************************************************************************/ #include "qoffscreencommon.h" +#include "qoffscreenintegration.h" #include "qoffscreenwindow.h" + #include #include @@ -50,6 +52,12 @@ QT_BEGIN_NAMESPACE QPlatformWindow *QOffscreenScreen::windowContainingCursor = nullptr; + +QList QOffscreenScreen::virtualSiblings() const +{ + return m_integration->screens(); +} + class QOffscreenCursor : public QPlatformCursor { public: @@ -93,9 +101,10 @@ private: QPoint m_pos; }; -QOffscreenScreen::QOffscreenScreen() +QOffscreenScreen::QOffscreenScreen(const QOffscreenIntegration *integration) : m_geometry(0, 0, 800, 600) , m_cursor(new QOffscreenCursor) + , m_integration(integration) { } -- cgit v1.2.3