summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-13 13:10:34 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-13 13:10:34 +0100
commitfc8bd008b15f148171614be2a7730b40ff032316 (patch)
tree2500708c7b0ab47e65aa400dc05a2ae086d73103
parentbbfb9dadbf6cf8a59f1d39e62131c9af653800e9 (diff)
parenta736ef5bab4ed044af3b24edeff0d9178a139148 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
-rw-r--r--dist/changes-5.4.127
-rw-r--r--src/activeqt/shared/qaxtypes.cpp53
2 files changed, 62 insertions, 18 deletions
diff --git a/dist/changes-5.4.1 b/dist/changes-5.4.1
new file mode 100644
index 0000000..4eaf9fb
--- /dev/null
+++ b/dist/changes-5.4.1
@@ -0,0 +1,27 @@
+Qt 5.4.1 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.4.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+ http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.4 series is binary compatible with the 5.3.x series.
+Applications compiled for 5.3 will continue to run with 5.4.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+ActiveQt
+--------
+
+ - [QTBUG-43446] Fixed invocation of methods returning QVariant.
diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp
index 98b3cc8..bbb782c 100644
--- a/src/activeqt/shared/qaxtypes.cpp
+++ b/src/activeqt/shared/qaxtypes.cpp
@@ -50,6 +50,7 @@
#include <qpixmap.h>
#include <qpainter.h>
#include <qobject.h>
+#include <qdebug.h>
#ifdef QAX_SERVER
# include <qaxfactory.h>
# include <private/qsystemlibrary_p.h>
@@ -207,6 +208,12 @@ static DATE QDateTimeToDATE(const QDateTime &dt)
return vtime;
}
+static QByteArray msgOutParameterNotSupported(const QByteArray &type)
+{
+ return QByteArrayLiteral("QVariantToVARIANT: out-parameter not supported for \"")
+ + type + QByteArrayLiteral("\".");
+}
+
/*
Converts \a var to \a arg, and tries to coerce \a arg to \a type.
@@ -667,13 +674,15 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
break;
}
+ if (out) {
+ qWarning().noquote() << msgOutParameterNotSupported("records");
+ arg.vt = VT_EMPTY;
+ arg.byref = Q_NULLPTR;
+ return false;
+ }
arg.vt = VT_RECORD;
arg.pRecInfo = recordInfo,
arg.pvRecord = record;
- if (out) {
- qWarning("QVariantToVARIANT: out-parameter not supported for records");
- return false;
- }
}
break;
#endif // QAX_SERVER
@@ -685,30 +694,40 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
subType.truncate(subType.length() - 1);
#endif
if (!qstrcmp(qvar.typeName(), "IDispatch*")) {
+ if (out) {
+ qWarning().noquote() << msgOutParameterNotSupported(qvar.typeName());
+ arg.vt = VT_EMPTY;
+ arg.byref = Q_NULLPTR;
+ return false;
+ }
arg.vt = VT_DISPATCH;
arg.pdispVal = *(IDispatch**)qvar.data();
if (arg.pdispVal)
arg.pdispVal->AddRef();
- if (out) {
- qWarning("QVariantToVARIANT: out-parameter not supported for IDispatch");
- return false;
- }
} else if (!qstrcmp(qvar.typeName(), "IDispatch**")) {
arg.vt = VT_DISPATCH;
arg.ppdispVal = *(IDispatch***)qvar.data();
if (out)
arg.vt |= VT_BYREF;
} else if (!qstrcmp(qvar.typeName(), "IUnknown*")) {
+ if (out) {
+ qWarning().noquote() << msgOutParameterNotSupported(qvar.typeName());
+ arg.vt = VT_EMPTY;
+ arg.byref = Q_NULLPTR;
+ return false;
+ }
arg.vt = VT_UNKNOWN;
arg.punkVal = *(IUnknown**)qvar.data();
if (arg.punkVal)
arg.punkVal->AddRef();
+#ifdef QAX_SERVER
+ } else if (qAxFactory()->metaObject(QString::fromLatin1(subType.constData()))) {
if (out) {
- qWarning("QVariantToVARIANT: out-parameter not supported for IUnknown");
+ qWarning().noquote() << msgOutParameterNotSupported("subtype");
+ arg.vt = VT_EMPTY;
+ arg.byref = Q_NULLPTR;
return false;
}
-#ifdef QAX_SERVER
- } else if (qAxFactory()->metaObject(QString::fromLatin1(subType.constData()))) {
arg.vt = VT_DISPATCH;
void *user = *(void**)qvar.constData();
// qVariantGet(qvar, user, qvar.typeName());
@@ -717,20 +736,18 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
} else {
qAxFactory()->createObjectWrapper(static_cast<QObject*>(user), &arg.pdispVal);
}
+#else
+ } else if (QMetaType::type(subType)) {
if (out) {
- qWarning("QVariantToVARIANT: out-parameter not supported for subtype");
+ qWarning().noquote() << msgOutParameterNotSupported("subtype");
+ arg.vt = VT_EMPTY;
+ arg.byref = Q_NULLPTR;
return false;
}
-#else
- } else if (QMetaType::type(subType)) {
QAxObject *object = *(QAxObject**)qvar.constData();
// qVariantGet(qvar, object, subType);
arg.vt = VT_DISPATCH;
object->queryInterface(IID_IDispatch, (void**)&arg.pdispVal);
- if (out) {
- qWarning("QVariantToVARIANT: out-parameter not supported for subtype");
- return false;
- }
#endif
} else {
return false;