API Documentation
Documentation for developing SailfishOS applicationsScreen Class
Allows to access the screen properties More...
| Header: | #include <silicascreen.h> |
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
| Constant | Value | Description |
|---|---|---|
Screen::Small | 0 | Small screen |
Screen::Medium | 1 | Medium screen |
Screen::Large | 2 | Large screen |
Screen::ExtraLarge | 3 | Extra 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