15#ifndef QGSSCREENHELPER_H
16#define QGSSCREENHELPER_H
89 bool eventFilter( QObject *watched, QEvent *event )
override;
93 void updateDevicePixelFromScreen();
94 void updateAvailableGeometryFromScreen();
97 QWidget *mWidget =
nullptr;
99 double mScreenDpi = 96.0;
100 QMetaObject::Connection mScreenDpiChangedConnection;
102 QRect mAvailableGeometry;
103 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.