15#ifndef QGSSCREENHELPER_H
16#define QGSSCREENHELPER_H
54 QWindow *windowHandle();
89 bool eventFilter( QObject *watched, QEvent *event )
override;
93 void updateDevicePixelFromScreen();
94 void updateAvailableGeometryFromScreen();
98 QWidget *mWidget =
nullptr;
100 double mScreenDpi = 96.0;
101 QMetaObject::Connection mScreenDpiChangedConnection;
103 QRect mAvailableGeometry;
104 QMetaObject::Connection mAvailableGeometryChangedConnection;
A utility class for dynamic handling of changes to screen properties.
QRect availableGeometry() const
Returns the current screen available geometry in pixels.
double screenDpi() const
Returns the current screen DPI for the screen that the parent widget appears on.
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.