diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2012-12-05 17:38:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-06 20:37:13 +0100 |
commit | 7da7bbcd874197054df5e5691d41d4e2dbe55f4a (patch) | |
tree | 4886798813f949e2b96f4341d36704485a1c6656 /examples/opengl/paintedwindow | |
parent | 675676aba1e71410fa6cfca430ab9bd64ebdcdaa (diff) |
Removed requestOrientation() API from QWindow.
There are no proper implementations of this API, and as it stands it
only acts to confuse anyone who stumbles across it. It will be better to
revisit the full cross platform orientation API story for 5.1.
Change-Id: Iff7054a32c6e5e4ad0cc0493a5e4ecc35a6ec4f3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'examples/opengl/paintedwindow')
-rw-r--r-- | examples/opengl/paintedwindow/paintedwindow.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/examples/opengl/paintedwindow/paintedwindow.cpp b/examples/opengl/paintedwindow/paintedwindow.cpp index 0920e6e89d..3aa21a04b6 100644 --- a/examples/opengl/paintedwindow/paintedwindow.cpp +++ b/examples/opengl/paintedwindow/paintedwindow.cpp @@ -70,12 +70,10 @@ PaintedWindow::PaintedWindow() m_animation->setEndValue(qreal(1)); m_animation->setDuration(500); - requestOrientation(Qt::PortraitOrientation); - QRect screenGeometry = screen()->availableGeometry(); QPoint center = screenGeometry.center(); - QRect windowRect = screen()->isLandscape(orientation()) ? QRect(0, 0, 640, 480) : QRect(0, 0, 480, 640); + QRect windowRect = screen()->isLandscape(screen()->orientation()) ? QRect(0, 0, 640, 480) : QRect(0, 0, 480, 640); setGeometry(QRect(center - windowRect.center(), windowRect.size())); m_rotation = 0; @@ -142,13 +140,13 @@ void PaintedWindow::orientationChanged(Qt::ScreenOrientation newOrientation) QPainter p; p.begin(&m_prevImage); - p.setTransform(screen()->transformBetween(contentOrientation(), orientation(), rect)); - paint(&p, screen()->mapBetween(contentOrientation(), orientation(), rect)); + p.setTransform(screen()->transformBetween(contentOrientation(), screen()->orientation(), rect)); + paint(&p, screen()->mapBetween(contentOrientation(), screen()->orientation(), rect)); p.end(); p.begin(&m_nextImage); - p.setTransform(screen()->transformBetween(newOrientation, orientation(), rect)); - paint(&p, screen()->mapBetween(newOrientation, orientation(), rect)); + p.setTransform(screen()->transformBetween(newOrientation, screen()->orientation(), rect)); + paint(&p, screen()->mapBetween(newOrientation, screen()->orientation(), rect)); p.end(); m_deltaRotation = screen()->angleBetween(newOrientation, contentOrientation()); @@ -207,9 +205,9 @@ void PaintedWindow::paint() painter.setOpacity(m_rotation); painter.drawImage(0, 0, m_nextImage); } else { - QRect mapped = screen()->mapBetween(contentOrientation(), orientation(), rect); + QRect mapped = screen()->mapBetween(contentOrientation(), screen()->orientation(), rect); - painter.setTransform(screen()->transformBetween(contentOrientation(), orientation(), rect)); + painter.setTransform(screen()->transformBetween(contentOrientation(), screen()->orientation(), rect)); paint(&painter, mapped); painter.end(); } |