User Tools

Site Tools


DzDesktopWidget

Script wrapper for QDesktopWidget.

More...

Inherits :

Properties

Constructors

DAZ Script
DzDesktopWidget ()

Methods

Signals

voidresized ( Number screen )
voidscreenCountChanged ( Number newCount )
voidworkAreaResized ( Number screen )

Detailed Description

Provides information about the user's desktop, such as its total size, number of screens, the geometry of each screen, and whether they are configured as separate desktops or a single virtual desktop.

Since:

  • 4.7.1.x

Properties


Number : primaryScreen

Holds the index of the screen that is configured to be the primary screen on the system.


Number : screenCount

Holds the number of screens currently available on the system.


Boolean : virtualDesktop

Holds if the system manages the available screens in a virtual desktop.

Constructors


DzDesktopWidget()

Creates an instance of the desktop, as a widget.

Methods


Rect : availableGeometry( Number screen=-1 )

Parameter(s):

  • screen - The index of the screen to get the available geometry for. The default screen is used if this is -1.

Return Value:

  • The available geometry of the screen at the specified index (if any). What is available will be a sub-rect of screenGeometry() based on what the platform decides is available (for example excludes the dock and menu bar on Mac OS X, or the task bar on Windows).

Rect : availableGeometry( QWidget widget )

Parameter(s):

  • widget - The widget on the screen to get the available geometry for.

Return Value:

  • The available geometry of the screen which contains widget.

Rect : availableGeometry( Point point )

Parameter(s):

  • point - The position on the screen to get the available geometry for.

Return Value:

  • The available geometry of the screen which contains point.

Object : screen( Number index=-1 )

Parameter(s):

  • index - The index of the screen to get information for. The default screen is used if this is -1.

Return Value:

  • An object that represents the screen at the specified index (if any). If the system uses a virtual desktop, the returned object will have the geometry of the entire virtual desktop; i.e. the bounds of all screens as one.
(function(){
 
	var wDesktop = new DzDesktopWidget();
	print( JSON.stringify( wDesktop.screen( 0 ), null, "\t" ) );
 
})();

Since:

  • 4.15.0.19

Rect : screenGeometry( Point point )

Parameter(s):

  • point - The Point on the screen to get the geometry for.

Return Value:

  • The geometry of the screen which contains point.

Rect : screenGeometry( Number screen=-1 )

Parameter(s):

  • screen - The index of the screen to get the geometry for. The default screen is used if this is outside the range of screens.

Return Value:

  • The geometry of the screen at the specified index.

Rect : screenGeometry( QWidget widget )

Parameter(s):

  • widget - The widget on the screen to get the geometry for.

Return Value:

  • The geometry of the screen which contains widget.

Number : screenNumber( Point point )

Parameter(s):

  • point - The Point to get the screen number for.

Return Value:

  • The index of the screen that contains the Pointpoint, or -1 if is not on a screen.

Number : screenNumber( QWidget widget=0 )

Parameter(s):

  • widget - The widget to get the screen number for.

Return Value:

  • The index of the screen that contains the largest part of widget, or -1 if the widget not on a screen.

See Also:

Signals


void : resized( Number screen )

Signature:“resized(int)”

Emitted when the size of a screen changes.

Parameter(s):

  • screen - The index of the screen that changed.

void : screenCountChanged( Number newCount )

Signature:“screenCountChanged(int)”

Emitted when the number of screens changes to newCount.

Parameter(s):

  • newCount - The new count of screens.

void : workAreaResized( Number screen )

Signature:“workAreaResized(int)”

Emitted when the work area available on a screen changes.

Parameter(s):

  • screen - The index of the screen that changed.