@@ -787,7 +787,10 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
787
787
functionProfile ( &QgisApp::createToolBars, this , QStringLiteral ( " Toolbars" ) );
788
788
functionProfile ( &QgisApp::createStatusBar, this , QStringLiteral ( " Status bar" ) );
789
789
functionProfile ( &QgisApp::createCanvasTools, this , QStringLiteral ( " Create canvas tools" ) );
790
+
790
791
mMapCanvas ->freeze ();
792
+ applyDefaultSettingsToCanvas ( mMapCanvas );
793
+
791
794
functionProfile ( &QgisApp::initLayerTreeView, this , QStringLiteral ( " Init Layer tree view" ) );
792
795
functionProfile ( &QgisApp::createOverview, this , QStringLiteral ( " Create overview" ) );
793
796
functionProfile ( &QgisApp::createMapTips, this , QStringLiteral ( " Create map tips" ) );
@@ -1631,6 +1634,17 @@ void QgisApp::applyProjectSettingsToCanvas( QgsMapCanvas *canvas )
1631
1634
canvas->setSelectionColor ( myColor );
1632
1635
}
1633
1636
1637
+ void QgisApp::applyDefaultSettingsToCanvas ( QgsMapCanvas *canvas )
1638
+ {
1639
+ QgsSettings settings;
1640
+ canvas->enableAntiAliasing ( settings.value ( QStringLiteral ( " qgis/enable_anti_aliasing" ), true ).toBool () );
1641
+ double zoomFactor = settings.value ( QStringLiteral ( " qgis/zoom_factor" ), 2 ).toDouble ();
1642
+ canvas->setWheelFactor ( zoomFactor );
1643
+ canvas->setCachingEnabled ( settings.value ( QStringLiteral ( " qgis/enable_render_caching" ), true ).toBool () );
1644
+ canvas->setParallelRenderingEnabled ( settings.value ( QStringLiteral ( " qgis/parallel_rendering" ), true ).toBool () );
1645
+ canvas->setMapUpdateInterval ( settings.value ( QStringLiteral ( " qgis/map_update_interval" ), 250 ).toInt () );
1646
+ }
1647
+
1634
1648
void QgisApp::readSettings ()
1635
1649
{
1636
1650
QgsSettings settings;
@@ -3032,20 +3046,6 @@ void QgisApp::createOverview()
3032
3046
mPanelMenu ->addAction ( mOverviewDock ->toggleViewAction () );
3033
3047
3034
3048
mLayerTreeCanvasBridge ->setOvervewCanvas ( mOverviewCanvas );
3035
-
3036
- // moved here to set anti aliasing to both map canvas and overview
3037
- QgsSettings mySettings;
3038
- // Anti Aliasing enabled by default as of QGIS 1.7
3039
- mMapCanvas ->enableAntiAliasing ( mySettings.value ( QStringLiteral ( " qgis/enable_anti_aliasing" ), true ).toBool () );
3040
-
3041
- double zoomFactor = mySettings.value ( QStringLiteral ( " qgis/zoom_factor" ), 2 ).toDouble ();
3042
- mMapCanvas ->setWheelFactor ( zoomFactor );
3043
-
3044
- mMapCanvas ->setCachingEnabled ( mySettings.value ( QStringLiteral ( " qgis/enable_render_caching" ), true ).toBool () );
3045
-
3046
- mMapCanvas ->setParallelRenderingEnabled ( mySettings.value ( QStringLiteral ( " qgis/parallel_rendering" ), true ).toBool () );
3047
-
3048
- mMapCanvas ->setMapUpdateInterval ( mySettings.value ( QStringLiteral ( " qgis/map_update_interval" ), 250 ).toInt () );
3049
3049
}
3050
3050
3051
3051
void QgisApp::addDockWidget ( Qt::DockWidgetArea area, QDockWidget *thepDockWidget )
@@ -3124,17 +3124,23 @@ QgsMapCanvas *QgisApp::createNewMapCanvas( const QString &name )
3124
3124
mapCanvas->freeze ( true );
3125
3125
mapCanvas->setObjectName ( name );
3126
3126
3127
+ applyProjectSettingsToCanvas ( mapCanvas );
3128
+ applyDefaultSettingsToCanvas ( mapCanvas );
3129
+
3130
+ mapCanvas->setLayers ( mMapCanvas ->layers () );
3131
+ mapCanvas->setExtent ( mMapCanvas ->extent () );
3132
+ mapCanvas->setCachingEnabled ( true );
3133
+
3134
+ mapCanvas->setDestinationCrs ( QgsProject::instance ()->crs () );
3135
+
3136
+
3127
3137
// add existing annotations to canvas
3128
3138
Q_FOREACH ( QgsAnnotation *annotation, QgsProject::instance ()->annotationManager ()->annotations () )
3129
3139
{
3130
3140
QgsMapCanvasAnnotationItem *canvasItem = new QgsMapCanvasAnnotationItem ( annotation, mapCanvas );
3131
3141
Q_UNUSED ( canvasItem ); // item is already added automatically to canvas scene
3132
3142
}
3133
3143
3134
- applyProjectSettingsToCanvas ( mapCanvas );
3135
-
3136
- mapCanvas->setDestinationCrs ( QgsProject::instance ()->crs () );
3137
-
3138
3144
addDockWidget ( Qt::RightDockWidgetArea, mapCanvasWidget );
3139
3145
mapCanvas->freeze ( false );
3140
3146
return mapCanvas;
@@ -9177,16 +9183,10 @@ void QgisApp::showOptionsDialog( QWidget *parent, const QString ¤tPage )
9177
9183
9178
9184
setupLayerTreeViewFromSettings ();
9179
9185
9180
- mMapCanvas ->enableAntiAliasing ( mySettings.value ( QStringLiteral ( " qgis/enable_anti_aliasing" ) ).toBool () );
9181
-
9182
- double zoomFactor = mySettings.value ( QStringLiteral ( " qgis/zoom_factor" ), 2 ).toDouble ();
9183
- mMapCanvas ->setWheelFactor ( zoomFactor );
9184
-
9185
- mMapCanvas ->setCachingEnabled ( mySettings.value ( QStringLiteral ( " qgis/enable_render_caching" ), true ).toBool () );
9186
-
9187
- mMapCanvas ->setParallelRenderingEnabled ( mySettings.value ( QStringLiteral ( " qgis/parallel_rendering" ), true ).toBool () );
9188
-
9189
- mMapCanvas ->setMapUpdateInterval ( mySettings.value ( QStringLiteral ( " qgis/map_update_interval" ), 250 ).toInt () );
9186
+ Q_FOREACH ( QgsMapCanvas *canvas, mapCanvases () )
9187
+ {
9188
+ applyDefaultSettingsToCanvas ( canvas );
9189
+ }
9190
9190
9191
9191
if ( oldCapitalize != mySettings.value ( QStringLiteral ( " qgis/capitalizeLayerName" ), QVariant ( false ) ).toBool () )
9192
9192
{
0 commit comments