diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-04 16:29:09 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-06 09:06:17 (GMT) |
commit | 633f3f45e5420663cf4ceadea79e62fea44cd2eb (patch) | |
tree | 1b2c0d8b5dc0746a51c2ea4bf542845273cf7006 /src/activeqt | |
parent | 7b5e37cab738804d47b78582aa3d0f3bb6933e70 (diff) | |
download | Qt-633f3f45e5420663cf4ceadea79e62fea44cd2eb.zip Qt-633f3f45e5420663cf4ceadea79e62fea44cd2eb.tar.gz Qt-633f3f45e5420663cf4ceadea79e62fea44cd2eb.tar.bz2 |
Remove the use of deprecated qVariant*
Test directory untouched.
This just apply those regexp:
git grep -O"sed -i 's/qVariantValue</qvariant_cast</'" qVariantValue
git grep -O"sed -i 's/qVariantSetValue(\([^&*\(),]*\), */\\1.setValue(/'" qVariantSetValue
git grep -O"sed -i 's/qVariantSetValue *<\([^>]*\)> *(\([^&*\(),]*\), */\\2.setValue<\\1>(/'" qVariantSetValue
git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert
git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*([^&*\(),]*)\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert
git grep -O"sed -i 's/qVariantFromValue\( *[(<]\)/QVariant::fromValue\\1/'" qVariantFromValue
git checkout src/corelib/kernal/qvariant*
Rev-by: dev mailing list
Diffstat (limited to 'src/activeqt')
-rw-r--r-- | src/activeqt/container/qaxbase.cpp | 12 | ||||
-rw-r--r-- | src/activeqt/control/qaxserverbase.cpp | 8 | ||||
-rw-r--r-- | src/activeqt/shared/qaxtypes.cpp | 28 |
3 files changed, 24 insertions, 24 deletions
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp index 7692749..806e2b1 100644 --- a/src/activeqt/container/qaxbase.cpp +++ b/src/activeqt/container/qaxbase.cpp @@ -3540,7 +3540,7 @@ int QAxBase::internalProperty(QMetaObject::Call call, int index, void **v) proptype = 0; } else if (t == QVariant::UserType) { qvar = QVariant(qRegisterMetaType<void*>(prop.typeName()), (void**)v[0]); -// qVariantSetValue(qvar, *(void**)v[0], prop.typeName()); +// qvar.setValue(*(void**)v[0], prop.typeName()); } else { proptype = d->metaObject()->propertyType(propname); qvar = QVariant(t, v[0]); @@ -3628,9 +3628,9 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v) if (!qvar.isValid()) { if (type == "IDispatch*") - qVariantSetValue(qvar, *(IDispatch**)v[p+1]); + qvar.setValue(*(IDispatch**)v[p+1]); else if (type == "IUnknown*") - qVariantSetValue(qvar, *(IUnknown**)v[p+1]); + qvar.setValue(*(IUnknown**)v[p+1]); else if (type == "QVariant") qvar = *(QVariant*)v[p + 1]; else if (mo->indexOfEnumerator(type) != -1) @@ -4395,15 +4395,15 @@ QVariant QAxBase::asVariant() const QByteArray cn(className()); if (cn == "QAxObject" || cn == "QAxWidget" || cn == "QAxBase") { if (d->dispatch()) - qVariantSetValue(qvar, d->dispatch()); + qvar.setValue(d->dispatch()); else if (d->ptr) - qVariantSetValue(qvar, d->ptr); + qvar.setValue(d->ptr); } else { cn = cn.mid(cn.lastIndexOf(':') + 1); QObject *object = qObject(); if (QMetaType::type(cn)) qvar = QVariant(qRegisterMetaType<QObject*>(cn + '*'), &object); -// qVariantSetValue(qvar, qObject(), cn + '*'); +// qvar.setValue(qObject(), cn + '*'); } return qvar; diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index 4d2d2f9..32e2cf2 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -2047,10 +2047,10 @@ int QAxServerBase::qt_metacall(QMetaObject::Call call, int index, void **argv) if (vt == QVariant::UserType) { if (ptype.endsWith('*')) { variant = QVariant(QMetaType::type(ptype), (void**)argv[p+1]); - // qVariantSetValue(variant, *(void**)(argv[p + 1]), ptype); + // variant.setValue(*(void**)(argv[p + 1]), ptype); } else { variant = QVariant(QMetaType::type(ptype), argv[p+1]); - // qVariantSetValue(variant, argv[p + 1], ptype); + // variant.setValue(argv[p + 1], ptype); } } else { variant = QVariant(vt, argv[p + 1]); @@ -2537,7 +2537,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid, if (!type.isEmpty() && pvarResult) { if (!varp[0].isValid() && type != "QVariant") varp[0] = QVariant(QMetaType::type(type), argv_pointer); -// qVariantSetValue(varp[0], argv_pointer[0], type); +// varp[0].setValue(argv_pointer[0], type); ok = QVariantToVARIANT(varp[0], *pvarResult, type); } } @@ -3312,7 +3312,7 @@ HRESULT WINAPI QAxServerBase::OnAmbientPropertyChange(DISPID dispID) break; { QVariant qvar = VARIANTToQVariant(var, "QFont", QVariant::Font); - QFont qfont = qVariantValue<QFont>(qvar); + QFont qfont = qvariant_cast<QFont>(qvar); qt.widget->setFont(qfont); } break; diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp index 0cfc7eb..7b2e802 100644 --- a/src/activeqt/shared/qaxtypes.cpp +++ b/src/activeqt/shared/qaxtypes.cpp @@ -954,20 +954,20 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint break; case VT_I4: if (type == QVariant::Color || (!type && typeName == "QColor")) - var = qVariantFromValue(OLEColorToQColor(arg.lVal)); + var = QVariant::fromValue(OLEColorToQColor(arg.lVal)); #ifndef QT_NO_CURSOR else if (type == QVariant::Cursor || (!type && (typeName == "QCursor" || typeName == "QCursor*"))) - var = qVariantFromValue(QCursor(static_cast<Qt::CursorShape>(arg.lVal))); + var = QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(arg.lVal))); #endif else var = (int)arg.lVal; break; case VT_I4|VT_BYREF: if (type == QVariant::Color || (!type && typeName == "QColor")) - var = qVariantFromValue(OLEColorToQColor((int)*arg.plVal)); + var = QVariant::fromValue(OLEColorToQColor((int)*arg.plVal)); #ifndef QT_NO_CURSOR else if (type == QVariant::Cursor || (!type && (typeName == "QCursor" || typeName == "QCursor*"))) - var = qVariantFromValue(QCursor(static_cast<Qt::CursorShape>(*arg.plVal))); + var = QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(*arg.plVal))); #endif else var = (int)*arg.plVal; @@ -992,20 +992,20 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint break; case VT_UI4: if (type == QVariant::Color || (!type && typeName == "QColor")) - var = qVariantFromValue(OLEColorToQColor(arg.ulVal)); + var = QVariant::fromValue(OLEColorToQColor(arg.ulVal)); #ifndef QT_NO_CURSOR else if (type == QVariant::Cursor || (!type && (typeName == "QCursor" || typeName == "QCursor*"))) - var = qVariantFromValue(QCursor(static_cast<Qt::CursorShape>(arg.ulVal))); + var = QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(arg.ulVal))); #endif else var = (int)arg.ulVal; break; case VT_UI4|VT_BYREF: if (type == QVariant::Color || (!type && typeName == "QColor")) - var = qVariantFromValue(OLEColorToQColor((uint)*arg.pulVal)); + var = QVariant::fromValue(OLEColorToQColor((uint)*arg.pulVal)); #ifndef QT_NO_CURSOR else if (type == QVariant::Cursor || (!type && (typeName == "QCursor" || typeName == "QCursor*"))) - var = qVariantFromValue(QCursor(static_cast<Qt::CursorShape>(*arg.pulVal))); + var = QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(*arg.pulVal))); #endif else var = (int)*arg.pulVal; @@ -1084,20 +1084,20 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint if (disp) disp->QueryInterface(IID_IFont, (void**)&ifont); if (ifont) { - var = qVariantFromValue(IFontToQFont(ifont)); + var = QVariant::fromValue(IFontToQFont(ifont)); ifont->Release(); } else { - var = qVariantFromValue(QFont()); + var = QVariant::fromValue(QFont()); } } else if (type == QVariant::Pixmap || (!type && (typeName == "QPixmap" || typeName == "QPixmap*"))) { IPicture *ipic = 0; if (disp) disp->QueryInterface(IID_IPicture, (void**)&ipic); if (ipic) { - var = qVariantFromValue(IPictureToQPixmap(ipic)); + var = QVariant::fromValue(IPictureToQPixmap(ipic)); ipic->Release(); } else { - var = qVariantFromValue(QPixmap()); + var = QVariant::fromValue(QPixmap()); } } else { #ifdef QAX_SERVER @@ -1118,7 +1118,7 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint #ifndef QAX_SERVER if (typeName == "QVariant") { QAxObject *object = new QAxObject(disp); - var = qVariantFromValue<QAxObject*>(object); + var = QVariant::fromValue<QAxObject*>(object); } else if (typeName != "IDispatch*" && QMetaType::type(typeName)) { QByteArray typeNameStr = QByteArray(typeName); int pIndex = typeName.lastIndexOf('*'); @@ -1145,7 +1145,7 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint unkn = *arg.ppunkVal; else unkn = arg.punkVal; - qVariantSetValue(var, unkn); + var.setValue(unkn); } break; case VT_ARRAY|VT_VARIANT: |