Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
test that window handle actually exists (avoid crash in tests)
- Loading branch information
Showing
with
2 additions
and
1 deletion.
-
+2
−1
src/gui/qgsmapcanvas.cpp
|
@@ -173,7 +173,8 @@ QgsMapCanvas::QgsMapCanvas( QWidget *parent ) |
|
|
|
|
|
// keep device pixel ratio up to date on screen or resolution change |
|
|
connect( window()->windowHandle(), &QWindow::screenChanged, this, [ = ]( QScreen * ) {mSettings.setDevicePixelRatio( devicePixelRatio() );} ); |
|
|
connect( window()->windowHandle()->screen(), &QScreen::physicalDotsPerInchChanged, [ = ]( qreal ) {mSettings.setDevicePixelRatio( devicePixelRatio() );} ); |
|
|
if ( window()->windowHandle() ) |
|
|
connect( window()->windowHandle()->screen(), &QScreen::physicalDotsPerInchChanged, [ = ]( qreal ) {mSettings.setDevicePixelRatio( devicePixelRatio() );} ); |
|
|
|
|
|
connect( &mMapUpdateTimer, &QTimer::timeout, this, &QgsMapCanvas::mapUpdateTimeout ); |
|
|
mMapUpdateTimer.setInterval( 250 ); |
|
|