5#include <private/qqmlengine_p.h>
6#include <private/qqmljavascriptexpression_p.h>
7#include <private/qv4value_p.h>
8#include <private/qv4jscall_p.h>
9#include <private/qv4qobjectwrapper_p.h>
10#include <private/qv4qmlcontext_p.h>
23 (!m_objectGuard.
isNull() &&
33 const int argCount =
array ?
array->getLength() : 0;
37 for (
int i = 0;
i < argCount;
i++) {
38 jsCallData.args[
i] =
array->get(
i);
41 callback->call(jsCallData);
43 if (scope.hasException()) {
45 error.setDescription(
error.description() +
QLatin1String(
" (exception occurred during delayed function evaluation)"));
70 m_tickedMethod =
metaObject.method(methodIndex);
91 if (functionData.second != -1) {
93 iter = self->m_delayedFunctionCalls.
begin();
94 while (
iter != self->m_delayedFunctionCalls.
end()) {
95 DelayedFunctionCall& dfc = *
iter;
97 if (storedFunctionData == functionData) {
104 iter = self->m_delayedFunctionCalls.
begin();
105 while (
iter != self->m_delayedFunctionCalls.
end()) {
106 DelayedFunctionCall& dfc = *
iter;
107 if (firstArgument->asReturnedValue() == dfc.m_function.value()) {
114 const bool functionAlreadyStored = (
iter != self->m_delayedFunctionCalls.
end());
115 if (functionAlreadyStored) {
116 DelayedFunctionCall dfc = *
iter;
117 self->m_delayedFunctionCalls.
erase(
iter);
118 self->m_delayedFunctionCalls.
append(dfc);
123 DelayedFunctionCall& dfc = self->m_delayedFunctionCalls.
last();
124 if (dfc.m_objectGuard.isNull()) {
125 if (functionData.second != -1) {
127 dfc.m_objectGuard = QQmlGuard<QObject>(functionData.first);
128 dfc.m_guarded =
true;
130 js && js->scope()->type == QV4::Heap::ExecutionContext::Type_QmlContext) {
131 QV4::QmlContext::Data *
g =
static_cast<QV4::QmlContext::Data *
>(js->scope());
133 dfc.m_objectGuard = QQmlGuard<QObject>(
g->qml()->scopeObject);
134 dfc.m_guarded =
true;
137 self->storeAnyArguments(dfc,
args, 1,
engine);
139 if (!self->m_callbackOutstanding) {
141 self->m_callbackOutstanding =
true;
161void QQmlDelayedCallQueue::executeAllExpired_Later()
165 QVector<DelayedFunctionCall> delayedCalls = m_delayedFunctionCalls;
166 m_delayedFunctionCalls.clear();
169 while (
iter != delayedCalls.end()) {
170 DelayedFunctionCall& dfc = *
iter;
171 dfc.execute(m_engine);
178 m_callbackOutstanding =
false;
179 executeAllExpired_Later();
184#include "moc_qqmldelayedcallqueue_p.cpp"
qsizetype length() const noexcept
static bool wasDeleted(const QObject *)
static QQmlData * get(QObjectPrivate *priv, bool create)
static QV4::ReturnedValue addUniquelyAndExecuteLater(QV4::ExecutionEngine *engine, QQmlV4FunctionPtr args)
~QQmlDelayedCallQueue() override
void init(QV4::ExecutionEngine *)
void warning(const QQmlError &)
static QQmlEnginePrivate * get(QQmlEngine *e)
The QQmlError class encapsulates a QML error.
bool isNull() const noexcept
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first character in the string.
iterator end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing just after the last character in the ...
QString & append(QChar c)
QString last(qsizetype n) const &
iterator erase(const_iterator first, const_iterator last)
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter * iter
DBusConnection const char DBusError * error
GLenum GLuint GLenum GLsizei length
GLenum GLuint GLintptr offset
#define THROW_GENERIC_ERROR(str)
obj metaObject() -> className()
static constexpr ReturnedValue undefined()
static QPair< QObject *, int > extractQtMethod(const QV4::FunctionObject *function)