diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2012-01-11 13:16:24 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-12 12:08:19 +0100 |
commit | 16c2622fe7e8e43bdb6447399c816cd22c3c2f58 (patch) | |
tree | 7bbac965a630f6798064f9643ad95e6e4a5a37a6 /src/gui/kernel/qguiapplication.cpp | |
parent | 738896d6b9bb9c521fcc7dd3d7418664411164a6 (diff) |
Made it possible to report screen changes through QWindowSystemInterface.
This makes it possible for platform plugin independent code (such as
generic plugins) to report changes to screen properties. An example
would be an accelerometer plugin that reports orientation changes
without knowing anything about the windowing system.
Change-Id: I984984b6d064327772c264bc942269422451da37
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 96b9222fe0..c674573bb6 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -57,6 +57,7 @@ #include <QtDebug> #include <qpalette.h> #include <qscreen.h> +#include <private/qscreen_p.h> #include <QtGui/QPlatformIntegration> #include <QtGui/QGenericPluginFactory> @@ -1021,6 +1022,8 @@ void QGuiApplicationPrivate::reportScreenOrientationChange(QWindowSystemInterfac return; QScreen *s = e->screen.data(); + s->d_func()->currentOrientation = e->orientation; + emit s->currentOrientationChanged(s->currentOrientation()); QScreenOrientationChangeEvent event(s, s->currentOrientation()); @@ -1037,6 +1040,7 @@ void QGuiApplicationPrivate::reportGeometryChange(QWindowSystemInterfacePrivate: return; QScreen *s = e->screen.data(); + s->d_func()->geometry = e->geometry; emit s->sizeChanged(s->size()); emit s->geometryChanged(s->geometry()); @@ -1058,6 +1062,7 @@ void QGuiApplicationPrivate::reportAvailableGeometryChange( return; QScreen *s = e->screen.data(); + s->d_func()->availableGeometry = e->availableGeometry; emit s->availableSizeChanged(s->availableSize()); emit s->availableGeometryChanged(s->availableGeometry()); @@ -1073,6 +1078,7 @@ void QGuiApplicationPrivate::reportLogicalDotsPerInchChange(QWindowSystemInterfa return; QScreen *s = e->screen.data(); + s->d_func()->logicalDpi = QDpi(e->dpiX, e->dpiY); emit s->logicalDotsPerInchXChanged(s->logicalDotsPerInchX()); emit s->logicalDotsPerInchYChanged(s->logicalDotsPerInchY()); |