Skip to content

Commit

Permalink
qgs3dmapscene: Show an error message if export operation failed
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitjano committed Dec 16, 2024
1 parent 3b158e9 commit 09eb07a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/3d/qgs3dmapscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,12 @@ void Qgs3DMapScene::exportScene( const Qgs3DMapExportSettings &exportSettings )
if ( mTerrain )
exporter.parseTerrain( mTerrain, "Terrain" );

exporter.save( exportSettings.sceneName(), exportSettings.sceneFolderPath() );
const bool sceneSaved = exporter.save( exportSettings.sceneName(), exportSettings.sceneFolderPath() );
if ( !sceneSaved )
{
QgsMessageOutput::showMessage( tr( "3D exporter warning" ), tr( "The scene can not be exported." ), QgsMessageOutput::MessageText );
return;
}

if ( !notParsedLayers.empty() )
{
Expand Down
3 changes: 2 additions & 1 deletion tests/src/3d/testqgs3drendering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,8 @@ void TestQgs3DRendering::do3DSceneExport( const QString &testName, int zoomLevel
exporter.parseTerrain( terrainEntity, "DEM_Tile" );

QString objFileName = QString( "%1-%2" ).arg( testName ).arg( zoomLevelsCount );
exporter.save( objFileName, QDir::tempPath(), 3 );
const bool saved = exporter.save( objFileName, QDir::tempPath(), 3 );
QVERIFY( saved );

int sum = 0;
for ( auto o : qAsConst( exporter.mObjects ) )
Expand Down

0 comments on commit 09eb07a

Please sign in to comment.