Changeset 26636 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 18, 2010 7:20:55 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/QIWithRetranslateUI.h
r26502 r26636 7 7 8 8 /* 9 * Copyright (C) 2008 Sun Microsystems, Inc.9 * Copyright (C) 2008-2010 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 #define __QIWithRetranslateUI_h 26 26 27 /* Qtincludes */27 /* Global includes */ 28 28 #include <QObject> 29 29 #include <QEvent> … … 34 34 public: 35 35 36 QIWithRetranslateUI (QWidget *aParent = 0) : Base (aParent) {}36 QIWithRetranslateUI(QWidget *pParent = 0) : Base(pParent) {} 37 37 38 38 protected: 39 39 40 virtual void changeEvent (QEvent *aEvent)40 virtual void changeEvent(QEvent *pEvent) 41 41 { 42 Base::changeEvent ( aEvent);43 switch ( aEvent->type())42 Base::changeEvent (pEvent); 43 switch (pEvent->type()) 44 44 { 45 45 case QEvent::LanguageChange: 46 46 { 47 47 retranslateUi(); 48 aEvent->accept();48 pEvent->accept(); 49 49 break; 50 50 } … … 62 62 public: 63 63 64 QIWithRetranslateUI2 (QWidget *aParent = 0, Qt::WindowFlags aFlags = 0) : Base (aParent, aFlags) {}64 QIWithRetranslateUI2(QWidget *pParent = 0, Qt::WindowFlags fFlags = 0) : Base(pParent, fFlags) {} 65 65 66 66 protected: 67 67 68 virtual void changeEvent (QEvent *aEvent)68 virtual void changeEvent(QEvent *pEvent) 69 69 { 70 Base::changeEvent ( aEvent);71 switch ( aEvent->type())70 Base::changeEvent (pEvent); 71 switch (pEvent->type()) 72 72 { 73 73 case QEvent::LanguageChange: 74 74 { 75 75 retranslateUi(); 76 aEvent->accept();76 pEvent->accept(); 77 77 break; 78 78 } … … 85 85 }; 86 86 87 template <class Base> 88 class QIWithRetranslateUI3: public Base 89 { 90 public: 91 92 QIWithRetranslateUI3(QObject *pParent = 0) : Base(pParent) {} 93 94 protected: 95 96 virtual bool event(QEvent *pEvent) 97 { 98 bool bResult = Base::event(pEvent); 99 switch (pEvent->type()) 100 { 101 case QEvent::LanguageChange: 102 { 103 retranslateUi(); 104 pEvent->accept(); 105 bResult = true; 106 break; 107 } 108 default: 109 break; 110 } 111 return bResult; 112 } 113 114 virtual void retranslateUi() = 0; 115 }; 116 87 117 #endif /* __QIWithRetranslateUI_h */ 88
Note:
See TracChangeset
for help on using the changeset viewer.