QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | List of all members
QgsScreenHelper Class Reference

A utility class for dynamic handling of changes to screen properties. More...

#include <qgsscreenhelper.h>

Inheritance diagram for QgsScreenHelper:
Inheritance graph
[legend]

Signals

void availableGeometryChanged (const QRect &geometry)
 Emitted whenever the available geometry of the screen associated with the widget is changed.
 
void screenDpiChanged (double dpi)
 Emitted whenever the screen dpi associated with the widget is changed.
 

Public Member Functions

 QgsScreenHelper (QWidget *parent)
 Constructor for QgsScreenHelper for the specified parent widget.
 
QRect availableGeometry () const
 Returns the current screen available geometry in pixels.
 
QScreen * screen ()
 Returns the screen that the parent widget appears on, or nullptr.
 
double screenDpi () const
 Returns the current screen DPI for the screen that the parent widget appears on.
 
QWindow * windowHandle ()
 Returns the window handle for the window the parent widget is associated with, or nullptr.
 

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override
 

Detailed Description

A utility class for dynamic handling of changes to screen properties.

Since
QGIS 3.28

Definition at line 35 of file qgsscreenhelper.h.

Constructor & Destructor Documentation

◆ QgsScreenHelper()

QgsScreenHelper::QgsScreenHelper ( QWidget *  parent)

Constructor for QgsScreenHelper for the specified parent widget.

Definition at line 25 of file qgsscreenhelper.cpp.

Member Function Documentation

◆ availableGeometry()

QRect QgsScreenHelper::availableGeometry ( ) const
inline

Returns the current screen available geometry in pixels.

The available geometry is the geometry excluding window manager reserved areas such as task bars and system menus.

See also
availableGeometryChanged()

Definition at line 70 of file qgsscreenhelper.h.

◆ availableGeometryChanged

void QgsScreenHelper::availableGeometryChanged ( const QRect &  geometry)
signal

Emitted whenever the available geometry of the screen associated with the widget is changed.

See also
availableGeometry()

◆ eventFilter()

bool QgsScreenHelper::eventFilter ( QObject *  watched,
QEvent *  event 
)
overrideprotected

Definition at line 49 of file qgsscreenhelper.cpp.

◆ screen()

QScreen * QgsScreenHelper::screen ( )

Returns the screen that the parent widget appears on, or nullptr.

Definition at line 32 of file qgsscreenhelper.cpp.

◆ screenDpi()

double QgsScreenHelper::screenDpi ( ) const
inline

Returns the current screen DPI for the screen that the parent widget appears on.

See also
screenDpiChanged()

Definition at line 61 of file qgsscreenhelper.h.

◆ screenDpiChanged

void QgsScreenHelper::screenDpiChanged ( double  dpi)
signal

Emitted whenever the screen dpi associated with the widget is changed.

See also
screenDpi()

◆ windowHandle()

QWindow * QgsScreenHelper::windowHandle ( )

Returns the window handle for the window the parent widget is associated with, or nullptr.

Definition at line 41 of file qgsscreenhelper.cpp.


The documentation for this class was generated from the following files: