Skip to content
Permalink
Browse files

Avoid QObject::connect null warning

  • Loading branch information
nyalldawson committed Nov 19, 2018
1 parent 34c217c commit a8ecc683b72a3842a480e3e562456cbec8bad667
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/gui/qgsmapcanvas.cpp
@@ -172,9 +172,11 @@ QgsMapCanvas::QgsMapCanvas( QWidget *parent )
moveCanvasContents( true );

// keep device pixel ratio up to date on screen or resolution change
connect( window()->windowHandle(), &QWindow::screenChanged, this, [ = ]( QScreen * ) {mSettings.setDevicePixelRatio( devicePixelRatio() );} );
if ( window()->windowHandle() )
{
connect( window()->windowHandle(), &QWindow::screenChanged, this, [ = ]( QScreen * ) {mSettings.setDevicePixelRatio( devicePixelRatio() );} );
connect( window()->windowHandle()->screen(), &QScreen::physicalDotsPerInchChanged, this, [ = ]( qreal ) {mSettings.setDevicePixelRatio( devicePixelRatio() );} );
}

connect( &mMapUpdateTimer, &QTimer::timeout, this, &QgsMapCanvas::mapUpdateTimeout );
mMapUpdateTimer.setInterval( 250 );

0 comments on commit a8ecc68

Please sign in to comment.
You can’t perform that action at this time.