- Timestamp:
- Apr 3, 2008 12:49:30 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/QIWidgetValidator.h
r7220 r7721 22 22 #include <limits.h> 23 23 24 #include <qobject.h> 25 #include <qvalidator.h> 26 #include <q3valuelist.h> 24 /* Qt includes */ 25 #include <QObject> 26 #include <QValidator> 27 #include <QList> 27 28 28 29 class QIWidgetValidator : public QObject … … 32 33 public: 33 34 34 QIWidgetValidator (QWidget *aWidget, QObject *aParent = 0, 35 const char *aName = 0); 35 QIWidgetValidator (QWidget *aWidget, QObject *aParent = 0); 36 36 QIWidgetValidator (const QString &aCaption, 37 QWidget *aWidget, QObject *aParent = 0, 38 const char *aName = 0); 37 QWidget *aWidget, QObject *aParent = 0); 39 38 ~QIWidgetValidator(); 40 39 … … 74 73 }; 75 74 76 Q 3ValueList <Watched> mWatched;75 QList <Watched> mWatched; 77 76 Watched mLastInvalid; 78 77 … … 86 85 public: 87 86 88 QIULongValidator (QObject *aParent , const char *aName = 0)87 QIULongValidator (QObject *aParent) 89 88 : QValidator (aParent) 90 89 , mBottom (0), mTop (ULONG_MAX) {} 91 90 92 91 QIULongValidator (ulong aMinimum, ulong aMaximum, 93 QObject *aParent , const char *aName = 0)92 QObject *aParent) 94 93 : QValidator (aParent) 95 94 , mBottom (aMinimum), mTop (aMaximum) {} -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobalSettings.h
r5999 r7721 22 22 #include "CIShared.h" 23 23 24 #include <qobject.h> 24 /* Qt includes */ 25 #include <QObject> 25 26 26 27 class CVirtualBox; -
trunk/src/VBox/Frontends/VirtualBox4/src/QIWidgetValidator.cpp
r7220 r7721 19 19 #include "QIWidgetValidator.h" 20 20 21 #include <qobject.h> 22 #include <qlineedit.h> 23 #include <qcombobox.h> 24 #include <qlabel.h> 25 //Added by qt3to4: 26 #include <Q3ValueList> 21 /* Qt includes */ 22 #include <QLineEdit> 23 #include <QComboBox> 24 #include <QLabel> 27 25 28 26 #include <iprt/assert.h> … … 79 77 * @param aWidget Widget whose children should be checked. 80 78 */ 81 QIWidgetValidator::QIWidgetValidator (QWidget *aWidget, QObject *aParent, 82 const char *aName) 83 : QObject (aParent, aName) 79 QIWidgetValidator::QIWidgetValidator (QWidget *aWidget, QObject *aParent) 80 : QObject (aParent) 84 81 , mWidget (aWidget) 85 82 , mOtherValid (true) … … 96 93 */ 97 94 QIWidgetValidator::QIWidgetValidator (const QString &aCaption, 98 QWidget *aWidget, QObject *aParent, 99 const char *aName) 100 : QObject (aParent, aName) 95 QWidget *aWidget, QObject *aParent) 96 : QObject (aParent) 101 97 , mCaption (aCaption) 102 98 , mWidget (aWidget) … … 154 150 QValidator::State state = QValidator::Acceptable; 155 151 156 for (Q3ValueList <Watched>::ConstIterator it = mWatched.begin(); 157 it != mWatched.end(); ++ it) 152 foreach (Watched watched, mWatched) 158 153 { 159 Watched watched = *it;160 161 154 if (watched.widget->inherits ("QLineEdit")) 162 155 { … … 214 207 Watched watched; 215 208 216 Q ObjectList list = mWidget->queryList();217 Q Object *obj;209 QList<QWidget *> list = mWidget->findChildren<QWidget *>(); 210 QWidget *wgt; 218 211 219 212 /* detect all widgets that support validation */ 220 QListIterator<Q Object*> it (list);213 QListIterator<QWidget *> it (list); 221 214 while (it.hasNext()) 222 215 { 223 obj= it.next();224 if (obj->inherits ("QLineEdit")) 225 {226 QLineEdit *le = ((QLineEdit *) obj);216 wgt = it.next(); 217 218 if (QLineEdit *le = qobject_cast<QLineEdit *> (wgt)) 219 { 227 220 if (!le->validator()) 228 221 continue; … … 233 226 this, SLOT (doRevalidate())); 234 227 } 235 else if ( obj->inherits ("QComboBox"))236 { 237 QComboBox *cb = ((QComboBox *) obj);228 else if (QComboBox *cb = qobject_cast<QComboBox *> (wgt)) 229 { 230 238 231 if (!cb->validator() || !cb->lineEdit()) 239 232 continue; … … 245 238 } 246 239 247 watched.widget = (QWidget *) obj;240 watched.widget = wgt; 248 241 249 242 /* try to find a buddy widget in order to determine the title for 250 243 * the watched widget which is used in the warning text */ 251 QListIterator<Q Object*> it2 (list);244 QListIterator<QWidget *> it2 (list); 252 245 while (it2.hasNext()) 253 246 { 254 obj = it2.next(); 255 if (obj->inherits ("QLabel")) 256 { 257 QLabel *label = (QLabel *) obj; 247 wgt = it2.next(); 248 if (QLabel *label = qobject_cast<QLabel *> (wgt)) 258 249 if (label->buddy() == watched.widget) 259 250 { … … 261 252 break; 262 253 } 263 }264 254 } 265 255 … … 363 353 Q_UNUSED (aPos); 364 354 365 QString stripped = aInput. stripWhiteSpace();355 QString stripped = aInput.trimmed(); 366 356 367 357 if (stripped.isEmpty() || 368 stripped. upper() == QString ("0x").upper())358 stripped.toUpper() == QString ("0x").toUpper()) 369 359 return Intermediate; 370 360 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp
r7678 r7721 144 144 145 145 /* ensure status bar is created */ 146 new QIStatusBar (this);146 setStatusBar (new QIStatusBar (this)); 147 147 148 148 ///// Actions /////////////////////////////////////////////////////////// … … 3295 3295 { 3296 3296 #warning "port me" 3297 /* @todo: I'm not sure if it is the right way to force an shutdown if modal 3298 * child widgets are open. Anyway, currently I didn't know how to achieve 3299 * this. So for now we simply call close. */ 3297 /* It seems that Qt4 closes all child widgets if the parent widget get 3298 * closed. So nothing to do here than to call close. */ 3300 3299 3301 3300 close(); 3302 3301 3302 /* We have this to test on Windows and Mac or maybe I forgot something, so 3303 * we keep this as a reference: */ 3303 3304 // LogFlowFunc (("eventLoopLevel=%d\n", qApp->eventLoop()->loopLevel())); 3304 3305 // -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobalSettings.cpp
r5999 r7721 17 17 */ 18 18 19 #include <qglobal.h> 20 #include <qstring.h> 21 #include <qregexp.h> 19 /* Qt includes */ 20 #include <QString> 21 #include <QRegExp> 22 #include <QVariant> 22 23 23 24 #include "VBoxGlobalSettings.h" 24 25 #include "QIHotKeyEdit.h" 25 26 #include "COMDefs.h" 26 27 #include <qvariant.h>28 27 29 28 /** @class VBoxGlobalSettingsData … … 118 117 bool VBoxGlobalSettings::isFeatureActive (const char *aFeature) const 119 118 { 120 QStringList featureList = QStringList::split (',', data()->guiFeatures);119 QStringList featureList = data()->guiFeatures.split (','); 121 120 return featureList.contains (aFeature); 122 121 } … … 164 163 { 165 164 QVariant value = property (gPropertyMap [i].name); 166 Assert (value.isValid() && value.canC ast (QVariant::String));165 Assert (value.isValid() && value.canConvert (QVariant::String)); 167 166 168 167 vbox.SetExtraData (gPropertyMap [i].publicName, value.toString()); … … 183 182 { 184 183 QVariant value = property (gPropertyMap [i].name); 185 Assert (value.isValid() && value.canC ast (QVariant::String));186 187 if (value.isValid() && value.canC ast (QVariant::String))184 Assert (value.isValid() && value.canConvert (QVariant::String)); 185 186 if (value.isValid() && value.canConvert (QVariant::String)) 188 187 return value.toString(); 189 188 else … … 246 245 247 246 QVariant oldVal = property (gPropertyMap [index].name); 248 Assert (oldVal.isValid() && oldVal.canC ast (QVariant::String));249 250 if (oldVal.isValid() && oldVal.canC ast (QVariant::String) &&247 Assert (oldVal.isValid() && oldVal.canConvert (QVariant::String)); 248 249 if (oldVal.isValid() && oldVal.canConvert (QVariant::String) && 251 250 oldVal.toString() != value) 252 251 { -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxSnapshotsWgt.ui.h
r7669 r7721 303 303 toolBar->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed); 304 304 #warning port me 305 vboxLayout->insertWidget (0, toolBar); 305 306 // VBoxSnapshotsWgtLayout->insertWidget (0, toolBar); 306 307 #ifdef Q_WS_MAC
Note:
See TracChangeset
for help on using the changeset viewer.