51 if ( watched != mWidget )
54 switch ( event->type() )
58 updateDevicePixelFromScreen();
59 updateAvailableGeometryFromScreen();
64 connect( handle, &QWindow::screenChanged,
this, [ = ]( QScreen * )
66 disconnect( mScreenDpiChangedConnection );
67 disconnect( mAvailableGeometryChangedConnection );
71 mScreenDpiChangedConnection = connect( windowHandleInLambda->screen(), &QScreen::physicalDotsPerInchChanged,
this, &QgsScreenHelper::updateDevicePixelFromScreen );
72 updateDevicePixelFromScreen();
74 mAvailableGeometryChangedConnection = connect( windowHandleInLambda->screen(), &QScreen::availableGeometryChanged,
this, &QgsScreenHelper::updateAvailableGeometryFromScreen );
75 updateAvailableGeometryFromScreen();
79 mScreenDpiChangedConnection = connect( handle->screen(), &QScreen::physicalDotsPerInchChanged,
this, &QgsScreenHelper::updateDevicePixelFromScreen );
80 mAvailableGeometryChangedConnection = connect( handle->screen(), &QScreen::availableGeometryChanged,
this, &QgsScreenHelper::updateAvailableGeometryFromScreen );
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)