mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Avoid QObject::connect null warning
This commit is contained in:
parent
34c217cd46
commit
a8ecc683b7
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user