diff options
author | Ulf Hermann <[email protected]> | 2024-04-11 10:17:52 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2024-04-12 20:32:59 +0200 |
commit | 99c7fe45be00b694da4041c5a06e5484f2985dc6 (patch) | |
tree | 9e8a9d6cf436ae5f49a12249cf0ae0b160403ea3 | |
parent | 235bbe8c644415a83e3f5103eff7c4ef4181164a (diff) |
QtQml: Add a wrapper builtin for QQmlV4Function*
This way qmltyperegistrar can recognize it and refrain from warning
about it.
Task-number: QTBUG-101143
Change-Id: I598140e7e90dbd3e27a78c26eff3d46f0fd3e989
Reviewed-by: Fabian Kosmale <[email protected]>
51 files changed, 115 insertions, 111 deletions
diff --git a/src/labs/platform/qquicklabsplatformmenu.cpp b/src/labs/platform/qquicklabsplatformmenu.cpp index c8e9b854e2..22dddd7040 100644 --- a/src/labs/platform/qquicklabsplatformmenu.cpp +++ b/src/labs/platform/qquicklabsplatformmenu.cpp @@ -650,7 +650,7 @@ void QQuickLabsPlatformMenu::clear() Opens the menu at the specified \a target item, optionally aligned to a menu \a item. */ -void QQuickLabsPlatformMenu::open(QQmlV4Function *args) +void QQuickLabsPlatformMenu::open(QQmlV4FunctionPtr args) { if (!m_handle) return; diff --git a/src/labs/platform/qquicklabsplatformmenu_p.h b/src/labs/platform/qquicklabsplatformmenu_p.h index 4f4f3eacb1..21fe2a286f 100644 --- a/src/labs/platform/qquicklabsplatformmenu_p.h +++ b/src/labs/platform/qquicklabsplatformmenu_p.h @@ -31,7 +31,6 @@ class QIcon; class QWindow; class QQuickItem; class QPlatformMenu; -class QQmlV4Function; class QQuickLabsPlatformMenuBar; class QQuickLabsPlatformMenuItem; class QQuickLabsPlatformIconLoader; @@ -117,7 +116,7 @@ public: Q_INVOKABLE void clear(); public Q_SLOTS: - void open(QQmlV4Function *args); + void open(QQmlV4FunctionPtr args); void close(); Q_SIGNALS: diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 102700e25b..8e1bd24f6b 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -75,7 +75,7 @@ namespace QV4 { struct QObjectMethod; } // class MyClass : public QObject { // Q_OBJECT // ... -// Q_INVOKABLE void myMethod(QQmlV4Function*); +// Q_INVOKABLE void myMethod(QQmlV4FunctionPtr); // }; // The QQmlV8Function - and consequently the arguments and return value - only remains // valid during the call. If the return value isn't set within myMethod(), the will return diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 13b558e6b1..a16a9cab28 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -2953,7 +2953,7 @@ ReturnedValue QObjectMethod::callInternal(const Value *thisObject, const Value * return doCall([&]() { ScopedValue rv(scope, Value::undefinedValue()); QQmlV4Function func(callData, rv, v4); - QQmlV4Function *funcptr = &func; + QQmlV4FunctionPtr funcptr = &func; void *args[] = { nullptr, &funcptr }; object.metacall(QMetaObject::InvokeMetaMethod, method->coreIndex(), args); diff --git a/src/qml/qml/qqmlbuiltinfunctions.cpp b/src/qml/qml/qqmlbuiltinfunctions.cpp index 9e07879833..5c6daa0969 100644 --- a/src/qml/qml/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/qqmlbuiltinfunctions.cpp @@ -1688,7 +1688,7 @@ QJSValue QtObject::binding(const QJSValue &function) const Encode(e->memoryManager->allocate<QQmlBindingFunction>(f))); } -void QtObject::callLater(QQmlV4Function *args) +void QtObject::callLater(QQmlV4FunctionPtr args) { m_engine->delayedCallQueue()->addUniquelyAndExecuteLater(m_engine, args); } diff --git a/src/qml/qml/qqmlbuiltinfunctions_p.h b/src/qml/qml/qqmlbuiltinfunctions_p.h index 5a49db62aa..9ceedad28b 100644 --- a/src/qml/qml/qqmlbuiltinfunctions_p.h +++ b/src/qml/qml/qqmlbuiltinfunctions_p.h @@ -154,7 +154,7 @@ public: QObject *parent = nullptr) const; Q_INVOKABLE QJSValue binding(const QJSValue &function) const; - Q_INVOKABLE void callLater(QQmlV4Function *args); + Q_INVOKABLE void callLater(QQmlV4FunctionPtr args); #if QT_CONFIG(translation) QString uiLanguage() const; diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 7d691db750..8574c96bc1 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -1740,7 +1740,7 @@ QQmlError QQmlComponentPrivate::unsetRequiredPropertyToQQmlError(const RequiredP /*! \internal */ -void QQmlComponent::createObject(QQmlV4Function *args) +void QQmlComponent::createObject(QQmlV4FunctionPtr args) { Q_D(QQmlComponent); Q_ASSERT(d->engine); @@ -1889,7 +1889,7 @@ QObject *QQmlComponent::createObject(QObject *parent, const QVariantMap &propert /*! \internal */ -void QQmlComponent::incubateObject(QQmlV4Function *args) +void QQmlComponent::incubateObject(QQmlV4FunctionPtr args) { Q_D(QQmlComponent); Q_ASSERT(d->engine); diff --git a/src/qml/qml/qqmlcomponent.h b/src/qml/qml/qqmlcomponent.h index e435aa2894..2d68c47c11 100644 --- a/src/qml/qml/qqmlcomponent.h +++ b/src/qml/qml/qqmlcomponent.h @@ -21,7 +21,6 @@ class QByteArray; class QQmlEngine; class QQmlComponent; class QQmlIncubator; -class QQmlV4Function; class QQmlComponentPrivate; class QQmlComponentAttached; @@ -102,12 +101,12 @@ protected: #if QT_DEPRECATED_SINCE(6, 3) QT_DEPRECATED_X("Use the overload with proper arguments") - Q_INVOKABLE void createObject(QQmlV4Function *); + Q_INVOKABLE void createObject(QQmlV4FunctionPtr); #endif Q_INVOKABLE QObject *createObject( QObject *parent = nullptr, const QVariantMap &properties = {}); - Q_INVOKABLE void incubateObject(QQmlV4Function *); + Q_INVOKABLE void incubateObject(QQmlV4FunctionPtr); private: QQmlComponent(QQmlEngine *, QV4::ExecutableCompilationUnit *compilationUnit, int, diff --git a/src/qml/qml/qqmldelayedcallqueue.cpp b/src/qml/qml/qqmldelayedcallqueue.cpp index 96a5679599..efd8519a58 100644 --- a/src/qml/qml/qqmldelayedcallqueue.cpp +++ b/src/qml/qml/qqmldelayedcallqueue.cpp @@ -70,7 +70,7 @@ void QQmlDelayedCallQueue::init(QV4::ExecutionEngine* engine) m_tickedMethod = metaObject.method(methodIndex); } -QV4::ReturnedValue QQmlDelayedCallQueue::addUniquelyAndExecuteLater(QV4::ExecutionEngine *engine, QQmlV4Function *args) +QV4::ReturnedValue QQmlDelayedCallQueue::addUniquelyAndExecuteLater(QV4::ExecutionEngine *engine, QQmlV4FunctionPtr args) { QQmlDelayedCallQueue *self = engine->delayedCallQueue(); @@ -142,7 +142,7 @@ QV4::ReturnedValue QQmlDelayedCallQueue::addUniquelyAndExecuteLater(QV4::Executi return QV4::Encode::undefined(); } -void QQmlDelayedCallQueue::storeAnyArguments(DelayedFunctionCall &dfc, QQmlV4Function *args, int offset, QV4::ExecutionEngine *engine) +void QQmlDelayedCallQueue::storeAnyArguments(DelayedFunctionCall &dfc, QQmlV4FunctionPtr args, int offset, QV4::ExecutionEngine *engine) { const int length = args->length() - offset; if (length == 0) { diff --git a/src/qml/qml/qqmldelayedcallqueue_p.h b/src/qml/qml/qqmldelayedcallqueue_p.h index 9b66e85a14..88f0c4d118 100644 --- a/src/qml/qml/qqmldelayedcallqueue_p.h +++ b/src/qml/qml/qqmldelayedcallqueue_p.h @@ -24,8 +24,6 @@ QT_BEGIN_NAMESPACE -class QQmlV4Function; - class QQmlDelayedCallQueue : public QObject { Q_OBJECT @@ -36,7 +34,7 @@ public: void init(QV4::ExecutionEngine *); static QV4::ReturnedValue addUniquelyAndExecuteLater(QV4::ExecutionEngine *engine, - QQmlV4Function *args); + QQmlV4FunctionPtr args); public Q_SLOTS: void ticked(); @@ -56,7 +54,7 @@ private: bool m_guarded; }; - void storeAnyArguments(DelayedFunctionCall& dfc, QQmlV4Function *args, int offset, QV4::ExecutionEngine *engine); + void storeAnyArguments(DelayedFunctionCall& dfc, QQmlV4FunctionPtr args, int offset, QV4::ExecutionEngine *engine); void executeAllExpired_Later(); QV4::ExecutionEngine *m_engine; diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp index 50c460860b..3249f5a6eb 100644 --- a/src/qml/qml/qqmllocale.cpp +++ b/src/qml/qml/qqmllocale.cpp @@ -434,7 +434,7 @@ ReturnedValue QQmlNumberExtension::method_fromLocaleString(const QV4::FunctionOb //-------------- // Locale object -void QQmlLocaleValueType::formattedDataSize(QQmlV4Function *args) const +void QQmlLocaleValueType::formattedDataSize(QQmlV4FunctionPtr args) const { QV4::Scope scope(args->v4engine()); const auto doThrow = [&](const QString &message) { @@ -520,7 +520,7 @@ QList<QQmlLocale::DayOfWeek> QQmlLocaleValueType::weekDays() const return result; } -void QQmlLocaleValueType::toString(QQmlV4Function *args) const +void QQmlLocaleValueType::toString(QQmlV4FunctionPtr args) const { Scope scope(args->v4engine()); const auto doThrow = [&](const QString &message) { diff --git a/src/qml/qml/qqmllocale_p.h b/src/qml/qml/qqmllocale_p.h index 0fc9338015..5d26bf8a68 100644 --- a/src/qml/qml/qqmllocale_p.h +++ b/src/qml/qml/qqmllocale_p.h @@ -171,7 +171,7 @@ public: return locale.standaloneDayName(index == 0 ? 7 : index, format); } - Q_INVOKABLE void formattedDataSize(QQmlV4Function *args) const; + Q_INVOKABLE void formattedDataSize(QQmlV4FunctionPtr args) const; Q_INVOKABLE QString formattedDataSize( double bytes, int precision = 2, QLocale::DataSizeFormats format = QLocale::DataSizeIecFormat) const @@ -180,7 +180,7 @@ public: qint64(QV4::Value::toInteger(bytes)), precision, format); } - Q_INVOKABLE void toString(QQmlV4Function *args) const; + Q_INVOKABLE void toString(QQmlV4FunctionPtr args) const; // As a special (undocumented) case, when called with no arguments, // just forward to QDebug. This makes it consistent with other types diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h index d7e1676633..93837741e1 100644 --- a/src/qml/qml/qqmlprivate.h +++ b/src/qml/qml/qqmlprivate.h @@ -82,6 +82,9 @@ class QQmlEngine; class QQmlCustomParser; class QQmlTypeNotAvailable; +class QQmlV4Function; +using QQmlV4FunctionPtr = QQmlV4Function *; + template<class T> QQmlCustomParser *qmlCreateCustomParser() { @@ -1152,4 +1155,6 @@ namespace QQmlPrivate QT_END_NAMESPACE +Q_DECLARE_OPAQUE_POINTER(QQmlV4FunctionPtr) + #endif // QQMLPRIVATE_H diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index 14929d9a36..a225f94a3f 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -111,7 +111,7 @@ void QQmlPropertyData::load(const QMetaMethod &m) m_flags.setHasArguments(true); m_flags.setIsV4Function( paramCount == 1 && - m.parameterMetaType(0) == QMetaType::fromType<QQmlV4Function *>()); + m.parameterMetaType(0) == QMetaType::fromType<QQmlV4FunctionPtr>()); } else { m_flags.setHasArguments(false); m_flags.setIsV4Function(false); diff --git a/src/qml/qml/qqmlpropertydata_p.h b/src/qml/qml/qqmlpropertydata_p.h index 760e577ae1..0fa7984f05 100644 --- a/src/qml/qml/qqmlpropertydata_p.h +++ b/src/qml/qml/qqmlpropertydata_p.h @@ -71,7 +71,7 @@ public: unsigned isWritableORhasArguments : 1; // Has WRITE function OR Function takes arguments unsigned isResettableORisSignal : 1; // Has RESET function OR Function is a signal unsigned isAliasORisVMESignal : 1; // Is a QML alias to another property OR Signal was added by QML - unsigned isFinalORisV4Function : 1; // Has FINAL flag OR Function takes QQmlV4Function* args + unsigned isFinalORisV4Function : 1; // Has FINAL flag OR Function takes QQmlV4FunctionPtr args unsigned isSignalHandler : 1; // Function is a signal handler // TODO: Remove this once we can. Signals should not be overridable. diff --git a/src/qml/qqmlbuiltins_p.h b/src/qml/qqmlbuiltins_p.h index 7ce07eb41c..40375655ad 100644 --- a/src/qml/qqmlbuiltins_p.h +++ b/src/qml/qqmlbuiltins_p.h @@ -301,6 +301,14 @@ struct QQmlScriptStringForeign QML_FOREIGN(QQmlScriptString) }; +struct QQmlV4FunctionPtrForeign +{ + Q_GADGET + QML_ANONYMOUS + QML_FOREIGN(QQmlV4FunctionPtr) + QML_EXTENDED(QQmlV4FunctionPtrForeign) +}; + QT_END_NAMESPACE #endif // QQMLBUILTINS_H diff --git a/src/qmllocalstorage/qqmllocalstorage.cpp b/src/qmllocalstorage/qqmllocalstorage.cpp index 29e2d35a44..bed86c141e 100644 --- a/src/qmllocalstorage/qqmllocalstorage.cpp +++ b/src/qmllocalstorage/qqmllocalstorage.cpp @@ -682,7 +682,7 @@ Returns the created database object. */ -void QQmlLocalStorage::openDatabaseSync(QQmlV4Function *args) +void QQmlLocalStorage::openDatabaseSync(QQmlV4FunctionPtr args) { #if QT_CONFIG(settings) QV4::Scope scope(args->v4engine()); diff --git a/src/qmllocalstorage/qqmllocalstorage_p.h b/src/qmllocalstorage/qqmllocalstorage_p.h index 546ee7e303..510ee78dbe 100644 --- a/src/qmllocalstorage/qqmllocalstorage_p.h +++ b/src/qmllocalstorage/qqmllocalstorage_p.h @@ -34,7 +34,7 @@ public: QQmlLocalStorage(QObject *parent = nullptr) : QObject(parent) {} ~QQmlLocalStorage() override = default; - Q_INVOKABLE void openDatabaseSync(QQmlV4Function* args); + Q_INVOKABLE void openDatabaseSync(QQmlV4FunctionPtr args); }; QT_END_NAMESPACE diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp index 2a2ac89ad7..bf910be0ef 100644 --- a/src/qmlmodels/qqmldelegatemodel.cpp +++ b/src/qmlmodels/qqmldelegatemodel.cpp @@ -3079,7 +3079,7 @@ bool QQmlDelegateModelGroupPrivate::parseIndex(const QV4::Value &value, int *ind items that are later replaced by actual data. */ -void QQmlDelegateModelGroup::insert(QQmlV4Function *args) +void QQmlDelegateModelGroup::insert(QQmlV4FunctionPtr args) { Q_D(QQmlDelegateModelGroup); QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model); @@ -3142,7 +3142,7 @@ void QQmlDelegateModelGroup::insert(QQmlV4Function *args) group remain instantiated when not referenced by any view. */ -void QQmlDelegateModelGroup::create(QQmlV4Function *args) +void QQmlDelegateModelGroup::create(QQmlV4FunctionPtr args) { Q_D(QQmlDelegateModelGroup); if (!d->model) @@ -3220,7 +3220,7 @@ void QQmlDelegateModelGroup::create(QQmlV4Function *args) that the previously unresolved item has simply moved. */ -void QQmlDelegateModelGroup::resolve(QQmlV4Function *args) +void QQmlDelegateModelGroup::resolve(QQmlV4FunctionPtr args) { Q_D(QQmlDelegateModelGroup); if (!d->model) @@ -3324,7 +3324,7 @@ void QQmlDelegateModelGroup::resolve(QQmlV4Function *args) Removes \a count items starting at \a index from the group. */ -void QQmlDelegateModelGroup::remove(QQmlV4Function *args) +void QQmlDelegateModelGroup::remove(QQmlV4FunctionPtr args) { Q_D(QQmlDelegateModelGroup); if (!d->model) @@ -3364,7 +3364,7 @@ void QQmlDelegateModelGroup::remove(QQmlV4Function *args) } bool QQmlDelegateModelGroupPrivate::parseGroupArgs( - QQmlV4Function *args, Compositor::Group *group, int *index, int *count, int *groups) const + QQmlV4FunctionPtr args, Compositor::Group *group, int *index, int *count, int *groups) const { if (!model || !QQmlDelegateModelPrivate::get(model)->m_cacheMetaType) return false; @@ -3398,7 +3398,7 @@ bool QQmlDelegateModelGroupPrivate::parseGroupArgs( Adds \a count items starting at \a index to \a groups. */ -void QQmlDelegateModelGroup::addGroups(QQmlV4Function *args) +void QQmlDelegateModelGroup::addGroups(QQmlV4FunctionPtr args) { Q_D(QQmlDelegateModelGroup); Compositor::Group group = d->group; @@ -3428,7 +3428,7 @@ void QQmlDelegateModelGroup::addGroups(QQmlV4Function *args) Removes \a count items starting at \a index from \a groups. */ -void QQmlDelegateModelGroup::removeGroups(QQmlV4Function *args) +void QQmlDelegateModelGroup::removeGroups(QQmlV4FunctionPtr args) { Q_D(QQmlDelegateModelGroup); Compositor::Group group = d->group; @@ -3459,7 +3459,7 @@ void QQmlDelegateModelGroup::removeGroups(QQmlV4Function *args) their existing groups and added to \a groups. */ -void QQmlDelegateModelGroup::setGroups(QQmlV4Function *args) +void QQmlDelegateModelGroup::setGroups(QQmlV4FunctionPtr args) { Q_D(QQmlDelegateModelGroup); Compositor::Group group = d->group; @@ -3494,7 +3494,7 @@ void QQmlDelegateModelGroup::setGroups(QQmlV4Function *args) reordering you have done via this function. */ -void QQmlDelegateModelGroup::move(QQmlV4Function *args) +void QQmlDelegateModelGroup::move(QQmlV4FunctionPtr args) { Q_D(QQmlDelegateModelGroup); diff --git a/src/qmlmodels/qqmldelegatemodel_p.h b/src/qmlmodels/qqmldelegatemodel_p.h index 477f4e60f8..2eeffb9e0c 100644 --- a/src/qmlmodels/qqmldelegatemodel_p.h +++ b/src/qmlmodels/qqmldelegatemodel_p.h @@ -29,7 +29,6 @@ QT_BEGIN_NAMESPACE class QQmlChangeSet; class QQuickPackage; -class QQmlV4Function; class QQmlDelegateModelGroup; class QQmlDelegateModelAttached; class QQmlDelegateModelPrivate; @@ -157,14 +156,14 @@ public: Q_INVOKABLE QJSValue get(int index); public Q_SLOTS: - void insert(QQmlV4Function *); - void create(QQmlV4Function *); - void resolve(QQmlV4Function *); - void remove(QQmlV4Function *); - void addGroups(QQmlV4Function *); - void removeGroups(QQmlV4Function *); - void setGroups(QQmlV4Function *); - void move(QQmlV4Function *); + void insert(QQmlV4FunctionPtr); + void create(QQmlV4FunctionPtr); + void resolve(QQmlV4FunctionPtr); + void remove(QQmlV4FunctionPtr); + void addGroups(QQmlV4FunctionPtr); + void removeGroups(QQmlV4FunctionPtr); + void setGroups(QQmlV4FunctionPtr); + void move(QQmlV4FunctionPtr); Q_SIGNALS: void countChanged(); diff --git a/src/qmlmodels/qqmldelegatemodel_p_p.h b/src/qmlmodels/qqmldelegatemodel_p_p.h index b6b25b7776..3c7ab9281d 100644 --- a/src/qmlmodels/qqmldelegatemodel_p_p.h +++ b/src/qmlmodels/qqmldelegatemodel_p_p.h @@ -233,7 +233,7 @@ public: bool parseIndex(const QV4::Value &value, int *index, Compositor::Group *group) const; bool parseGroupArgs( - QQmlV4Function *args, Compositor::Group *group, int *index, int *count, int *groups) const; + QQmlV4FunctionPtr args, Compositor::Group *group, int *index, int *count, int *groups) const; Compositor::Group group; QPointer<QQmlDelegateModel> model; diff --git a/src/qmlmodels/qqmllistmodel.cpp b/src/qmlmodels/qqmllistmodel.cpp index 25c74e2ae5..de7d97af2f 100644 --- a/src/qmlmodels/qqmllistmodel.cpp +++ b/src/qmlmodels/qqmllistmodel.cpp @@ -2385,7 +2385,7 @@ void QQmlListModel::clear() \sa clear() */ -void QQmlListModel::remove(QQmlV4Function *args) +void QQmlListModel::remove(QQmlV4FunctionPtr args) { int argLength = args->length(); @@ -2473,7 +2473,7 @@ void QQmlListModel::updateTranslations() \sa set(), append() */ -void QQmlListModel::insert(QQmlV4Function *args) +void QQmlListModel::insert(QQmlV4FunctionPtr args) { if (args->length() == 2) { QV4::Scope scope(args->v4engine()); @@ -2589,7 +2589,7 @@ void QQmlListModel::move(int from, int to, int n) \sa set(), remove() */ -void QQmlListModel::append(QQmlV4Function *args) +void QQmlListModel::append(QQmlV4FunctionPtr args) { if (args->length() == 1) { QV4::Scope scope(args->v4engine()); diff --git a/src/qmlmodels/qqmllistmodel_p.h b/src/qmlmodels/qqmllistmodel_p.h index 28a26a6950..f623fe6112 100644 --- a/src/qmlmodels/qqmllistmodel_p.h +++ b/src/qmlmodels/qqmllistmodel_p.h @@ -65,9 +65,9 @@ public: int count() const; Q_INVOKABLE void clear(); - Q_INVOKABLE void remove(QQmlV4Function *args); - Q_INVOKABLE void append(QQmlV4Function *args); - Q_INVOKABLE void insert(QQmlV4Function *args); + Q_INVOKABLE void remove(QQmlV4FunctionPtr args); + Q_INVOKABLE void append(QQmlV4FunctionPtr args); + Q_INVOKABLE void insert(QQmlV4FunctionPtr args); Q_INVOKABLE QJSValue get(int index) const; Q_INVOKABLE void set(int index, const QJSValue &value); Q_INVOKABLE void setProperty(int index, const QString& property, const QVariant& value); diff --git a/src/qmlmodels/qqmllistmodelworkeragent.cpp b/src/qmlmodels/qqmllistmodelworkeragent.cpp index 74c4e812bf..c50296b1f5 100644 --- a/src/qmlmodels/qqmllistmodelworkeragent.cpp +++ b/src/qmlmodels/qqmllistmodelworkeragent.cpp @@ -71,17 +71,17 @@ void QQmlListModelWorkerAgent::clear() m_copy->clear(); } -void QQmlListModelWorkerAgent::remove(QQmlV4Function *args) +void QQmlListModelWorkerAgent::remove(QQmlV4FunctionPtr args) { m_copy->remove(args); } -void QQmlListModelWorkerAgent::append(QQmlV4Function *args) +void QQmlListModelWorkerAgent::append(QQmlV4FunctionPtr args) { m_copy->append(args); } -void QQmlListModelWorkerAgent::insert(QQmlV4Function *args) +void QQmlListModelWorkerAgent::insert(QQmlV4FunctionPtr args) { m_copy->insert(args); } diff --git a/src/qmlmodels/qqmllistmodelworkeragent_p.h b/src/qmlmodels/qqmllistmodelworkeragent_p.h index 8ee9782a4a..03cbe3ee55 100644 --- a/src/qmlmodels/qqmllistmodelworkeragent_p.h +++ b/src/qmlmodels/qqmllistmodelworkeragent_p.h @@ -52,9 +52,9 @@ public: int count() const; Q_INVOKABLE void clear(); - Q_INVOKABLE void remove(QQmlV4Function *args); - Q_INVOKABLE void append(QQmlV4Function *args); - Q_INVOKABLE void insert(QQmlV4Function *args); + Q_INVOKABLE void remove(QQmlV4FunctionPtr args); + Q_INVOKABLE void append(QQmlV4FunctionPtr args); + Q_INVOKABLE void insert(QQmlV4FunctionPtr args); Q_INVOKABLE QJSValue get(int index) const; Q_INVOKABLE void set(int index, const QJSValue &value); Q_INVOKABLE void setProperty(int index, const QString& property, const QVariant& value); diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp index 519bb7ba43..c5014f66d4 100644 --- a/src/qmltest/quicktestresult.cpp +++ b/src/qmltest/quicktestresult.cpp @@ -504,7 +504,7 @@ bool QuickTestResult::fuzzyCompare(const QVariant &actual, const QVariant &expec return false; } -void QuickTestResult::stringify(QQmlV4Function *args) +void QuickTestResult::stringify(QQmlV4FunctionPtr args) { if (args->length() < 1) args->setReturnValue(QV4::Encode::null()); diff --git a/src/qmltest/quicktestresult_p.h b/src/qmltest/quicktestresult_p.h index 83e9397635..1e274e1804 100644 --- a/src/qmltest/quicktestresult_p.h +++ b/src/qmltest/quicktestresult_p.h @@ -91,7 +91,7 @@ public Q_SLOTS: void finishTestDataCleanup(); void finishTestFunction(); - void stringify(QQmlV4Function *args); + void stringify(QQmlV4FunctionPtr args); void fail(const QString &message, const QUrl &location, int line); bool verify(bool success, const QString &message, diff --git a/src/qmltyperegistrar/qqmltypescreator.cpp b/src/qmltyperegistrar/qqmltypescreator.cpp index b339f39ccb..0cc2f02ebb 100644 --- a/src/qmltyperegistrar/qqmltypescreator.cpp +++ b/src/qmltyperegistrar/qqmltypescreator.cpp @@ -324,9 +324,12 @@ void QmlTypesCreator::writeMethods(const QCborArray &methods, QLatin1StringView for (qsizetype i = 0, end = arguments.size(); i != end; ++i) { const QCborMap obj = arguments[i].toMap(); - if (i == 0 && end == 1 && obj[MetatypesDotJson::S_TYPE] == QLatin1String("QQmlV4Function*")) { - m_qml.writeBooleanBinding(S_IS_JAVASCRIPT_FUNCTION, true); - break; + if (i == 0 && end == 1) { + const QAnyStringView type = toStringView(obj, MetatypesDotJson::S_TYPE); + if (type == "QQmlV4FunctionPtr"_L1 || type == "QQmlV4Function*"_L1) { + m_qml.writeBooleanBinding(S_IS_JAVASCRIPT_FUNCTION, true); + break; + } } m_qml.writeStartObject(S_PARAMETER); const QAnyStringView name = toStringView(obj, MetatypesDotJson::S_NAME); diff --git a/src/qmlworkerscript/qquickworkerscript.cpp b/src/qmlworkerscript/qquickworkerscript.cpp index 6f09d4357d..b4fd21fe7e 100644 --- a/src/qmlworkerscript/qquickworkerscript.cpp +++ b/src/qmlworkerscript/qquickworkerscript.cpp @@ -580,7 +580,7 @@ bool QQuickWorkerScript::ready() const of ListModel objects, any modifications by the other thread to an object passed in \c message will not be reflected in the original object. */ -void QQuickWorkerScript::sendMessage(QQmlV4Function *args) +void QQuickWorkerScript::sendMessage(QQmlV4FunctionPtr args) { if (!engine()) { qWarning("QQuickWorkerScript: Attempt to send message before WorkerScript establishment"); diff --git a/src/qmlworkerscript/qquickworkerscript_p.h b/src/qmlworkerscript/qquickworkerscript_p.h index cf7487038b..1c4c0500fe 100644 --- a/src/qmlworkerscript/qquickworkerscript_p.h +++ b/src/qmlworkerscript/qquickworkerscript_p.h @@ -47,7 +47,6 @@ private: QQuickWorkerScriptEnginePrivate *d; }; -class QQmlV4Function; class Q_QMLWORKERSCRIPT_EXPORT QQuickWorkerScript : public QObject, public QQmlParserStatus { Q_OBJECT @@ -69,7 +68,7 @@ public: bool ready() const; public Q_SLOTS: - void sendMessage(QQmlV4Function*); + void sendMessage(QQmlV4FunctionPtr); Q_SIGNALS: void sourceChanged(); diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index bdc6bf0fb3..6ae5914970 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -810,7 +810,7 @@ QSGTextureProvider *QQuickCanvasItem::textureProvider() const */ -void QQuickCanvasItem::getContext(QQmlV4Function *args) +void QQuickCanvasItem::getContext(QQmlV4FunctionPtr args) { Q_D(QQuickCanvasItem); @@ -854,7 +854,7 @@ void QQuickCanvasItem::getContext(QQmlV4Function *args) scene. */ -void QQuickCanvasItem::requestAnimationFrame(QQmlV4Function *args) +void QQuickCanvasItem::requestAnimationFrame(QQmlV4FunctionPtr args) { QV4::Scope scope(args->v4engine()); QV4::ScopedFunctionObject f(scope, (*args)[0]); @@ -883,7 +883,7 @@ void QQuickCanvasItem::requestAnimationFrame(QQmlV4Function *args) This function will cancel the animation callback referenced by \a handle. */ -void QQuickCanvasItem::cancelRequestAnimationFrame(QQmlV4Function *args) +void QQuickCanvasItem::cancelRequestAnimationFrame(QQmlV4FunctionPtr args) { QV4::Scope scope(args->v4engine()); QV4::ScopedValue v(scope, (*args)[0]); diff --git a/src/quick/items/context2d/qquickcanvasitem_p.h b/src/quick/items/context2d/qquickcanvasitem_p.h index d84f3e4030..300039743d 100644 --- a/src/quick/items/context2d/qquickcanvasitem_p.h +++ b/src/quick/items/context2d/qquickcanvasitem_p.h @@ -31,7 +31,6 @@ class QQuickCanvasContext; class QQuickCanvasItemPrivate; class QQuickPixmap; -class QQmlV4Function; class QQuickCanvasPixmap final : public QQmlRefCounted<QQuickCanvasPixmap> { @@ -110,10 +109,10 @@ public: QImage toImage(const QRectF& rect = QRectF()) const; - Q_INVOKABLE void getContext(QQmlV4Function *args); + Q_INVOKABLE void getContext(QQmlV4FunctionPtr args); - Q_INVOKABLE void requestAnimationFrame(QQmlV4Function *args); - Q_INVOKABLE void cancelRequestAnimationFrame(QQmlV4Function *args); + Q_INVOKABLE void requestAnimationFrame(QQmlV4FunctionPtr args); + Q_INVOKABLE void cancelRequestAnimationFrame(QQmlV4FunctionPtr args); Q_INVOKABLE void requestPaint(); Q_INVOKABLE void markDirty(const QRectF& dirtyRect = QRectF()); diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index 1d7ae9b4ca..dbe443b2b3 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -580,7 +580,7 @@ void QQuickDragAttachedPrivate::start(Qt::DropActions supportedActions) property for the started sequence. */ -void QQuickDragAttached::start(QQmlV4Function *args) +void QQuickDragAttached::start(QQmlV4FunctionPtr args) { Q_D(QQuickDragAttached); if (d->inEvent) { @@ -856,7 +856,7 @@ Qt::DropAction QQuickDragAttachedPrivate::startDrag(Qt::DropActions supportedAct property for the started sequence. */ -void QQuickDragAttached::startDrag(QQmlV4Function *args) +void QQuickDragAttached::startDrag(QQmlV4FunctionPtr args) { Q_D(QQuickDragAttached); diff --git a/src/quick/items/qquickdrag_p.h b/src/quick/items/qquickdrag_p.h index cc08a03ccc..fa73e91485 100644 --- a/src/quick/items/qquickdrag_p.h +++ b/src/quick/items/qquickdrag_p.h @@ -119,7 +119,6 @@ private: friend class QQuickDragAttachedPrivate; }; -class QQmlV4Function; class QQuickDragAttached; class Q_QUICK_EXPORT QQuickDrag : public QObject { @@ -274,8 +273,8 @@ public: bool event(QEvent *event) override; public Q_SLOTS: - void start(QQmlV4Function *); - void startDrag(QQmlV4Function *); + void start(QQmlV4FunctionPtr); + void startDrag(QQmlV4FunctionPtr); void cancel(); Q_SIGNALS: diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 5b74a3ddb3..5e92403dc2 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -4621,7 +4621,7 @@ void QQuickItem::ensurePolished() } #if QT_DEPRECATED_SINCE(6, 5) -static bool unwrapMapFromToFromItemArgs(QQmlV4Function *args, const QQuickItem *itemForWarning, const QString &functionNameForWarning, +static bool unwrapMapFromToFromItemArgs(QQmlV4FunctionPtr args, const QQuickItem *itemForWarning, const QString &functionNameForWarning, QQuickItem **itemObj, qreal *x, qreal *y, qreal *w, qreal *h, bool *isRect) { QV4::ExecutionEngine *v4 = args->v4engine(); @@ -4727,7 +4727,7 @@ static bool unwrapMapFromToFromItemArgs(QQmlV4Function *args, const QQuickItem * /*! \internal */ -void QQuickItem::mapFromItem(QQmlV4Function *args) const +void QQuickItem::mapFromItem(QQmlV4FunctionPtr args) const { QV4::ExecutionEngine *v4 = args->v4engine(); QV4::Scope scope(v4); @@ -4785,7 +4785,7 @@ QTransform QQuickItem::itemTransform(QQuickItem *other, bool *ok) const /*! \internal */ -void QQuickItem::mapToItem(QQmlV4Function *args) const +void QQuickItem::mapToItem(QQmlV4FunctionPtr args) const { QV4::ExecutionEngine *v4 = args->v4engine(); QV4::Scope scope(v4); @@ -4803,7 +4803,7 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const args->setReturnValue(rv.asReturnedValue()); } -static bool unwrapMapFromToFromGlobalArgs(QQmlV4Function *args, const QQuickItem *itemForWarning, const QString &functionNameForWarning, qreal *x, qreal *y) +static bool unwrapMapFromToFromGlobalArgs(QQmlV4FunctionPtr args, const QQuickItem *itemForWarning, const QString &functionNameForWarning, qreal *x, qreal *y) { QV4::ExecutionEngine *v4 = args->v4engine(); if (args->length() != 1 && args->length() != 2) { @@ -4861,7 +4861,7 @@ static bool unwrapMapFromToFromGlobalArgs(QQmlV4Function *args, const QQuickItem /*! \internal */ -void QQuickItem::mapFromGlobal(QQmlV4Function *args) const +void QQuickItem::mapFromGlobal(QQmlV4FunctionPtr args) const { QV4::ExecutionEngine *v4 = args->v4engine(); QV4::Scope scope(v4); @@ -4891,7 +4891,7 @@ void QQuickItem::mapFromGlobal(QQmlV4Function *args) const /*! \internal */ -void QQuickItem::mapToGlobal(QQmlV4Function *args) const +void QQuickItem::mapToGlobal(QQmlV4FunctionPtr args) const { QV4::ExecutionEngine *v4 = args->v4engine(); QV4::Scope scope(v4); diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h index 9cdbc4c397..fdf09d30b0 100644 --- a/src/quick/items/qquickitem.h +++ b/src/quick/items/qquickitem.h @@ -45,7 +45,6 @@ private: class QCursor; class QQuickItemLayer; -class QQmlV4Function; class QQuickState; class QQuickAnchorLine; class QQuickTransition; @@ -323,7 +322,7 @@ public: #if QT_DEPRECATED_SINCE(6, 5) QT_DEPRECATED_VERSION_X_6_5("Use typed overload or mapRectFromItem") - void mapFromItem(QQmlV4Function*) const; + void mapFromItem(QQmlV4FunctionPtr) const; #endif Q_INVOKABLE QPointF mapFromItem(const QQuickItem *item, const QPointF &point) const; // overloads mainly exist for QML @@ -333,7 +332,7 @@ public: #if QT_DEPRECATED_SINCE(6, 5) QT_DEPRECATED_VERSION_X_6_5("Use typed overload or mapRectToItem") - void mapToItem(QQmlV4Function*) const; + void mapToItem(QQmlV4FunctionPtr) const; #endif Q_INVOKABLE QPointF mapToItem(const QQuickItem *item, const QPointF &point) const; // overloads mainly exist for QML @@ -343,7 +342,7 @@ public: #if QT_DEPRECATED_SINCE(6, 5) QT_DEPRECATED_VERSION_X_6_5("Use the typed overload") - Q_REVISION(2, 7) void mapFromGlobal(QQmlV4Function*) const; + Q_REVISION(2, 7) void mapFromGlobal(QQmlV4FunctionPtr) const; #endif Q_REVISION(2, 7) Q_INVOKABLE QPointF mapFromGlobal(qreal x, qreal y) const; // overload mainly exists for QML @@ -351,7 +350,7 @@ public: #if QT_DEPRECATED_SINCE(6, 5) QT_DEPRECATED_VERSION_X_6_5("Use the typed overload") - Q_REVISION(2, 7) void mapToGlobal(QQmlV4Function*) const; + Q_REVISION(2, 7) void mapToGlobal(QQmlV4FunctionPtr) const; #endif Q_REVISION(2, 7) Q_INVOKABLE QPointF mapToGlobal(qreal x, qreal y) const; // overload only exist for QML diff --git a/src/quick/items/qquickloader_p.h b/src/quick/items/qquickloader_p.h index 3dcbb244eb..c3d2015aed 100644 --- a/src/quick/items/qquickloader_p.h +++ b/src/quick/items/qquickloader_p.h @@ -20,7 +20,6 @@ QT_BEGIN_NAMESPACE class QQuickLoaderPrivate; -class QQmlV4Function; class Q_QUICK_EXPORT QQuickLoader : public QQuickImplicitSizeItem { Q_OBJECT diff --git a/src/quick/items/qquickloader_p_p.h b/src/quick/items/qquickloader_p_p.h index 43257e0c84..39011f1162 100644 --- a/src/quick/items/qquickloader_p_p.h +++ b/src/quick/items/qquickloader_p_p.h @@ -27,7 +27,6 @@ QT_BEGIN_NAMESPACE class QQuickLoaderPrivate; -class QQmlV4Function; class QQuickLoaderIncubator : public QQmlIncubator { public: diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 3edfb6aa1b..ef00451788 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -1434,7 +1434,7 @@ QRectF QQuickTextInput::positionToRectangle(int pos) const Returns the position before the character that is nearest x. */ -void QQuickTextInput::positionAt(QQmlV4Function *args) const +void QQuickTextInput::positionAt(QQmlV4FunctionPtr args) const { Q_D(const QQuickTextInput); diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h index 8380652231..5212e6117e 100644 --- a/src/quick/items/qquicktextinput_p.h +++ b/src/quick/items/qquicktextinput_p.h @@ -144,7 +144,7 @@ public: Q_ENUM(RenderType) //Auxilliary functions needed to control the TextInput from QML - Q_INVOKABLE void positionAt(QQmlV4Function *args) const; + Q_INVOKABLE void positionAt(QQmlV4FunctionPtr args) const; Q_INVOKABLE QRectF positionToRectangle(int pos) const; Q_INVOKABLE void moveCursorSelection(int pos); Q_INVOKABLE void moveCursorSelection(int pos, SelectionMode mode); diff --git a/src/quicktemplates/qquickmenu.cpp b/src/quicktemplates/qquickmenu.cpp index 1837fe0798..707b115983 100644 --- a/src/quicktemplates/qquickmenu.cpp +++ b/src/quicktemplates/qquickmenu.cpp @@ -1366,7 +1366,7 @@ void QQuickMenu::popup(const QPointF &pos, QQuickItem *menuItem) \sa dismiss(), Popup::open() */ -void QQuickMenu::popup(QQmlV4Function *args) +void QQuickMenu::popup(QQmlV4FunctionPtr args) { Q_D(QQuickMenu); const int len = args->length(); diff --git a/src/quicktemplates/qquickmenu_p.h b/src/quicktemplates/qquickmenu_p.h index da7fce80f8..0ff8a121ac 100644 --- a/src/quicktemplates/qquickmenu_p.h +++ b/src/quicktemplates/qquickmenu_p.h @@ -100,7 +100,7 @@ public: void popup(QQuickItem *menuItem = nullptr); void popup(const QPointF &pos, QQuickItem *menuItem = nullptr); - Q_REVISION(2, 3) Q_INVOKABLE void popup(QQmlV4Function *args); + Q_REVISION(2, 3) Q_INVOKABLE void popup(QQmlV4FunctionPtr args); Q_REVISION(2, 3) Q_INVOKABLE void dismiss(); protected: diff --git a/src/quicktemplates/qquickstackview.cpp b/src/quicktemplates/qquickstackview.cpp index e97fecf1f6..2e0109863a 100644 --- a/src/quicktemplates/qquickstackview.cpp +++ b/src/quicktemplates/qquickstackview.cpp @@ -567,7 +567,7 @@ QQuickItem *QQuickStackView::find(const QJSValue &callback, LoadBehavior behavio \sa initialItem, {Pushing Items} */ -void QQuickStackView::push(QQmlV4Function *args) +void QQuickStackView::push(QQmlV4FunctionPtr args) { Q_D(QQuickStackView); const QString operationName = QStringLiteral("push"); @@ -681,7 +681,7 @@ void QQuickStackView::push(QQmlV4Function *args) \sa clear(), {Popping Items}, {Unwinding Items via Pop} */ -void QQuickStackView::pop(QQmlV4Function *args) +void QQuickStackView::pop(QQmlV4FunctionPtr args) { Q_D(QQuickStackView); const QString operationName = QStringLiteral("pop"); @@ -853,7 +853,7 @@ void QQuickStackView::pop(QQmlV4Function *args) \sa push(), {Replacing Items} */ -void QQuickStackView::replace(QQmlV4Function *args) +void QQuickStackView::replace(QQmlV4FunctionPtr args) { Q_D(QQuickStackView); const QString operationName = QStringLiteral("replace"); diff --git a/src/quicktemplates/qquickstackview_p.cpp b/src/quicktemplates/qquickstackview_p.cpp index 808ae2cd70..0288ff1f4b 100644 --- a/src/quicktemplates/qquickstackview_p.cpp +++ b/src/quicktemplates/qquickstackview_p.cpp @@ -49,7 +49,7 @@ void QQuickStackViewPrivate::setCurrentItem(QQuickStackElement *element) emit q->currentItemChanged(); } -static bool initProperties(QQuickStackElement *element, const QV4::Value &props, QQmlV4Function *args) +static bool initProperties(QQuickStackElement *element, const QV4::Value &props, QQmlV4FunctionPtr args) { if (props.isObject()) { const QV4::QObjectWrapper *wrapper = props.as<QV4::QObjectWrapper>(); @@ -63,7 +63,7 @@ static bool initProperties(QQuickStackElement *element, const QV4::Value &props, return false; } -QList<QQuickStackElement *> QQuickStackViewPrivate::parseElements(int from, QQmlV4Function *args, QStringList *errors) +QList<QQuickStackElement *> QQuickStackViewPrivate::parseElements(int from, QQmlV4FunctionPtr args, QStringList *errors) { QV4::ExecutionEngine *v4 = args->v4engine(); auto context = v4->callingQmlContext(); diff --git a/src/quicktemplates/qquickstackview_p.h b/src/quicktemplates/qquickstackview_p.h index fb9e8e38d6..8606759a7c 100644 --- a/src/quicktemplates/qquickstackview_p.h +++ b/src/quicktemplates/qquickstackview_p.h @@ -20,7 +20,6 @@ QT_BEGIN_NAMESPACE -class QQmlV4Function; class QQuickTransition; class QQuickStackElement; class QQuickStackViewPrivate; @@ -142,9 +141,9 @@ public: }; Q_ENUM(Operation) - Q_INVOKABLE void push(QQmlV4Function *args); - Q_INVOKABLE void pop(QQmlV4Function *args); - Q_INVOKABLE void replace(QQmlV4Function *args); + Q_INVOKABLE void push(QQmlV4FunctionPtr args); + Q_INVOKABLE void pop(QQmlV4FunctionPtr args); + Q_INVOKABLE void replace(QQmlV4FunctionPtr args); Q_REVISION(6, 7) Q_INVOKABLE QQuickItem *pushItems(QList<QQuickStackViewArg> args, Operation operation = Immediate); diff --git a/src/quicktemplates/qquickstackview_p_p.h b/src/quicktemplates/qquickstackview_p_p.h index 6acfaa93a1..7d6ee50b1b 100644 --- a/src/quicktemplates/qquickstackview_p_p.h +++ b/src/quicktemplates/qquickstackview_p_p.h @@ -49,7 +49,7 @@ public: void setCurrentItem(QQuickStackElement *element); - QList<QQuickStackElement *> parseElements(int from, QQmlV4Function *args, QStringList *errors); + QList<QQuickStackElement *> parseElements(int from, QQmlV4FunctionPtr args, QStringList *errors); QList<QQuickStackElement *> parseElements(const QList<QQuickStackViewArg> &args); QQuickStackElement *findElement(QQuickItem *item) const; QQuickStackElement *findElement(const QV4::Value &value) const; diff --git a/tests/auto/qml/debugger/qv4debugger/commontypes.h b/tests/auto/qml/debugger/qv4debugger/commontypes.h index ccc3b258ae..b63059b0e6 100644 --- a/tests/auto/qml/debugger/qv4debugger/commontypes.h +++ b/tests/auto/qml/debugger/qv4debugger/commontypes.h @@ -14,7 +14,7 @@ class MyType : public QQuickItem QML_ELEMENT public: MyType(QQuickItem *parent = nullptr) : QQuickItem(parent) {} - Q_INVOKABLE void name(QQmlV4Function*) const {} + Q_INVOKABLE void name(QQmlV4FunctionPtr) const {} }; #endif // COMMONTYPES_H diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index 0f47447057..daa16eba72 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -4751,7 +4751,7 @@ public: bool called = false; - Q_INVOKABLE void callMe(QQmlV4Function *) { + Q_INVOKABLE void callMe(QQmlV4FunctionPtr) { called = true; } }; diff --git a/tests/auto/qml/qmlcppcodegen/data/objectwithmethod.h b/tests/auto/qml/qmlcppcodegen/data/objectwithmethod.h index c59a47d2c2..f43a0d5531 100644 --- a/tests/auto/qml/qmlcppcodegen/data/objectwithmethod.h +++ b/tests/auto/qml/qmlcppcodegen/data/objectwithmethod.h @@ -32,7 +32,7 @@ public: // The meta methods are populated back to front. // The V4Function flag should not bleed into the others in either case. - Q_INVOKABLE void overloaded(QQmlV4Function *) { setObjectName(QStringLiteral("javaScript")); } + Q_INVOKABLE void overloaded(QQmlV4FunctionPtr) { setObjectName(QStringLiteral("javaScript")); } Q_INVOKABLE void overloaded(double) { setObjectName(QStringLiteral("double")); } Q_INVOKABLE void overloaded(const QString &) { setObjectName(QStringLiteral("string")); } @@ -41,7 +41,7 @@ public: Q_INVOKABLE void overloaded2(double) { setObjectName(QStringLiteral("double")); } Q_INVOKABLE void overloaded2(const QString &) { setObjectName(QStringLiteral("string")); } - Q_INVOKABLE void overloaded2(QQmlV4Function *) { setObjectName(QStringLiteral("javaScript")); } + Q_INVOKABLE void overloaded2(QQmlV4FunctionPtr) { setObjectName(QStringLiteral("javaScript")); } }; class OverriddenObjectName : public ObjectWithMethod diff --git a/tests/auto/qml/qqmlecmascript/testtypes.cpp b/tests/auto/qml/qqmlecmascript/testtypes.cpp index eb4c4b6c1e..5f7713392b 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.cpp +++ b/tests/auto/qml/qqmlecmascript/testtypes.cpp @@ -106,7 +106,7 @@ public: void setWidth(int) { } }; -void MyQmlObject::v8function(QQmlV4Function *function) +void MyQmlObject::v8function(QQmlV4FunctionPtr function) { function->v4engine()->throwError(QStringLiteral("Exception thrown from within QObject slot")); } diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h index 2df3716113..cc20437fff 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.h +++ b/tests/auto/qml/qqmlecmascript/testtypes.h @@ -244,7 +244,7 @@ public slots: void myinvokable(MyQmlObject *o) { myinvokableObject = o; } void variantMethod(const QVariant &v) { m_variant = v; } void qjsvalueMethod(const QJSValue &v) { m_qjsvalue = v; } - void v8function(QQmlV4Function*); + void v8function(QQmlV4FunctionPtr); void registeredFlagMethod(Qt::MouseButtons v) { m_buttons = v; } QString slotWithReturnValue(const QString &arg) { return arg; } int resetCount() { return m_resetCount; } @@ -931,7 +931,7 @@ public: Q_INVOKABLE void method_unknown(NonRegisteredType) { invoke(28); } - Q_INVOKABLE void method_overload2(QQmlV4Function *v) + Q_INVOKABLE void method_overload2(QQmlV4FunctionPtr v) { invoke(31); QV4::Scope scope(v->v4engine()); |