aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-14 01:00:08 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-14 01:00:09 +0100
commite6199a8357cb9a97a3de0e86af387ddbe15a18ea (patch)
treec33fdae61742736ad47a33ddc2458aed07d53b1b /src
parent57604562db870f7b05d4349761d73e054dbe04c6 (diff)
parent68d0377736a541fa29d1aaba6b7aa4a4cf8781ef (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qqmlirbuilder_p.h1
-rw-r--r--src/qml/compiler/qv4codegen.cpp2
-rw-r--r--src/qml/compiler/qv4codegen_p.h4
-rw-r--r--src/qml/qml/qqmlapplicationengine.cpp6
-rw-r--r--src/qmltest/quicktest.cpp6
-rw-r--r--src/quick/items/qquicklistview.cpp5
6 files changed, 19 insertions, 5 deletions
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h
index 5dd4d1800f..fd607aee8d 100644
--- a/src/qml/compiler/qqmlirbuilder_p.h
+++ b/src/qml/compiler/qqmlirbuilder_p.h
@@ -559,6 +559,7 @@ struct Q_QML_PRIVATE_EXPORT JSCodeGen : public QV4::Compiler::Codegen
protected:
void beginFunctionBodyHook() override;
+ bool canAccelerateGlobalLookups() const override { return !_disableAcceleratedLookups; }
Reference fallbackNameLookup(const QString &name) override;
private:
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index a0a2a17b0f..17869bcc84 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -2404,7 +2404,7 @@ Codegen::Reference Codegen::referenceForName(const QString &name, bool isLhs, co
Reference r = Reference::fromName(this, name);
r.global = useFastLookups && (resolved.type == Context::ResolvedName::Global);
- if (!r.global && m_globalNames.contains(name))
+ if (!r.global && canAccelerateGlobalLookups() && m_globalNames.contains(name))
r.global = true;
return r;
}
diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h
index 3f96afc7c2..4d7001fe64 100644
--- a/src/qml/compiler/qv4codegen_p.h
+++ b/src/qml/compiler/qv4codegen_p.h
@@ -561,8 +561,10 @@ protected:
Reference referenceForPropertyName(const Codegen::Reference &object, AST::PropertyName *name);
- // Hook provided to implement QML lookup semantics
+ // Hooks provided to implement QML lookup semantics
+ virtual bool canAccelerateGlobalLookups() const { return true; }
virtual Reference fallbackNameLookup(const QString &name);
+
virtual void beginFunctionBodyHook() {}
void emitReturn(const Reference &expr);
diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp
index 9ac2100eab..c519429d48 100644
--- a/src/qml/qml/qqmlapplicationengine.cpp
+++ b/src/qml/qml/qqmlapplicationengine.cpp
@@ -70,8 +70,10 @@ void QQmlApplicationEnginePrivate::cleanUp()
void QQmlApplicationEnginePrivate::init()
{
Q_Q(QQmlApplicationEngine);
- q->connect(q, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
- q->connect(q, &QQmlApplicationEngine::exit, QCoreApplication::instance(), &QCoreApplication::exit);
+ q->connect(q, &QQmlApplicationEngine::quit, QCoreApplication::instance(),
+ &QCoreApplication::quit, Qt::QueuedConnection);
+ q->connect(q, &QQmlApplicationEngine::exit, QCoreApplication::instance(),
+ &QCoreApplication::exit, Qt::QueuedConnection);
#if QT_CONFIG(translation)
QTranslator* qtTranslator = new QTranslator;
if (qtTranslator->load(QLocale(), QLatin1String("qt"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index 56180f2dc5..9a73726797 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -61,6 +61,7 @@
#include <QtCore/qdebug.h>
#include <QtCore/qeventloop.h>
#include <QtCore/qtextstream.h>
+#include <QtCore/qtimer.h>
#include <QtGui/qtextdocument.h>
#include <stdio.h>
#include <QtGui/QGuiApplication>
@@ -646,7 +647,10 @@ int quick_test_main_with_setup(int argc, char **argv, const char *name, const ch
<< "Test '" << QDir::toNativeSeparators(path) << "' window not active after requestActivate().";
}
if (view.isExposed()) {
- QTestRootObject::instance()->setWindowShown(true);
+ // Defer property update until event loop has started
+ QTimer::singleShot(0, []() {
+ QTestRootObject::instance()->setWindowShown(true);
+ });
} else {
qWarning().nospace()
<< "Test '" << QDir::toNativeSeparators(path) << "' window was never exposed! "
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index 2a59e50304..81d019a26d 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -2460,6 +2460,11 @@ QString QQuickListView::currentSection() const
if both the velocity and duration are set, the animation will use
whichever gives the shorter duration.
+ The move velocity and duration properties are used to control movement due
+ to index changes; for example, when incrementCurrentIndex() is called. When
+ the user flicks a ListView, the velocity from the flick is used to control
+ the movement instead.
+
To set only one property, the other can be set to \c -1. For example,
if you only want to animate the duration and not velocity, use the
following code: