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>
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
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*);