diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-08-19 13:25:26 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-08-19 14:12:38 +0200 |
commit | 20fc1f447592e6dc6f3abd9cae5c3a55efed4b01 (patch) | |
tree | dc8fd70143b1a3faf78037d6629c985a8fc4f477 | |
parent | 88b4ca5ea5b7a20cb4d44d45eb4cb0b777bb9201 (diff) |
Bump dependency version and fix compile errors
- Adapt to QMetaType/QVariant changes
- Adapt to QIODeviceBase
Change-Id: I7cb6b9b0bbc68954c839c2026e3984fd7f913ef9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | dependencies.yaml | 2 | ||||
-rw-r--r-- | src/activeqt/container/qaxbase.cpp | 10 | ||||
-rw-r--r-- | src/activeqt/container/qaxdump.cpp | 3 | ||||
-rw-r--r-- | src/activeqt/control/qaxserverbase.cpp | 8 | ||||
-rw-r--r-- | src/activeqt/shared/qaxtypes.cpp | 15 | ||||
-rw-r--r-- | tools/dumpcpp/main.cpp | 2 |
6 files changed, 23 insertions, 17 deletions
diff --git a/dependencies.yaml b/dependencies.yaml index 27b9ae8..6dda841 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -1,4 +1,4 @@ dependencies: ../qtbase: - ref: d0689ec867244a25635fb9504f2e6ff6e5c4a77b + ref: 5f729da74a5c12a8d33389dcc874c8277044abe0 required: true diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp index 8be4bdf..fda1f2e 100644 --- a/src/activeqt/container/qaxbase.cpp +++ b/src/activeqt/container/qaxbase.cpp @@ -2995,7 +2995,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co // each enum in form name\0 for (auto it = enum_list.cbegin(), end = enum_list.cend(); it != end; ++it) { QMetaEnumBuilder enumBuilder = builder.addEnumerator(it.key()); - for (auto v : it.value()) + for (const auto &v : it.value()) enumBuilder.addKey(v.first, v.second); } @@ -3332,7 +3332,7 @@ int QAxBase::internalProperty(QMetaObject::Call call, int index, void **v) qvar = *reinterpret_cast<const QVariant *>(v[0]); proptype = nullptr; } else { - qvar = QVariant(typeId, v[0]); + qvar = QVariant(prop.metaType(), v[0]); if (typeId < QMetaType::User) proptype = moExtra.propertyType(propname); } @@ -3416,7 +3416,7 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v) QVariant::Type vt = QVariant::nameToType(type); QVariant qvar; if (vt != QVariant::UserType && vt != int(QMetaType::QVariant)) - qvar = QVariant(vt, v[p + 1]); + qvar = QVariant(QMetaType(int(vt)), v[p + 1]); if (!qvar.isValid()) { if (type == "IDispatch*") { @@ -3431,7 +3431,7 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v) } else if (mo->indexOfEnumerator(type) != -1) { qvar = *reinterpret_cast<const int *>(v[p + 1]); } else { - qvar = QVariant(QMetaType::type(type), v[p + 1]); + qvar = QVariant(QMetaType(QMetaType::type(type)), v[p + 1]); } } @@ -4243,7 +4243,7 @@ QVariant QAxBase::asVariant() const int typeId = QMetaType::type(cn); if (typeId == QMetaType::UnknownType) typeId = qRegisterMetaType<QObject *>(cn); - qvar = QVariant(typeId, &object); + qvar = QVariant(QMetaType(typeId), &object); } return qvar; diff --git a/src/activeqt/container/qaxdump.cpp b/src/activeqt/container/qaxdump.cpp index 98be9b6..e941adb 100644 --- a/src/activeqt/container/qaxdump.cpp +++ b/src/activeqt/container/qaxdump.cpp @@ -56,6 +56,7 @@ #include <quuid.h> #include <qt_windows.h> #include <qtextstream.h> +#include <qiodevicebase.h> #include <ctype.h> @@ -151,7 +152,7 @@ QString qax_generateDocumentation(QAxBase *that) dispatch->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &typeInfo); QString docu; - QTextStream stream(&docu, QIODevice::WriteOnly); + QTextStream stream(&docu, QIODeviceBase::WriteOnly); const QMetaObject *mo = that->axBaseMetaObject(); QString coClass = QLatin1String(mo->classInfo(mo->indexOfClassInfo("CoClass")).value()); diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index a4c10f9..6e825c0 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -2064,14 +2064,14 @@ int QAxServerBase::qt_metacall(QMetaObject::Call call, int index, void **argv) QVariant::Type vt = QVariant::nameToType(ptype); if (vt == QVariant::UserType) { if (ptype.endsWith('*')) { - variant = QVariant(QMetaType::type(ptype), reinterpret_cast<void **>(argv[p+1])); + variant = QVariant(QMetaType(QMetaType::type(ptype)), reinterpret_cast<void **>(argv[p+1])); // variant.setValue(*(void**)(argv[p + 1]), ptype); } else { - variant = QVariant(QMetaType::type(ptype), argv[p+1]); + variant = QVariant(QMetaType(QMetaType::type(ptype)), argv[p+1]); // variant.setValue(argv[p + 1], ptype); } } else { - variant = QVariant(vt, argv[p + 1]); + variant = QVariant(QMetaType(int(vt)), argv[p + 1]); } } @@ -2553,7 +2553,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid, } if (!type.isEmpty() && type != "void" && pvarResult) { if (!varp[0].isValid() && type != "QVariant") - varp[0] = QVariant(QMetaType::type(type), argv_pointer); + varp[0] = QVariant(QMetaType(QMetaType::type(type)), argv_pointer); // varp[0].setValue(argv_pointer[0], type); ok = QVariantToVARIANT(varp[0], *pvarResult, type); } diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp index 40f5e0a..501bf51 100644 --- a/src/activeqt/shared/qaxtypes.cpp +++ b/src/activeqt/shared/qaxtypes.cpp @@ -955,13 +955,14 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint int pointerTypeId = QMetaType::type(pointerType); if (!pointerTypeId) pointerTypeId = qRegisterMetaType<QObject *>(pointerType); - var = QVariant(pointerTypeId, &qObj); + var = QVariant(QMetaType(pointerTypeId), &qObj); } else #endif { if (!typeName.isEmpty()) { if (arg.vt & VT_BYREF) { - var = QVariant(qRegisterMetaType<IDispatch**>("IDispatch**"), &arg.ppdispVal); + static const int dispatchId = qRegisterMetaType<IDispatch**>("IDispatch**"); + var = QVariant(QMetaType(dispatchId), &arg.ppdispVal); } else { #ifndef QAX_SERVER if (typeName == "QVariant") { @@ -975,10 +976,14 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint int metaType = QMetaType::type(typeNameStr); Q_ASSERT(metaType != 0); auto object = static_cast<QAxObject*>(qax_createObjectWrapper(metaType, disp)); - var = QVariant(QMetaType::type(typeName), &object); - } else + var = QVariant(QMetaType(QMetaType::type(typeName)), &object); + } else { +#endif + static const int dispatchId = qRegisterMetaType<IDispatch*>(typeName.constData()); + var = QVariant(QMetaType(dispatchId), &disp); +#ifndef QAX_SERVER + } #endif - var = QVariant(qRegisterMetaType<IDispatch*>(typeName), &disp); } } } diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp index e8c2ffd..086525c 100644 --- a/tools/dumpcpp/main.cpp +++ b/tools/dumpcpp/main.cpp @@ -361,7 +361,7 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, if (propertyType.endsWith('*')) { out << '{' << Qt::endl; out << " int typeId = qRegisterMetaType<" << propertyType << ">(\"" << propertyType << "\", &value);" << Qt::endl; - out << " setProperty(\"" << propertyName << "\", QVariant(typeId, &value));" << Qt::endl; + out << " setProperty(\"" << propertyName << "\", QVariant(QMetaType(typeId), &value));" << Qt::endl; out << '}' << Qt::endl; } else { out << "{ setProperty(\"" << propertyName << "\", QVariant(value)); }" << Qt::endl; |