diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-03 08:34:15 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-03 08:49:05 +0000 |
commit | 9f0a954cf5a661da3ad6dde3b0ab3ecf32119e29 (patch) | |
tree | 5b6734fbfb9ef2d18878ba7bd8f0d22778aea592 /sources/pyside2/libpyside | |
parent | 347a32255a2e8e3c6d73b94b1cfe74fddbe09aad (diff) |
Remove most QT_VERSION checks
As a drive by, adapt to changed values of QMetaObject::Call.
Task-number: PYSIDE-1339
Task-number: PYSIDE-904
Change-Id: Ic55a5da910c9ef022af3dedf749f80153f519ebf
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/libpyside')
-rw-r--r-- | sources/pyside2/libpyside/globalreceiverv2.cpp | 4 | ||||
-rw-r--r-- | sources/pyside2/libpyside/pysideproperty.cpp | 11 | ||||
-rw-r--r-- | sources/pyside2/libpyside/signalmanager.cpp | 30 |
3 files changed, 2 insertions, 43 deletions
diff --git a/sources/pyside2/libpyside/globalreceiverv2.cpp b/sources/pyside2/libpyside/globalreceiverv2.cpp index b1e75ad8e..bfaa9ff44 100644 --- a/sources/pyside2/libpyside/globalreceiverv2.cpp +++ b/sources/pyside2/libpyside/globalreceiverv2.cpp @@ -276,11 +276,7 @@ int GlobalReceiverV2::refCount(const QObject *link) const void GlobalReceiverV2::notify() { -#if QT_VERSION >= 0x050E00 const QSet<const QObject *> objSet(m_refs.cbegin(), m_refs.cend()); -#else - const auto objSet = QSet<const QObject *>::fromList(m_refs); -#endif Py_BEGIN_ALLOW_THREADS for (const QObject *o : objSet) { QMetaObject::disconnect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID); diff --git a/sources/pyside2/libpyside/pysideproperty.cpp b/sources/pyside2/libpyside/pysideproperty.cpp index 85db745ae..f169c63e1 100644 --- a/sources/pyside2/libpyside/pysideproperty.cpp +++ b/sources/pyside2/libpyside/pysideproperty.cpp @@ -139,17 +139,8 @@ static void qpropertyMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::C break; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - case QMetaObject::RegisterQPropertyObserver: - case QMetaObject::SetQPropertyBinding: -#else - case QMetaObject::QueryPropertyDesignable: - case QMetaObject::QueryPropertyScriptable: - case QMetaObject::QueryPropertyStored: - case QMetaObject::QueryPropertyEditable: - case QMetaObject::QueryPropertyUser: // just to avoid gcc warnings -#endif + case QMetaObject::BindableProperty: case QMetaObject::InvokeMetaMethod: case QMetaObject::CreateInstance: case QMetaObject::IndexOfMethod: diff --git a/sources/pyside2/libpyside/signalmanager.cpp b/sources/pyside2/libpyside/signalmanager.cpp index 69ee67932..0992cfcfd 100644 --- a/sources/pyside2/libpyside/signalmanager.cpp +++ b/sources/pyside2/libpyside/signalmanager.cpp @@ -66,9 +66,6 @@ #include <private/qv4engine_p.h> #include <private/qv4context_p.h> #include <private/qqmldata_p.h> -#if QT_VERSION < 0x050700 - #include <private/qqmlcontextwrapper_p.h> -#endif #endif #if QSLOT_CODE != 1 || QSIGNAL_CODE != 2 @@ -396,13 +393,6 @@ int SignalManager::qt_metacall(QObject *object, QMetaObject::Call call, int id, case QMetaObject::ReadProperty: case QMetaObject::WriteProperty: case QMetaObject::ResetProperty: -# if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - case QMetaObject::QueryPropertyDesignable: - case QMetaObject::QueryPropertyScriptable: - case QMetaObject::QueryPropertyStored: - case QMetaObject::QueryPropertyEditable: - case QMetaObject::QueryPropertyUser: -# endif // < Qt 6 pp->d->metaCallHandler(pp, pySelf, call, args); break; #endif @@ -441,15 +431,7 @@ int SignalManager::qt_metacall(QObject *object, QMetaObject::Call call, int id, if (data && !data->jsWrapper.isNullOrUndefined()) { QV4::ExecutionEngine *engine = data->jsWrapper.engine(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) if (engine->currentStackFrame != nullptr) { -#elif QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) - if (engine->currentContext->d() != engine->rootContext()->d()) { -#else - QV4::ExecutionContext *ctx = engine->currentContext(); - if (ctx->type == QV4::Heap::ExecutionContext::Type_CallContext || - ctx->type == QV4::Heap::ExecutionContext::Type_SimpleCallContext) { -#endif PyObject *errType, *errValue, *errTraceback; PyErr_Fetch(&errType, &errValue, &errTraceback); // PYSIDE-464: The error is only valid before PyErr_Restore, @@ -462,7 +444,6 @@ int SignalManager::qt_metacall(QObject *object, QMetaObject::Call call, int id, PyErr_Print(); // Note: PyErr_Print clears the error. -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) if (isSyntaxError) { return engine->throwSyntaxError(errString); } else if (isTypeError) { @@ -470,18 +451,9 @@ int SignalManager::qt_metacall(QObject *object, QMetaObject::Call call, int id, } else { return engine->throwError(errString); } -#else - if (isSyntaxError) { - return ctx->throwSyntaxError(errString); - } else if (isTypeError) { - return ctx->throwTypeError(errString); - } else { - return ctx->throwError(errString); - } -#endif } } -#endif +#endif // PYSIDE_QML_PRIVATE_API_SUPPORT int reclimit = Py_GetRecursionLimit(); // Inspired by Python's errors.c: PyErr_GivenExceptionMatches() function. |