Hi,
If I have understand your message correctly, does this code snippet., changes
to portait and landscape mode using when settings->properties change?
Import qt 4.7
Item {
state: (runtime.orientation == Orientation.Landscape)? 'landscape':''
Rectangle {
id: mainview
width: 480
height: 800
color: "#d2d2d2"
}
states: [
State {
name: "landscape"
PropertyChanges {
target: mainview
width: 800
height: 480
color: "#d2d2d2"
}
}
]
}
I am waiting for the intregation to be finished,so that i can try out the
latest sources.
Cheers,
Rakesh
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Leonardo Sobral Cunha
Sent: Wednesday, April 14, 2010 8:42 AM
To: [email protected]
Subject: [Qt-qml] Screent Orientation and Active Window in Runtime Object
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
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml