Screen

The Screen attached object provides information about the Screen an Item is displayed on. More...

Attached Properties

Attached Methods

  • int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)

Detailed Description

The Screen attached object is only valid inside Item or Item derived types, after component completion. Inside these items it refers to the screen that the item is currently being displayed on.

To use this type, you will need to import the module with the following line:

import QtQuick.Window 2.0

Note that the Screen type is not valid at Component.onCompleted, because the Item has not been displayed on a screen by this time.

Restricting this import will allow you to have a QML environment without access to window system features.

Attached Property Documentation

read-onlyScreen.height : int

This contains the height of the screen in pixels.


read-onlyScreen.orientation : Qt::ScreenOrientation

This contains the current orientation of the screen.


read-onlyScreen.primaryOrientation : Qt::ScreenOrientation

This contains the primary orientation of the screen.


read-onlyScreen.width : int

This contains the width of the screen in pixels.


Attached Method Documentation

int Screen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)

Returns the rotation angle, in degrees, between the two specified angles.