Skip to content

Commit

Permalink
Move info bar creation before welcome page (fixes crash on start)
Browse files Browse the repository at this point in the history
Welcome page creates QgsTemplateProjectsModel which adds a file watcher
which triggers a Qt warning which tried to use null info bar.
  • Loading branch information
wonder-sk committed Sep 10, 2019
1 parent c02686d commit 6747e76
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/qgisapp.cpp
Expand Up @@ -825,6 +825,13 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
// what type of project to auto-open
mProjOpen = settings.value( QStringLiteral( "qgis/projOpenAtLaunch" ), 0 ).toInt();

// a bar to warn the user with non-blocking messages
startProfile( QStringLiteral( "Message bar" ) );
mInfoBar = new QgsMessageBar( centralWidget );
mInfoBar->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed );
centralLayout->addWidget( mInfoBar, 0, 0, 1, 1 );
endProfile();

startProfile( QStringLiteral( "Welcome page" ) );
mWelcomePage = new QgsWelcomePage( skipVersionCheck );
connect( mWelcomePage, &QgsWelcomePage::projectRemoved, this, [ this ]( int row )
Expand Down Expand Up @@ -857,13 +864,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh

mCentralContainer->setCurrentIndex( mProjOpen ? 0 : 1 );

// a bar to warn the user with non-blocking messages
startProfile( QStringLiteral( "Message bar" ) );
mInfoBar = new QgsMessageBar( centralWidget );
mInfoBar->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed );
centralLayout->addWidget( mInfoBar, 0, 0, 1, 1 );
endProfile();

startProfile( QStringLiteral( "User input dock" ) );
// User Input Dock Widget
mUserInputDockWidget = new QgsUserInputWidget( mMapCanvas );
Expand Down

2 comments on commit 6747e76

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 6747e76 Sep 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wonder-sk , @m-kuhn , @nyalldawson , I think we need to revert this, the message bar is gone missing (seemingly rendered below the main map canvas widget).

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nirvn +1 to revert. Seems the underlying issue is fixed now anyway.

Please sign in to comment.