mirror of
https://github.com/thp/pyotherside.git
synced 2025-01-28 23:52:55 +08:00
Fix build error with Qt >= 6.5 (fixes #128)
This commit is contained in:
parent
63eb5290d5
commit
45044252aa
@ -1196,9 +1196,14 @@ flags for compiling and linking against Python on your system.
|
|||||||
ChangeLog
|
ChangeLog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
Version 1.6.0 (2022-08-05)
|
Version UNRELEASED (YYYY-MM-DD)
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
|
* Support for Qt 6.5 and newer (backwards-incompatible ``Q_RETURN_ARG()`` change) (fixes #128)
|
||||||
|
|
||||||
|
Version 1.6.0 (2022-08-05)
|
||||||
|
--------------------------
|
||||||
|
|
||||||
* Support for **Qt 6** (Qt 5 is still supported for now)
|
* Support for **Qt 6** (Qt 5 is still supported for now)
|
||||||
* Use ``PyUnicode_AsUTF8`` from Python 3.3 when converting strings; strings returned
|
* Use ``PyUnicode_AsUTF8`` from Python 3.3 when converting strings; strings returned
|
||||||
from the converter are now valid as long as the ``PyObject`` is alive (previously
|
from the converter are now valid as long as the ``PyObject`` is alive (previously
|
||||||
|
@ -405,8 +405,25 @@ pyotherside_QObjectMethod_call(PyObject *callable_object, PyObject *args, PyObje
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVariant result;
|
QVariant result;
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||||
|
QGenericReturnArgument returnArg = Q_RETURN_ARG(QVariant, result);
|
||||||
|
#else
|
||||||
|
/**
|
||||||
|
* Starting with Qt 6.5, Q_RETURN_ARG() expands to a QMetaMethodReturnArgument,
|
||||||
|
* whereas previously it returned a QGenericReturnArgument. Since we are using
|
||||||
|
* the old, deprecated QMetaMethod::invoke() functions, and those take a
|
||||||
|
* QGenericReturnArgument and not a QMetaMethodReturnArgument, we need to
|
||||||
|
* create the QGenericReturnArgument ourselves by emulating what Q_RETURN_ARG()
|
||||||
|
* does in old Qt versions before 6.5.
|
||||||
|
*
|
||||||
|
* See also:
|
||||||
|
* https://bugreports.qt.io/browse/QTBUG-113147
|
||||||
|
* https://github.com/thp/pyotherside/issues/128
|
||||||
|
**/
|
||||||
|
QGenericReturnArgument returnArg {QT_STRINGIFY(QVariant), &result};
|
||||||
|
#endif
|
||||||
if (method.invoke(o, Qt::DirectConnection,
|
if (method.invoke(o, Qt::DirectConnection,
|
||||||
Q_RETURN_ARG(QVariant, result), genericArguments.value(0),
|
returnArg, genericArguments.value(0),
|
||||||
genericArguments.value(1), genericArguments.value(2),
|
genericArguments.value(1), genericArguments.value(2),
|
||||||
genericArguments.value(3), genericArguments.value(4),
|
genericArguments.value(3), genericArguments.value(4),
|
||||||
genericArguments.value(5), genericArguments.value(6),
|
genericArguments.value(5), genericArguments.value(6),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user