mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
update DPR on screen or resolution change
This commit is contained in:
parent
b4e87d873e
commit
35ec465847
@ -31,9 +31,11 @@ email : sherman at mrcc.com
|
||||
#include <QRect>
|
||||
#include <QTextStream>
|
||||
#include <QResizeEvent>
|
||||
#include <QScreen>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QWheelEvent>
|
||||
#include <QWindow>
|
||||
|
||||
#include "qgis.h"
|
||||
#include "qgssettings.h"
|
||||
@ -169,6 +171,10 @@ 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() );} );
|
||||
connect( window()->windowHandle()->screen(), &QScreen::physicalDotsPerInchChanged, [ = ]( qreal ) {mSettings.setDevicePixelRatio( devicePixelRatio() );} );
|
||||
|
||||
connect( &mMapUpdateTimer, &QTimer::timeout, this, &QgsMapCanvas::mapUpdateTimeout );
|
||||
mMapUpdateTimer.setInterval( 250 );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user