[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: prevent unnecessarily updating widgets in `SPrefsPanel::changeStyle()`
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Sat Aug 31 15:35:09 UTC 2024
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
07cf48ba by Fatih Uzunoglu at 2024-08-31T15:14:22+00:00
qt: prevent unnecessarily updating widgets in `SPrefsPanel::changeStyle()`
`QApplication::setStyle()` does update the widgets itself, it should not
be necessary to do this additionally.
- - - - -
79ae6033 by Fatih Uzunoglu at 2024-08-31T15:14:22+00:00
qt: queue style change in `SPrefsPanel::changeStyle()`
It is not a good idea to update the style of `SPrefsPanel`
when it is rejected and being destroyed.
- - - - -
1 changed file:
- modules/gui/qt/dialogs/preferences/simple_preferences.cpp
Changes:
=====================================
modules/gui/qt/dialogs/preferences/simple_preferences.cpp
=====================================
@@ -1350,16 +1350,15 @@ void SPrefsPanel::lastfm_Changed( int i_state )
void SPrefsPanel::changeStyle()
{
- QApplication::setStyle( getQStyleKey( m_interfaceUI.stylesCombo
- , qApp->property("initialStyle").toString() ) );
-
- /* force refresh on all widgets */
- QWidgetList widgets = QApplication::allWidgets();
- QWidgetList::iterator it = widgets.begin();
- while( it != widgets.end() ) {
- (*it)->update();
- ++it;
- };
+ const QString key = getQStyleKey( m_interfaceUI.stylesCombo,
+ qApp->property("initialStyle").toString() );
+
+ QMetaObject::invokeMethod( qApp, [key]() {
+ // Queue this call in order to prevent
+ // updating the preferences dialog when
+ // it is rejected:
+ QApplication::setStyle( key );
+ }, Qt::QueuedConnection );
}
void SPrefsPanel::langChanged( int i )
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/184ce07cea64c09ab9a216002ba66ae919b5bc7e...79ae60335e4ee03cd972e1c76e66bf49622048ce
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/184ce07cea64c09ab9a216002ba66ae919b5bc7e...79ae60335e4ee03cd972e1c76e66bf49622048ce
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list