Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.4, 5.13.0
-
Windows 10, Mint Linux 19
-
-
9b6179cf957c32e0c02547d510dfee2088f02340 (qt/qtbase/5.13) 4a9292f16915345b5a02a43eaa244d865d9ea49c (qt/qtbase/5.12)
Description
When changing the StyleSheet during runtime, the MainWindow does not apply the new stylesheet to its children. This was working since Qt 4.8.1 until Qt 5.12.3.
I have two stylesheets (attached). When loading one of the stylesheet at startup, the appearance is ok, but changing the stylesheet does not work (see screenshots).
I made it work again with a workaroun, but this is very slow:
void MainWindow::changeStyleSheet( const QByteArray& styleSheet )
{ setStyleSheet( myStyleSheet ); updateStyleSheet( this ); }void MainWindow::updateStyleSheet( QWidget* widget )
{
if( widget )
{
widget->style()->unpolish( widget );
widget->style()->polish( widget );
widget->update();
foreach( QObject* o, widget->children() )
{ updateStyleSheet( qobject_cast< QWidget* >( o ) ); } }
}
}
Attachments
Issue Links
- is duplicated by
-
QTBUG-79073 Cascading Stylesheet not updated (Regression from Qt 5.11)
- Closed
-
QTBUG-75361 Widget Styles Missing
- Closed
-
QTBUG-79545 StyleSheets are not set correctly
- Closed
-
QTBUG-75810 Stylesheet does not propagate properly in some cases
- Closed
- resulted from
-
QTBUG-69204 QStyleSheetStyle updateObjects() can cause segmentation faults
- Closed