Changeset 43126 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 30, 2012 7:22:02 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWidgetValidator.cpp
r28800 r43126 153 153 foreach (Watched watched, mWatched) 154 154 { 155 if (watched.widget->inherits ("QLineEdit")) 156 { 157 QLineEdit *le = ((QLineEdit *) watched.widget); 155 if (QLineEdit *le = qobject_cast<QLineEdit*>(watched.widget)) 156 { 158 157 Assert (le->validator()); 159 158 if (!le->validator() || !le->isEnabled()) … … 163 162 state = le->validator()->validate (text, pos); 164 163 } 165 else if (watched.widget->inherits ("QComboBox")) 166 { 167 QComboBox *cb = ((QComboBox *) watched.widget); 164 else if (QComboBox *cb = qobject_cast<QComboBox*>(watched.widget)) 165 { 168 166 Assert (cb->validator()); 169 167 if (!cb->validator() || !cb->isEnabled()) … … 299 297 /* Remove '&' symbol from the buddy field name */ 300 298 title = VBoxGlobal:: 301 removeAccelMark (((QLabel *)mLastInvalid.buddy)->text());299 removeAccelMark(qobject_cast<QLabel*>(mLastInvalid.buddy)->text()); 302 300 303 301 /* Remove ':' symbol from the buddy field name */ -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWidgetValidator.h
r28800 r43126 26 26 #include <QValidator> 27 27 #include <QList> 28 #include <QPointer> 28 29 29 30 class QIWidgetValidator : public QObject … … 72 73 { 73 74 Watched() 74 : widget (NULL), buddy (NULL) 75 , state (QValidator::Acceptable) {} 75 : state (QValidator::Acceptable) {} 76 76 77 Q Widget *widget;78 Q Widget *buddy;77 QPointer<QWidget> widget; 78 QPointer<QWidget> buddy; 79 79 QValidator::State state; 80 80 };
Note:
See TracChangeset
for help on using the changeset viewer.