Changeset 106244 in vbox
- Timestamp:
- Oct 8, 2024 5:08:51 PM (7 weeks ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.cpp
r106242 r106244 790 790 , m_fValid(true) 791 791 , m_fSilent(true) 792 , m_pTimerDisabledLookAndFeel(0) 792 793 , m_pLayoutMain(0) 793 794 , m_pCheckBoxMode(0) … … 984 985 } 985 986 986 /* Handle enabled-change events: */ 987 if (pEvent->type() == QEvent::EnabledChange) 988 { 989 /* Check if watched object is of widget type: */ 990 QWidget *pWidget = qobject_cast<QWidget*>(pObject); 991 if (pWidget) 992 adjustLookAndFeelForDisabledWidget(pWidget); 987 /* We'd like to accumulate multiple events of the same type to 988 * process them the bundled way, once after the last one arrived. */ 989 switch (pEvent->type()) 990 { 991 /* Only enabled-change events useful for us: */ 992 case QEvent::EnabledChange: 993 { 994 /* Start (or restart) corresponding timer: */ 995 m_pTimerDisabledLookAndFeel->start(); 996 break; 997 } 998 default: 999 break; 993 1000 } 994 1001 … … 1051 1058 gpDesktop->centerWidget(this, parentWidget(), false); 1052 1059 1053 /* Make sure widgets disabled initially have font updated: */ 1054 foreach (QWidget *pChild, findChildren<QWidget*>()) 1055 if (!pChild->isEnabledTo(0)) 1056 adjustLookAndFeelForDisabledWidget(pChild); 1060 /* Make sure widgets disabled initially have look&feel updated: */ 1061 sltUpdateDisabledWidgetsLookAndFeel(); 1057 1062 } 1058 1063 … … 1443 1448 } 1444 1449 1450 void UIAdvancedSettingsDialog::sltUpdateDisabledWidgetsLookAndFeel() 1451 { 1452 /* Make sure all child widgets have look&feel updated: */ 1453 foreach (QWidget *pChild, findChildren<QWidget*>()) 1454 adjustLookAndFeelForDisabledWidget(pChild); 1455 } 1456 1445 1457 void UIAdvancedSettingsDialog::prepare() 1446 1458 { 1459 /* Create timer to update disabled widgets look&feel: */ 1460 m_pTimerDisabledLookAndFeel = new QTimer(this); 1461 if (m_pTimerDisabledLookAndFeel) 1462 { 1463 m_pTimerDisabledLookAndFeel->setSingleShot(true); 1464 m_pTimerDisabledLookAndFeel->setInterval(50); 1465 connect(m_pTimerDisabledLookAndFeel, &QTimer::timeout, 1466 this, &UIAdvancedSettingsDialog::sltUpdateDisabledWidgetsLookAndFeel); 1467 } 1468 1447 1469 /* Prepare central-widget: */ 1448 1470 setCentralWidget(new QWidget); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.h
r106242 r106244 44 44 class QShowEvent; 45 45 class QStackedWidget; 46 class QTimer; 46 47 class QIDialogButtonBox; 47 48 class UIFilterEditor; … … 213 214 void sltHandleVerticalScrollAreaWheelEvent(); 214 215 216 /** Handles request to update disabled widgets look&feel: */ 217 void sltUpdateDisabledWidgetsLookAndFeel(); 218 215 219 private: 216 220 … … 278 282 QMap<int, QString> m_pageHelpKeywords; 279 283 284 /** Holds the timer to update disabled widgets look&feel. */ 285 QTimer *m_pTimerDisabledLookAndFeel; 286 280 287 /** @name Widgets 281 288 * @{ */
Note:
See TracChangeset
for help on using the changeset viewer.