15#ifndef QGSSCREENHELPER_H
16#define QGSSCREENHELPER_H
88 bool eventFilter( QObject *watched, QEvent *event )
override;
92 void updateDevicePixelFromScreen();
93 void updateAvailableGeometryFromScreen();
96 QWidget *mWidget =
nullptr;
98 double mScreenDpi = 96.0;
99 QMetaObject::Connection mScreenDpiChangedConnection;
101 QRect mAvailableGeometry;
102 QMetaObject::Connection mAvailableGeometryChangedConnection;
QWindow * windowHandle()
Returns the window handle for the window the parent widget is associated with, or nullptr.
QScreen * screen()
Returns the screen that the parent widget appears on, or nullptr.
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.
bool eventFilter(QObject *watched, QEvent *event) override
QgsScreenHelper(QWidget *parent)
Constructor for QgsScreenHelper for the specified parent widget.
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.