Meego Wiki
Views

TopItem API Snapshot

From MeeGo wiki
Jump to: navigation, search

Contents

Description

The TopItem follows the parent properties to the top most item. The top most item's dimensions can be accessed via topWidth and topHeight. It is recommended to call calcTopParent() before the values are accessed to ensure the top most item is referenced.

API properties

Item topItem
The top most item.
int topWidth
The top most item's width.
int topHeight
The top most item's height.

Signals

orientationChangeFinished
Is sent when the orientation has changed.
geometryChanged
Is sent when the geometry has changed
Parameters:
  • real newWidth, the new width
  • real newHeight, the new height

Functions

calcTopParent
Searches the top most object of type Window and stores it in the property topItem. If no object of type Window is found, the top most object is stored instead.

Example

Rectangle {
    id: exampleRect

    width: topItem.topWidth * 0.5
    height: topItem.topheight * 0.5

    TopItem { id: topItem }

    Component.onCompleted: {
        topItem.calcTopParent()
    }
}
Personal tools