From f9c589e4fe8a76d5f54592d9f7b0b0759ffd7ce7 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Wed, 15 Jun 2016 11:26:54 +0200 Subject: [PATCH] [Globe] Delay initial layer update to workaround some mysterious opengl errors --- src/plugins/globe/globe_plugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/globe/globe_plugin.cpp b/src/plugins/globe/globe_plugin.cpp index 3a6194d7070..cc03114fd4d 100644 --- a/src/plugins/globe/globe_plugin.cpp +++ b/src/plugins/globe/globe_plugin.cpp @@ -371,8 +371,6 @@ void GlobePlugin::run() mQgisMapLayer = new osgEarth::ImageLayer( options, mTileSource ); map->addImageLayer( mQgisMapLayer ); - // Add layers to the map - updateLayers(); // Create the frustum highlight callback mFrustumHighlightCallback = new QgsGlobeFrustumHighlightCallback( @@ -417,9 +415,13 @@ void GlobePlugin::run() // which appear when launching the globe a second time: // Delay applySettings one event loop iteration, i.e. one update call of the GL canvas QTimer* timer = new QTimer(); + QTimer* timer2 = new QTimer(); connect( timer, SIGNAL( timeout() ), timer, SLOT( deleteLater() ) ); + connect( timer2, SIGNAL( timeout() ), timer2, SLOT( deleteLater() ) ); connect( timer, SIGNAL( timeout() ), this, SLOT( applySettings() ) ); + connect( timer2, SIGNAL( timeout() ), this, SLOT( updateLayers() ) ); timer->start( 0 ); + timer2->start( 100 ); } void GlobePlugin::showSettings()