aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-24 17:36:04 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-24 17:36:04 +0100
commitad67ec26d0cbc98e3440dd38bb20eef4da2ee96d (patch)
tree9f8135751df2f995a4f55837ea065a4687245b71 /src/qml
parent83a16630c13969e68cd3a5aaab73335ccb0d4414 (diff)
parent20d160d0513a04be187ed851a25b029f47c27b27 (diff)
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts: .qmake.conf LICENSE.GPLv2 examples/qml/networkaccessmanagerfactory/view.qml src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4stringobject.cpp Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qv4isel_p.cpp2
-rw-r--r--src/qml/doc/qtqml.qdocconf2
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc14
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/signals.qdoc4
-rw-r--r--src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc5
-rw-r--r--src/qml/doc/src/whatsnew.qdoc1
-rw-r--r--src/qml/jit/qv4regalloc.cpp1
-rw-r--r--src/qml/jsruntime/qv4engine.cpp3
-rw-r--r--src/qml/jsruntime/qv4globalobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp2
-rw-r--r--src/qml/jsruntime/qv4stringobject.cpp2
-rw-r--r--src/qml/qml/qqmlengine.cpp4
-rw-r--r--src/qml/qml/qqmltypeloader.cpp11
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp5
-rw-r--r--src/qml/types/qqmltimer.cpp8
-rw-r--r--src/qml/types/qquickpackage.cpp2
16 files changed, 39 insertions, 29 deletions
diff --git a/src/qml/compiler/qv4isel_p.cpp b/src/qml/compiler/qv4isel_p.cpp
index 6369c8e801..54b184b4eb 100644
--- a/src/qml/compiler/qv4isel_p.cpp
+++ b/src/qml/compiler/qv4isel_p.cpp
@@ -179,7 +179,7 @@ void IRDecoder::visitMove(IR::Move *s)
} else if (Subscript *ss = c->base->asSubscript()) {
callSubscript(ss->base, ss->index, c->args, s->target);
return;
- } else if (c->base->asTemp() || c->base->asArgLocal()) {
+ } else if (c->base->asTemp() || c->base->asArgLocal() || c->base->asConst()) {
callValue(c->base, c->args, s->target);
return;
}
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf
index 7806a1103f..5729a60ea3 100644
--- a/src/qml/doc/qtqml.qdocconf
+++ b/src/qml/doc/qtqml.qdocconf
@@ -33,7 +33,7 @@ qhp.QtQml.subprojects.qmltypes.sortPages = true
tagfile = ../../../doc/qtqml/qtqml.tags
-depends += qtcore qtxmlpatterns qtgui qtquick qtdoc qtlinguist
+depends += qtcore qtxmlpatterns qtgui qtquick qtdoc qtlinguist qmake qtscript qtwidgets
headerdirs += .. \
../../imports/models
diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
index ed08d293f2..a8177d29d8 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
@@ -893,11 +893,11 @@ property in question is \c isCurrentItem, hence the attached property is
referred to as \c ListView.isCurrentItem.
An attached signal handler is referred to in the same way. For example, the
-\c Component.isCompleted attached signal handler is commonly used to execute
-some JavaScript code when a component's creation process has been completed.
-In the example below, once the \l ListModel has been fully created, its
-\c Component.onCompleted signal handler will automatically be invoked to
-populate the model:
+\l{Component::completed}{Component.onCompleted} attached signal handler is
+commonly used to execute some JavaScript code when a component's creation
+process has been completed. In the example below, once the \l ListModel has
+been fully created, its \c Component.onCompleted signal handler will
+automatically be invoked to populate the model:
\qml
import QtQuick 2.0
@@ -916,8 +916,8 @@ ListView {
\endqml
Since the name of the \e {attaching type} is \c Component and that type has a
-\c completed signal, the attached signal handler is referred to as
-\c Component.isCompleted.
+\l{Component::completed}{completed} signal, the attached signal handler is
+referred to as \c Component.onCompleted.
\section3 A Note About Accessing Attached Properties and Signal Handlers
diff --git a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
index 266cb11726..e7d75a89bc 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
@@ -144,7 +144,9 @@ Rectangle {
An \l {Attached Properties and Attached Signal Handlers}{attached signal handler} is a signal handler that receives a signal from an \e {attaching type} rather than the object within which the handler is declared.
-For example, \c \l {Component::isCompleted}{Component.isCompleted} is an attached signal handler. This handler is often used to execute some JavaScript code when its creation process has been completed, as in the example below:
+For example, \l{Component::completed}{Component.onCompleted} is an attached
+signal handler. This handler is often used to execute some JavaScript code when
+its creation process has been completed, as in the example below:
\qml
import QtQuick 2.0
diff --git a/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc b/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc
index 4f2e5b2496..780086cfc7 100644
--- a/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc
+++ b/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc
@@ -499,9 +499,6 @@ property is only invoked when the property is reassigned to a different object v
may also explicitly preserve the scarce resource by calling the
"preserve" method on the \c var property from within JavaScript.
- For more information regarding the usage of a scarce resource, please
- see \l{Scarce Resources in JavaScript}.
-
This basic type is provided by the QML language.
*/
@@ -543,8 +540,6 @@ property is only invoked when the property is reassigned to a different object v
"destroy" method on the \c variant property from within JavaScript. They
may also explicitly preserve the scarce resource by calling the
"preserve" method on the \c variant property from within JavaScript.
- For more information on the usage of a scarce resource, please
- see \l{Scarce Resources in JavaScript}.
\section1 Storing Arrays and Objects
diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc
index 42e690c48b..6abfe8c579 100644
--- a/src/qml/doc/src/whatsnew.qdoc
+++ b/src/qml/doc/src/whatsnew.qdoc
@@ -95,7 +95,6 @@ has now been replaced by the new \l {Qt QML} and \l {Qt Quick} modules. See the
\li New \l var property type. This is a general-purpose property type which obsoletes the \l variant type.
Properties of the \l var type may hold JavaScript references.
\li QML properties of type \l var and \l variant can now hold pixmaps.
- See \l {Scarce Resources in JavaScript} for more information.
\li Value type improvements:
\list
\li QML now supports defining properties of value type basic types within QML documents. Supported types include
diff --git a/src/qml/jit/qv4regalloc.cpp b/src/qml/jit/qv4regalloc.cpp
index 9b2754a344..4bc8e14fbf 100644
--- a/src/qml/jit/qv4regalloc.cpp
+++ b/src/qml/jit/qv4regalloc.cpp
@@ -34,6 +34,7 @@
#include <QtCore/QBuffer>
#include <QtCore/QDebug>
#include "qv4regalloc_p.h"
+#include "qv4alloca_p.h"
#include <private/qv4value_inl_p.h>
#include <algorithm>
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 48913f8138..1275e2a1d0 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -128,7 +128,8 @@ quintptr getStackLimit()
void* stackBottom = 0;
pthread_attr_t attr;
#if HAVE(PTHREAD_NP_H) && OS(FREEBSD)
- if (pthread_attr_get_np(pthread_self(), &attr) == 0) {
+ // on FreeBSD pthread_attr_init() must be called otherwise getting the attrs crashes
+ if (pthread_attr_init(&attr) == 0 && pthread_attr_get_np(pthread_self(), &attr) == 0) {
#else
if (pthread_getattr_np(pthread_self(), &attr) == 0) {
#endif
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp
index f575d4e47b..8e33cec57f 100644
--- a/src/qml/jsruntime/qv4globalobject.cpp
+++ b/src/qml/jsruntime/qv4globalobject.cpp
@@ -497,7 +497,7 @@ ReturnedValue GlobalFunctions::method_parseInt(CallContext *ctx)
}
if (overflow) {
- double result = (double) v_overflow * pow(R, overflow_digit_count);
+ double result = (double) v_overflow * pow(static_cast<double>(R), static_cast<double>(overflow_digit_count));
result += v;
return Encode(sign * result);
} else {
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 20707d073b..c31de6a9f0 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -1005,7 +1005,7 @@ ReturnedValue Runtime::callElement(ExecutionEngine *engine, const Value &index,
ReturnedValue Runtime::callValue(ExecutionEngine *engine, const Value &func, CallData *callData)
{
if (!func.isObject())
- return engine->throwTypeError();
+ return engine->throwTypeError(QStringLiteral("%1 is not a function").arg(func.toQStringNoThrow()));
return func.objectValue()->call(callData);
}
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp
index a589ae94c3..e0b84f6da3 100644
--- a/src/qml/jsruntime/qv4stringobject.cpp
+++ b/src/qml/jsruntime/qv4stringobject.cpp
@@ -38,7 +38,7 @@
#include "qv4objectproto_p.h"
#include "qv4mm_p.h"
#include "qv4scopedvalue_p.h"
-
+#include "qv4alloca_p.h"
#include <QtCore/QDateTime>
#include <QtCore/QDebug>
#include <QtCore/QStringList>
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 33be4c321f..916f848bbe 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -368,7 +368,7 @@ The following functions are also on the Qt object.
/*!
\qmlproperty object Qt::platform
- \since 4.8
+ \since 5.1
The \c platform object provides info about the underlying platform.
@@ -392,6 +392,8 @@ The following functions are also on the Qt object.
\li \c "unix" - Other Unix-based OS
\li \c "windows" - Windows
\li \c "wince" - Windows CE
+ \li \c "winrt" - Windows RT
+ \li \c "winphone" - Windows Phone
\endlist
\endtable
*/
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index ac4dcbdd4d..ea9b83cee3 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -885,15 +885,18 @@ Thus QQmlDataBlob::done() will always eventually be called, even if the blob has
void QQmlTypeLoader::invalidate()
{
- for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter)
- (*iter)->release();
- m_networkReplies.clear();
-
if (m_thread) {
shutdownThread();
delete m_thread;
m_thread = 0;
}
+
+ // Need to delete the network replies after
+ // the loader thread is shutdown as it could be
+ // getting new replies while we clear them
+ for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter)
+ (*iter)->release();
+ m_networkReplies.clear();
}
void QQmlTypeLoader::lock()
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 9bd3b474b2..b38190336e 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -1358,6 +1358,11 @@ void QQmlDelegateModel::_q_itemsRemoved(int index, int count)
const QList<QQmlDelegateModelItem *> cache = d->m_cache;
for (int i = 0, c = cache.count(); i < c; ++i) {
QQmlDelegateModelItem *item = cache.at(i);
+ // layout change triggered by removal of a previous item might have
+ // already invalidated this item in d->m_cache and deleted it
+ if (!d->m_cache.contains(item))
+ continue;
+
if (item->modelIndex() >= index + count)
item->setModelIndex(item->modelIndex() - count);
else if (item->modelIndex() >= index)
diff --git a/src/qml/types/qqmltimer.cpp b/src/qml/types/qqmltimer.cpp
index 879970b962..fb500426f3 100644
--- a/src/qml/types/qqmltimer.cpp
+++ b/src/qml/types/qqmltimer.cpp
@@ -329,7 +329,11 @@ bool QQmlTimer::event(QEvent *e)
ticked();
return true;
} else if (e->type() == QEvent_Triggered) {
- emit triggered();
+ if (d->running && d->pause.isStopped()) {
+ d->running = false;
+ emit triggered();
+ emit runningChanged();
+ }
return true;
}
return QObject::event(e);
@@ -340,10 +344,8 @@ void QQmlTimerPrivate::animationFinished(QAbstractAnimationJob *)
Q_Q(QQmlTimer);
if (repeating || !running)
return;
- running = false;
firstTick = false;
QCoreApplication::postEvent(q, new QEvent(QEvent_Triggered));
- emit q->runningChanged();
}
QT_END_NAMESPACE
diff --git a/src/qml/types/qquickpackage.cpp b/src/qml/types/qquickpackage.cpp
index 49bab67f3d..5fe73ec0e0 100644
--- a/src/qml/types/qquickpackage.cpp
+++ b/src/qml/types/qquickpackage.cpp
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
\snippet package/Delegate.qml 0
These named items are used as the delegates by the two views who
- reference the special \l{VisualDataModel::parts} property to select
+ reference the special \l{DelegateModel::parts} property to select
a model which provides the chosen delegate.
\snippet package/view.qml 0