Navigation Menu

Skip to content

Commit

Permalink
Fix crash due to style cache issue in QT<5.12.4. Fixes #39693 #39725
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir authored and nirvn committed Nov 12, 2020
1 parent af9da65 commit c4306e1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/gui/auto_generated/qgscollapsiblegroupbox.sip.in
Expand Up @@ -97,6 +97,13 @@ Signal emitted when groupbox collapsed/expanded state is changed, and when first
void checkClicked( bool ckd );
void toggleCollapsed();

void setStyleSheet( const QString &style );
%Docstring
Overridden to prepare base call and avoid crash due to specific QT versions

.. versionadded:: 3.16
%End

protected:
void init();

Expand Down
9 changes: 9 additions & 0 deletions src/gui/qgscollapsiblegroupbox.cpp
Expand Up @@ -300,6 +300,15 @@ void QgsCollapsibleGroupBoxBasic::toggleCollapsed()
clearModifiers();
}

void QgsCollapsibleGroupBoxBasic::setStyleSheet( const QString &style )
{
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 4)
// Fix crash on old Qt versions, see #39693
QGroupBox::setStyleSheet( QString() );
#endif
QGroupBox::setStyleSheet( style );
}

void QgsCollapsibleGroupBoxBasic::updateStyle()
{
setUpdatesEnabled( false );
Expand Down
7 changes: 7 additions & 0 deletions src/gui/qgscollapsiblegroupbox.h
Expand Up @@ -131,6 +131,13 @@ class GUI_EXPORT QgsCollapsibleGroupBoxBasic : public QGroupBox
void checkClicked( bool ckd );
void toggleCollapsed();

/**
* Overridden to prepare base call and avoid crash due to specific QT versions
*
* \since QGIS 3.16
*/
void setStyleSheet( const QString &style );

protected:
void init();

Expand Down

0 comments on commit c4306e1

Please sign in to comment.