aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-02-20 09:35:02 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-20 11:28:00 +0100
commit9d2a09ddbda602c1fb32f23aaa33a9a51989e06c (patch)
tree15b67e4540e78028260962898fd0e872baab992d /src
parentcb9a213e540c5152a5c9634d590285fb4d231141 (diff)
Fix Screen::AngleBetween
Enum values in invokables don't worry currently, so use ints. Also AngleBetween is no longer static, so it has to be initialized before the function can be used. Change-Id: I4a6748fef6920bab6f08f22ce68911c3af6ce821 Reviewed-by: Martin Jones <martin.jones@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickscreen.cpp6
-rw-r--r--src/quick/items/qquickscreen_p.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp
index 4b70e2b0b2..b6bd78bd7f 100644
--- a/src/quick/items/qquickscreen.cpp
+++ b/src/quick/items/qquickscreen.cpp
@@ -130,9 +130,11 @@ Qt::ScreenOrientation QQuickScreenAttached::orientation() const
return m_screen->orientation();
}
-int QQuickScreenAttached::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
+int QQuickScreenAttached::angleBetween(int a, int b)
{
- return m_screen->angleBetween(a,b);
+ if (!m_screen)
+ return Qt::PrimaryOrientation;
+ return m_screen->angleBetween((Qt::ScreenOrientation)a,(Qt::ScreenOrientation)b);
}
void QQuickScreenAttached::canvasChanged(QQuickCanvas* c)//Called by QQuickItemPrivate::initCanvas
diff --git a/src/quick/items/qquickscreen_p.h b/src/quick/items/qquickscreen_p.h
index 1940f16b02..7e2c389d6c 100644
--- a/src/quick/items/qquickscreen_p.h
+++ b/src/quick/items/qquickscreen_p.h
@@ -73,7 +73,8 @@ public:
Qt::ScreenOrientation primaryOrientation() const;
Qt::ScreenOrientation orientation() const;
- Q_INVOKABLE int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b);
+ //Treats int as Qt::ScreenOrientation, due to QTBUG-20639
+ Q_INVOKABLE int angleBetween(int a, int b);
void canvasChanged(QQuickCanvas*);