- Timestamp:
- Apr 24, 2007 2:18:21 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r2327 r2328 2817 2817 bool VBoxGlobal::eventFilter (QObject *aObject, QEvent *aEvent) 2818 2818 { 2819 if (aObject == QApplication::desktop() && 2820 aEvent->type() == QEvent::LanguageChange) 2821 languageChange(); 2819 if (aEvent->type() == QEvent::LanguageChange && 2820 aObject->isWidgetType() && 2821 static_cast <QWidget *> (aObject)->isTopLevel()) 2822 { 2823 /* Catch the language change event before any other widget gets it in 2824 * order to invalidate cached string resources (like the details view 2825 * templates) that may be used by other widgets. */ 2826 QWidgetList *list = QApplication::topLevelWidgets(); 2827 if (list->first() == aObject) 2828 { 2829 /* call this only once per every language change (see 2830 * QApplication::installTranslator() for details) */ 2831 languageChange(); 2832 } 2833 delete list; 2834 } 2835 2822 2836 return QObject::eventFilter (aObject, aEvent); 2823 2837 } … … 2938 2952 vm_state_color.insert (CEnums::Discarding, &Qt::green); 2939 2953 2940 QApplication::desktop()->installEventFilter (this);2954 qApp->installEventFilter (this); 2941 2955 2942 2956 // create default non-null global settings
Note:
See TracChangeset
for help on using the changeset viewer.