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

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

Contents

  • Public Types
  • Properties
  • Public Functions
  • Static Public Members
  • Detailed Description

Screen Class

Allows to access the screen properties More...

Header: #include <silicascreen.h>
  • List of all members, including inherited members

Public Types

enum SizeCategory { Small, Medium, Large, ExtraLarge }

Properties

  • height : const int
  • sizeCategory : const SizeCategory
  • width : const int
  • widthRatio : const qreal

Public Functions

Screen(QObject *parent = 0)
~Screen()
int height() const
SizeCategory sizeCategory() const
int width() const
qreal widthRatio() const

Static Public Members

Screen *instance()

Detailed Description

Allows to access the screen properties

Member Type Documentation

enum Screen::SizeCategory

ConstantValueDescription
Screen::Small0Small screen
Screen::Medium1Medium screen
Screen::Large2Large screen
Screen::ExtraLarge3Extra large screen

The physical size of the screen categorized into size groups. Typical phone and tablet devices are in Screen::Medium and Screen::Large categories, respectively.

Property Documentation

height : const 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.

Access functions:

int height() const

sizeCategory : const SizeCategory

The category of the screen size

Access functions:

SizeCategory sizeCategory() const

width : const 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.

Access functions:

int width() const

widthRatio : const 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.

Access functions:

qreal widthRatio() const

Member Function Documentation

Screen::Screen(QObject *parent = 0)

Default constructs an instance of Screen.

Screen::~Screen()

Destroys the instance of Screen.

[static] Screen *Screen::instance()

Returns a singleton instance of the Screen

  • Legal
  • Contact Us
  • Jolla Mobile Ltd © 2025

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn