Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash due to style cache issue in QT<5.12.4. Fixes #39693 #39725 #39615 #39935

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

luipir
Copy link
Contributor

@luipir luipir commented Nov 10, 2020

Fix crash due to style cache issue in QT<5.12.4. Fixes #39693 #39725 #39615
No tests available :/

workaround to QT bug https://bugreports.qt.io/browse/QTBUG-69204

Partially sponsored by QGIS Spanish User Group qgis.es

@luipir luipir requested a review from nirvn November 10, 2020 11:12
@nirvn
Copy link
Contributor

nirvn commented Nov 10, 2020

@luipir , other than @rouault 's suggestion, fix looks good. Just in time.

I'd reduce the comment to a single line, something like
// Fix crash on old Qt versions, see #39693

@github-actions github-actions bot added this to the 3.18.0 milestone Nov 10, 2020
@luipir luipir force-pushed the crash_qt_setstylesheet_fix39693 branch from c6c66e3 to 6080c15 Compare November 10, 2020 11:59
@DelazJ
Copy link
Contributor

DelazJ commented Nov 10, 2020

Thanks @luipir for all the efforts.

@luipir luipir force-pushed the crash_qt_setstylesheet_fix39693 branch from b84a1ef to 6b816bf Compare November 10, 2020 14:52
@luipir
Copy link
Contributor Author

luipir commented Nov 10, 2020

some squash to clean commits

@luipir
Copy link
Contributor Author

luipir commented Nov 10, 2020

@rouault @DelazJ @nirvn let me know if I can merge or any modification more

@@ -130,6 +130,7 @@ class GUI_EXPORT QgsCollapsibleGroupBoxBasic : public QGroupBox
void checkToggled( bool ckd );
void checkClicked( bool ckd );
void toggleCollapsed();
void setStyleSheet( const QString &style );
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just add docs, don't expand the missing doc list!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I followed the same as the other overloaded slots because the documentation I suppose is based on base class documentation. BTW I'll add doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

@nyalldawson
Copy link
Collaborator

I'm a little confused how this fix works -- QWidget::setStyleSheet isn't virtual, so how does this intercept all attempts to set the group box style?

@luipir
Copy link
Contributor Author

luipir commented Nov 10, 2020

I'm a little confused how this fix works -- QWidget::setStyleSheet isn't virtual, so how does this intercept all attempts to set the group box style?

is it done calling parent setStyleSheet? or do you mean to move the fix to upper levels?

@rouault
Copy link
Contributor

rouault commented Nov 10, 2020

I'm a little confused how this fix works -- QWidget::setStyleSheet isn't virtual, so how does this intercept all attempts to set the group box style?

this won't intercept all attempts, just those done by this class. Perhaps the method should be internalSetStyleSheet() to avoid any confusion ?

@luipir
Copy link
Contributor Author

luipir commented Nov 10, 2020

I'm a little confused how this fix works -- QWidget::setStyleSheet isn't virtual, so how does this intercept all attempts to set the group box style?

this won't intercept all attempts, just those done by this class. Perhaps the method should be internalSetStyleSheet() to avoid any confusion ?

well.. @nyalldawson I'm confused too about why the crash happen always in the same class and does not affect the other call to setStyleSheet (175) all over the qgis code.

@luipir
Copy link
Contributor Author

luipir commented Nov 10, 2020

I'm a little confused how this fix works -- QWidget::setStyleSheet isn't virtual, so how does this intercept all attempts to set the group box style?

this won't intercept all attempts, just those done by this class. Perhaps the method should be internalSetStyleSheet() to avoid any confusion ?

because the crash happen only with this class, I prefered to leave the same method name to avoid to call setStyleSheet falling again in a crash.

@luipir luipir force-pushed the crash_qt_setstylesheet_fix39693 branch from cb892a9 to d406cfa Compare November 10, 2020 20:46
@luipir luipir force-pushed the crash_qt_setstylesheet_fix39693 branch from d406cfa to e360378 Compare November 11, 2020 09:19
@nyalldawson
Copy link
Collaborator

Should we also backport to 3.10 to be extra safe?

@nirvn
Copy link
Contributor

nirvn commented Nov 12, 2020

Sure.

Copy link
Contributor

@nirvn nirvn left a comment

Choose a reason for hiding this comment

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

Let's get this into 3.16 so we can ship a crash free version asap.

Code looks good. The documentation could be improved but we can do that in a follow up PR.

@nirvn nirvn merged commit c4306e1 into qgis:master Nov 12, 2020
@luipir luipir deleted the crash_qt_setstylesheet_fix39693 branch November 12, 2020 09:03
@luipir luipir changed the title Fix crash due to style cache issue in QT<5.12.4. Fixes #39693 #39725 Fix crash due to style cache issue in QT<5.12.4. Fixes #39693 #39725 #39615 Nov 12, 2020
@msevilla00
Copy link

I updated my installation through deb [arch=amd64] https://qgis.org/ubuntugis-nightly-release bionic main and I'm still having this issue :-(

Here it is my configuration:

About QGIS - 64 Bit — About_645

@nirvn
Copy link
Contributor

nirvn commented Nov 12, 2020

@msevilla00 , that build is too old.

@PedroVenancio
Copy link
Contributor

About QGIS - 64 Bit — About_645

@msevilla00 last commit included in your build is from 5 days ago.

@msevilla00
Copy link

Ok, thanks, I did apt update & upgrade and changed... I thought included the latest fix.

I'll try with the other repos.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QGIS crash showing raster symbology in layer properties
7 participants