Skip to content
Permalink
Browse files

Disable in-session change of UI theme for Qt => 5.11

Random crasher associated with UI theme change is an
upstream bug, in the meantime let's make sure people don't
lose data crashing QGIS with an unsaved project.
  • Loading branch information
nirvn committed Dec 20, 2018
1 parent d7aa980 commit e16472ac28ed67dc20c008c0571b0f680956264c
Showing with 8 additions and 3 deletions.
  1. +6 −2 src/app/qgsoptions.cpp
  2. +1 −0 src/core/qgsapplication.cpp
  3. +1 −1 src/ui/qgsoptionsbase.ui
@@ -144,7 +144,11 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
QStringList themes = QgsApplication::uiThemes().keys();
cmbUITheme->addItems( themes );

#if QT_VERSION < QT_VERSION_CHECK( 5, 12, 0 )
lblUITheme->setText( QStringLiteral( "%1 <i>(%2)</i>" ).arg( lblUITheme->text(), tr( "QGIS restart required" ) ) );
#else
connect( cmbUITheme, static_cast<void ( QComboBox::* )( const QString & )>( &QComboBox::currentIndexChanged ), this, &QgsOptions::uiThemeChanged );
#endif

mIdentifyHighlightColorButton->setColorDialogTitle( tr( "Identify Highlight Color" ) );
mIdentifyHighlightColorButton->setAllowOpacity( true );
@@ -560,10 +564,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mMessageTimeoutSpnBx->setValue( mSettings->value( QStringLiteral( "/qgis/messageTimeout" ), 5 ).toInt() );

QString name = mSettings->value( QStringLiteral( "/qgis/style" ) ).toString();
cmbStyle->setCurrentIndex( cmbStyle->findText( name, Qt::MatchFixedString ) );
whileBlocking( cmbStyle )->setCurrentIndex( cmbStyle->findText( name, Qt::MatchFixedString ) );

QString theme = mSettings->value( QStringLiteral( "UI/UITheme" ), QStringLiteral( "auto" ) ).toString();
cmbUITheme->setCurrentIndex( cmbUITheme->findText( theme, Qt::MatchFixedString ) );
whileBlocking( cmbUITheme )->setCurrentIndex( cmbUITheme->findText( theme, Qt::MatchFixedString ) );

mNativeColorDialogsChkBx->setChecked( mSettings->value( QStringLiteral( "/qgis/native_color_dialogs" ), false ).toBool() );

@@ -65,6 +65,7 @@
#include <QPixmap>
#include <QThreadPool>
#include <QLocale>
#include <QStyle>

#ifndef Q_OS_WIN
#include <netinet/in.h>
@@ -484,7 +484,7 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_42">
<widget class="QLabel" name="lblUITheme">
<property name="text">
<string>UI Theme</string>
</property>

0 comments on commit e16472a

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