[Qt-qml] Screent Orientation and Active Window in Runtime Object
Adriano Rezende
adriano.rezende at openbossa.org
Mon Apr 19 15:24:02 CEST 2010
Hi,
Maybe it's a good idea to have some properties to lock the window in
portrait or landscape mode from qml side.
This will avoid platform specific code from the C++ side (symbian/maemo).
br,
Adriano
On Wed, Apr 14, 2010 at 2:41 AM, Leonardo Sobral Cunha
<leo.cunha at nokia.com> wrote:
> hi,
>
> We just added a 'runtime' object in the root context. This 'runtime' has for
> now 2 properties: 'orientation' and 'isActiveWindow'
>
> below are two examples on how to use the runtime properties, you just need to
> import Qt 4.7
>
> import Qt 4.7
> Item {
> state: (runtime.orientation == Orientation.Landscape) ? 'landscape' : ''
> }
>
> import Qt 4.7
> Item {
> width: 300; height: 200
> Rectangle {
> width: 100; height: 100
> color: "green"
> SequentialAnimation on x {
> running: runtime.isActiveWindow
> loops: Animation.Infinite
> NumberAnimation {to: 200}
> NumberAnimation {to: 0}
> }
> }
> }
>
> NOTE that we removed the previous way of accessing the orientation through the
> Screen element .
>
> the qmlruntime docs are also updated.
> this change is still the qml repo waiting to be integrated.
>
> br,
> leo
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
>
More information about the Qt-qml
mailing list