summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/offscreen/qoffscreencommon.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2020-02-03 23:03:29 +0100
committerMorten Johan Sørvig <morten.sorvig@qt.io>2020-10-20 07:26:46 +0200
commitf4a66e5c4c4be97a7511b372930e20f330ea0813 (patch)
tree013880c3a0f5084b017962310208448a761632cf /src/plugins/platforms/offscreen/qoffscreencommon.cpp
parent0ab89881c5aecc31e44fd83b1a63bd4de52ebe4a (diff)
QPA offscreen: make platform plugin configurable
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 <paul.tvete@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/offscreen/qoffscreencommon.cpp')
-rw-r--r--src/plugins/platforms/offscreen/qoffscreencommon.cpp11
1 files changed, 10 insertions, 1 deletions
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 <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/private/qguiapplication_p.h>
@@ -50,6 +52,12 @@ QT_BEGIN_NAMESPACE
QPlatformWindow *QOffscreenScreen::windowContainingCursor = nullptr;
+
+QList<QPlatformScreen *> 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)
{
}