QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
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. More...
 
void screenDpiChanged (double dpi)
 Emitted whenever the screen dpi associated with the widget is changed. More...
 

Public Member Functions

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

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 24 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 48 of file qgsscreenhelper.cpp.

◆ screen()

QScreen * QgsScreenHelper::screen ( )

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

Definition at line 31 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 40 of file qgsscreenhelper.cpp.


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