Qt Reference Documentation

QML Window Element

Provides a component that is normally the application's root component and handles transitions when the user rotates the screen. More...

Inherited by ApplicationWindow and PageStackWindow.

This element was introduced in Qt Quick Components 1.0.

Properties

Signal Handlers

Detailed Description

An application can be in the portrait or the landscape orientation. A user can physically rotate the device between these orientations, so you may want to layout the application's content differently depending on the screen's orientation. When the user rotates the screen, Window sends various signals at different phases of the rotation. Window handles also the resizing of the screen and possible transitions when the orientation changes. Applications utilizing QtQuick Components for Symbian should use Window as the root item. The Window component should not be used as a child item.

From Nokia Belle Feature Pack 1 onwards, the included Qt Quick Components for Symbian will include a new Window implementation that enables orientation change animations. Qt Quick Components version number will not be increased. To make your application future-proof, do not refer to the Window id when you anchor children to the Window - refer to the parent instead.

Wrong (child anchoring refers to the Window id):

 Window {
     id: root

     Statusbar { anchors.top: root.top }

     ToolBar { anchors.bottom: root.bottom }
 }

Correct (child anchoring refers to the parent):

 Window {
     id: root

     Statusbar { anchors.top: parent.top }

     ToolBar { anchors.bottom: parent.bottom }
 }

Property Documentation

inPortrait : bool

If the screen is in the portrait orientation, the value is true. If the screen is in the landscape orientation, the value is false.


platformInverted : bool

Symbian:

If platformInverted is true, the component is visualized with the inverted style. For more information, see Using Inverted Style with Symbian Components. By default platformInverted is false.

This property group was introduced in Qt Quick Components 1.1.


Signal Handler Documentation

Window::orientationChangeAboutToStart ()

This signal is emitted when the screen orientation starts to change from one orientation to another. After this signal is emitted

  • you can start to prepare your application for the new screen orientation. For example, you can stop all screen animations.
  • the inPortrait property indicates the new orientation.

Window::orientationChangeFinished ()

This signal is emitted when the orientation change transition, for example screen transition animation, ends.


Window::orientationChangeStarted ()

This signal is emitted when the orientation change transition, for example screen transition animation, starts.