ScreenExtras QML Type

A Signleton that is used to gather information about screens and set up things like Font sizes and scale sizes More...

Import Statement: import QmlScreenExtras 1.0

Properties

Methods

Detailed Description

Example of using the font


  Text{
     font.pixelSize: ScreenExtras.font(ScreenExtras.NORMAL)
  }

Example of setting width or height

this would set the width of the Rectangle to 16 px if the scale size is 1


  Rectangle{
     width ScreenExtras.gu(2)
  }

Property Documentation

desktopHeight : int

Returns the Screens height. This is without the Window managers padding. designHeight

See also virtualHeight.


desktopWidth : int

Returns the Screens width. This is without the Window managers padding. if you would like to get the screens width minus what the window manager is taking up see designWidth

See also virtualWidth.


formFactor : string

returns the current formfactor as a string for the device that is being used

There are 5 values

  • desktop
  • tv
  • phablet
  • tablet
  • phone

numberOfScreens : int

Returns a number of all the screens associated with the windowing system the application is connected to.


primaryScreenName : string

Returns a common name fro the primary screen.


scaleSize : double

returns what QScreen thinks the scaleSize should be set to. I would not use this.


virtualHeight : int

This property holds the available width of the Screen minus what the windowmanager is taking up


virtualWidth : int

This property holds the available width of the Screen minus what the windowmanager is taking up


Method Documentation

font(Font)

FontSize

This is used to set the font size here is a example


  Text{
     font.pixelSize: ScreenExtras.font(ScreenExtras.NORMAL)
  }

see also the types of font sizes


screenNameAt(int screenNumber)

returns the name of a a screen at a given int


screenRefreshRateAt(int screenNUmber)

Returns the refresh rate of a screen at its interger,

Example: say that I have for screens attached to a machine and I want to get teh refresh rate of the screen that is the 3rd one.


  ScreenExtras.screenRefreshRateAt(2)

See also numberOfScreens.