summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/offscreen/qoffscreencommon.h
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.h
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.h')
-rw-r--r--src/plugins/platforms/offscreen/qoffscreencommon.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/platforms/offscreen/qoffscreencommon.h b/src/plugins/platforms/offscreen/qoffscreencommon.h
index f4f0142911..abb641fbbc 100644
--- a/src/plugins/platforms/offscreen/qoffscreencommon.h
+++ b/src/plugins/platforms/offscreen/qoffscreencommon.h
@@ -54,23 +54,34 @@
QT_BEGIN_NAMESPACE
+class QOffscreenIntegration;
class QOffscreenScreen : public QPlatformScreen
{
public:
- QOffscreenScreen();
+ QOffscreenScreen(const QOffscreenIntegration *integration);
QRect geometry() const override { return m_geometry; }
int depth() const override { return 32; }
QImage::Format format() const override { return QImage::Format_RGB32; }
+ QDpi logicalDpi() const override { return QDpi(m_logicalDpi, m_logicalDpi); }
+ QDpi logicalBaseDpi() const override { return QDpi(m_logicalBaseDpi, m_logicalBaseDpi); }
+ qreal devicePixelRatio() const override { return m_dpr; }
+ QString name() const override { return m_name; }
QPlatformCursor *cursor() const override { return m_cursor.data(); }
+ QList<QPlatformScreen *> virtualSiblings() const override;
QPixmap grabWindow(WId window, int x, int y, int width, int height) const override;
static QPlatformWindow *windowContainingCursor;
public:
+ QString m_name;
QRect m_geometry;
+ int m_logicalDpi = 96;
+ int m_logicalBaseDpi= 96;
+ qreal m_dpr = 1;
QScopedPointer<QPlatformCursor> m_cursor;
+ const QOffscreenIntegration *m_integration;
};
#if QT_CONFIG(draganddrop)