diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-05-29 15:52:59 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-05-29 15:42:05 +0000 |
commit | a9cb962a5e7d8da48f11503406f2afbde499db21 (patch) | |
tree | 0e6f5e08e801118f2dd41ca25f08543b5257329a /src/gui/kernel/qscreen_p.h | |
parent | f9b1596fe1aeacf4f3d977c32e74b7ad585d3d3e (diff) |
Connect QPlatformScreen in the QScreen constructor
Make sure that we can use functions that depend on the platform screen
from the QScreen constructor.
Change-Id: I0f365994d0e63a942e6ba3c64e76438bbcb95fa9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qscreen_p.h')
-rw-r--r-- | src/gui/kernel/qscreen_p.h | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/gui/kernel/qscreen_p.h b/src/gui/kernel/qscreen_p.h index 7a5fc88068..4492eddd45 100644 --- a/src/gui/kernel/qscreen_p.h +++ b/src/gui/kernel/qscreen_p.h @@ -55,29 +55,15 @@ QT_BEGIN_NAMESPACE class QScreenPrivate : public QObjectPrivate { + Q_DECLARE_PUBLIC(QScreen) public: - QScreenPrivate(QPlatformScreen *screen) - : platformScreen(screen) + QScreenPrivate() + : platformScreen(0) , orientationUpdateMask(0) { - orientation = platformScreen->orientation(); - geometry = platformScreen->deviceIndependentGeometry(); - availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(), QHighDpiScaling::factor(platformScreen), geometry.topLeft()); - logicalDpi = platformScreen->logicalDpi(); - refreshRate = platformScreen->refreshRate(); - // safeguard ourselves against buggy platform behavior... - if (refreshRate < 1.0) - refreshRate = 60.0; - - updatePrimaryOrientation(); - - filteredOrientation = orientation; - if (filteredOrientation == Qt::PrimaryOrientation) - filteredOrientation = primaryOrientation; - - updateHighDpi(); } + void setPlatformScreen(QPlatformScreen *screen); void updateHighDpi() { geometry = platformScreen->deviceIndependentGeometry(); |