Sailfish OS
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS
Select Page
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS

API Documentation

Documentation for developing SailfishOS applications
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon

Contents

  • Properties
  • Detailed Description

Screen QML Type

Provides device display attributes More...

Import Statement: import Sailfish.Silica 1.0
  • List of all members, including inherited members

Properties

  • height : int
  • sizeCategory : enumeration
  • width : int
  • widthRatio : qreal

Detailed Description

The Screen object exposes attributes of the device display. This is a singleton object; the Screen type cannot be instantiated.

For example, the window below uses the Screen object to show a different starting page depending on the size of the screen:

 import QtQuick 2.2
 import Sailfish.Silica 1.0

 ApplicationWindow {
     initialPage: Screen.sizeCategory >= Screen.Large
                  ? Qt.resolvedUrl("SplitViewPage.qml")
                  : Qt.resolvedUrl("ListViewPage.qml")
 }

Property Documentation

height : int

The larger of the screen dimensions. For example with a 540x960 display the height would return 960. The value is static and does not follow the device orientation.


sizeCategory : enumeration

The physical size of the screen categorized into size groups.

The value of the property may be one of:

  • Screen.Small
  • Screen.Medium
  • Screen.Large
  • Screen.ExtraLarge

Typical phone and tablet devices are in Screen.Medium and Screen.Large categories, respectively.


width : int

The smaller of the screen dimensions. For example with a 540x960 display the width would return 540. The value is static and does not follow the device orientation.


widthRatio : qreal

The width ratio relative to the 540 pixels wide qHD display. The value is 1.33 for 720 pixel wide HD display, 2.0 for 1080 pixel wide Full HD display and so on. The ratio is useful for scaling UI geometry parameters relative to the display size. For most content items you want to scale the dimensions based on Theme.pixelRatio (that roughly follows DPI) instead to be able show more content on larger displays, but there are some billboard style titles and graphic banners that should follow the growth of display's physical dimensions.


  • Legal
  • Contact Us
  • Jolla Mobile Ltd © 2025

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn