Skip to content
Permalink
Browse files

Avoid crash when setting application font/font size in options dialog

https://bugreports.qt.io/browse/QTBUG-69204 causes a segfault
in Qt >= 5.11 if we change the stylesheet on the fly.

Workaround this by only setting the stylesheet once at startup,
and require a restart if settings change which modify the
stylesheet.

Just a workaround -- the upstream bug is being looked at,
but better to require a restart than crash.
  • Loading branch information
nyalldawson committed Oct 23, 2018
1 parent 4f43282 commit ac44bf2514b12b8689777673793977ee3b5a8fd3
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/app/qgisapp.cpp
@@ -2403,6 +2403,14 @@ void QgisApp::createActionGroups()

void QgisApp::setAppStyleSheet( const QString &stylesheet )
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
// avoid crash on stylesheet change -- see https://bugreports.qt.io/browse/QTBUG-69204
static bool sOnce = false;
if ( sOnce )
return;
sOnce = true;
#endif

setStyleSheet( stylesheet );

// cascade styles to any current layout designers

0 comments on commit ac44bf2

Please sign in to comment.
You can’t perform that action at this time.