aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickscreen.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-01-24 10:04:45 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-24 21:01:53 +0100
commitd2d53dffbc3ba52333e559e2c0391bd73e5b840c (patch)
treef156da156fe9d715e58ac5d8cc5e5cecfbb46a0a /src/quick/items/qquickscreen.cpp
parent40bbc9503b988412202836bc4d10a0a9f645a940 (diff)
Adapted QQuickScreenAttached to orientation API changes in QScreen.
Change-Id: Ic2cb008b989780e297f03ddd5bdef466bb230c74 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/quick/items/qquickscreen.cpp')
-rw-r--r--src/quick/items/qquickscreen.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp
index dc9a3d3630..3769f4e809 100644
--- a/src/quick/items/qquickscreen.cpp
+++ b/src/quick/items/qquickscreen.cpp
@@ -74,10 +74,10 @@ QT_BEGIN_NAMESPACE
\qmlattachedproperty Qt::ScreenOrientation QtQuickWindow2::Screen::primaryOrientation
\readonly
- This contains the primary orientation of the screen. This can only change if the screen changes.
+ This contains the primary orientation of the screen.
*/
/*!
- \qmlattachedproperty Qt::ScreenOrientation QtQuickWindow2::Screen::currentOrientation
+ \qmlattachedproperty Qt::ScreenOrientation QtQuickWindow2::Screen::orientation
\readonly
This contains the current orientation of the screen.
@@ -119,20 +119,20 @@ int QQuickScreenAttached::height() const
Qt::ScreenOrientation QQuickScreenAttached::primaryOrientation() const
{
if (!m_screen)
- return Qt::UnknownOrientation;
+ return Qt::PrimaryOrientation;
return m_screen->primaryOrientation();
}
-Qt::ScreenOrientation QQuickScreenAttached::currentOrientation() const
+Qt::ScreenOrientation QQuickScreenAttached::orientation() const
{
if (!m_screen)
- return Qt::UnknownOrientation;
- return m_screen->currentOrientation();
+ return Qt::PrimaryOrientation;
+ return m_screen->orientation();
}
int QQuickScreenAttached::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
{
- return QScreen::angleBetween(a,b);
+ return m_screen->angleBetween(a,b);
}
void QQuickScreenAttached::canvasChanged(QQuickCanvas* c)//Called by QQuickItemPrivate::initCanvas
@@ -147,8 +147,10 @@ void QQuickScreenAttached::canvasChanged(QQuickCanvas* c)//Called by QQuickItemP
this, SIGNAL(widthChanged()));
disconnect(oldScreen, SIGNAL(sizeChanged(QSize)),
this, SIGNAL(heightChanged()));
- disconnect(oldScreen, SIGNAL(currentOrientationChanged(Qt::ScreenOrientation)),
- this, SIGNAL(currentOrientationChanged()));
+ disconnect(oldScreen, SIGNAL(orientationChanged(Qt::ScreenOrientation)),
+ this, SIGNAL(orientationChanged()));
+ disconnect(oldScreen, SIGNAL(primaryOrientationChanged(Qt::ScreenOrientation)),
+ this, SIGNAL(primaryOrientationChanged()));
}
if (!screen)
@@ -158,8 +160,9 @@ void QQuickScreenAttached::canvasChanged(QQuickCanvas* c)//Called by QQuickItemP
emit widthChanged();
emit heightChanged();
}
- if (!oldScreen || screen->currentOrientation() != oldScreen->currentOrientation())
- emit currentOrientationChanged();
+
+ if (!oldScreen || screen->orientation() != oldScreen->orientation())
+ emit orientationChanged();
if (!oldScreen || screen->primaryOrientation() != oldScreen->primaryOrientation())
emit primaryOrientationChanged();
@@ -168,8 +171,10 @@ void QQuickScreenAttached::canvasChanged(QQuickCanvas* c)//Called by QQuickItemP
this, SIGNAL(widthChanged()));
connect(screen, SIGNAL(sizeChanged(QSize)),
this, SIGNAL(heightChanged()));
- connect(screen, SIGNAL(currentOrientationChanged(Qt::ScreenOrientation)),
- this, SIGNAL(currentOrientationChanged()));
+ connect(screen, SIGNAL(orientationChanged(Qt::ScreenOrientation)),
+ this, SIGNAL(orientationChanged()));
+ connect(screen, SIGNAL(primaryOrientationChanged(Qt::ScreenOrientation)),
+ this, SIGNAL(primaryOrientationChanged()));
}
}