aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2019-01-08 08:18:11 +0200
committerKari Oikarinen <kari.oikarinen@qt.io>2019-01-08 08:18:11 +0200
commitc2c012f79438d207cc95237c90b692121acc4876 (patch)
tree39064e5a58161a7edb4e0c63f2d43e386d1f4059
parent5208b2a671010b11b78312f9c4fe3c3098d253b4 (diff)
parent5ed082ea4ce3580134a9a0c83e6fdb81a6231c8e (diff)
Merge 5.12 into 5.12.1
-rw-r--r--.qmake.conf2
-rw-r--r--dist/changes-5.11.358
-rw-r--r--src/3rdparty/masm/yarr/YarrJIT.cpp2
-rw-r--r--src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.cpp17
-rw-r--r--src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.h1
-rw-r--r--src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp3
-rw-r--r--src/qml/compiler/qqmlirbuilder.cpp10
-rw-r--r--src/qml/compiler/qqmlirbuilder_p.h1
-rw-r--r--src/qml/compiler/qv4codegen.cpp70
-rw-r--r--src/qml/compiler/qv4codegen_p.h6
-rw-r--r--src/qml/compiler/qv4compileddata.cpp4
-rw-r--r--src/qml/doc/qtqml.qdocconf2
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/signals.qdoc4
-rw-r--r--src/qml/jsruntime/qv4alloca_p.h2
-rw-r--r--src/qml/jsruntime/qv4jsonobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4script.cpp1
-rw-r--r--src/qml/parser/qqmljslexer.cpp2
-rw-r--r--src/qml/qml/qqmlcontext.cpp17
-rw-r--r--src/qml/qml/qqmlcontext_p.h2
-rw-r--r--src/qml/qml/qqmlengine.cpp6
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp12
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp2
-rw-r--r--src/qmltest/doc/src/qtquicktest-index.qdoc3
-rw-r--r--src/quick/doc/qtquick.qdocconf2
-rw-r--r--src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc4
-rw-r--r--src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc2
-rw-r--r--src/quick/doc/src/examples.qdoc2
-rw-r--r--src/quick/doc/src/guidelines/qtquick-toolsnutilities.qdoc1
-rw-r--r--src/quick/doc/src/qmltypereference.qdoc2
-rw-r--r--src/quick/handlers/qquickdraghandler.cpp2
-rw-r--r--src/quick/handlers/qquickhandlerpoint.cpp2
-rw-r--r--src/quick/handlers/qquickmultipointhandler.cpp2
-rw-r--r--src/quick/handlers/qquickpointhandler.cpp2
-rw-r--r--src/quick/handlers/qquicktaphandler.cpp4
-rw-r--r--src/quick/items/qquicklistview.cpp13
-rw-r--r--src/quick/items/qquicktext.cpp2
-rw-r--r--src/quick/items/qquickwindow.cpp9
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp7
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp3
-rw-r--r--src/quick/util/qquickpixmapcache.cpp10
-rw-r--r--src/quick/util/qquickstyledtext.cpp22
-rw-r--r--tests/auto/qml/animation/qsequentialanimationgroupjob/BLACKLIST2
-rw-r--r--tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp91
-rw-r--r--tests/auto/qml/qqmlcontext/data/Drawer.qml6
-rw-r--r--tests/auto/qml/qqmlcontext/data/contextObjectHierarchy.qml6
-rw-r--r--tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp19
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp12
-rw-r--r--tests/auto/quick/pointerhandlers/qquicktaphandler/data/rightTapHandler.qml41
-rw-r--r--tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp39
-rw-r--r--tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp4
-rw-r--r--tests/auto/quick/qquickshape/tst_qquickshape.cpp20
-rw-r--r--tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp8
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp42
-rw-r--r--tests/auto/quick/scenegraph/tst_scenegraph.cpp10
-rw-r--r--tests/auto/quick/shared/visualtestutil.cpp30
-rw-r--r--tests/auto/quick/shared/visualtestutil.h2
-rw-r--r--tests/auto/quick/touchmouse/BLACKLIST3
-rw-r--r--tests/auto/quickwidgets/qquickwidget/BLACKLIST2
-rw-r--r--tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp28
-rw-r--r--tools/qmlscene/main.cpp6
-rw-r--r--tools/tools.pro2
61 files changed, 501 insertions, 192 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 81caa27c53..34660b3c4d 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,4 +1,4 @@
load(qt_build_config)
CONFIG += warning_clean
-MODULE_VERSION = 5.12.0
+MODULE_VERSION = 5.12.1
diff --git a/dist/changes-5.11.3 b/dist/changes-5.11.3
new file mode 100644
index 0000000000..8701cdeed4
--- /dev/null
+++ b/dist/changes-5.11.3
@@ -0,0 +1,58 @@
+Qt 5.11.3 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.11.0 through 5.11.2.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.11 series is binary compatible with the 5.10.x series.
+Applications compiled for 5.10 will continue to run with 5.11.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Qt 5.11.3 Changes *
+****************************************************************************
+
+****************************************************************************
+* QtQml *
+****************************************************************************
+
+ - [QTBUG-69973] Fixed QML comma operator property lookup failure.
+ - [QTBUG-70350] Fixed allocation of multi-page executable memory for
+ INTEGRITY.
+ - [QTBUG-69996] Fixed undefined behavior in MASM on 64bit architectures.
+ - [QTBUG-70460] Fixed deadlock in qmlplugindump.
+
+****************************************************************************
+* QtQuick *
+****************************************************************************
+
+ - Accessibility: The StaticText role for Text items is now only used if
+ there is no explicit role set.
+ - Scene Graph: Fixed Leaking of resources in the OpenVG backend.
+ - [QTBUG-69290] Fixed leaking of textures and animation resources in
+ software backend.
+ - [QTBUG-58924] Added a warning message for the case of too many tiles in
+ a BorderImage.
+ - [QTBUG-70898] Fixed a crash on nested delivery of mouse or touch presses.
+ - [QTBUG-64402] Fixed a crash in QQuickAnimatorProxyJob.
+ - [QTBUG-69059][QTBUG-61144] Fixed confusion about mouse grabbing when
+ delivering pointer events to a QQuickWindow.
+ - [QTBUG-59620] Prevented PathView's parent from stealing mouse grabs
+ during double-flick.
+
+****************************************************************************
+* Building *
+****************************************************************************
+
+ - [QTBUG-70414] Disabled building of XmlListModel if the "qml-network"
+ feature is unavailable.
+ - Enabled building without the "filesystemwatcher" feature.
diff --git a/src/3rdparty/masm/yarr/YarrJIT.cpp b/src/3rdparty/masm/yarr/YarrJIT.cpp
index 9a9ab581e8..0655bb0a70 100644
--- a/src/3rdparty/masm/yarr/YarrJIT.cpp
+++ b/src/3rdparty/masm/yarr/YarrJIT.cpp
@@ -640,7 +640,7 @@ class YarrGenerator : private DefaultMacroAssembler {
subPtr(Imm32(callFrameSizeInBytes), stackPointerRegister);
if (callFrameSizeInBytes <= 128) {
for (unsigned offset = 0; offset < callFrameSizeInBytes; offset += sizeof(intptr_t))
- storePtr(TrustedImmPtr(0), Address(regT0, -8 - offset));
+ storePtr(TrustedImmPtr(0), Address(regT0, -8 - int(offset)));
} else {
Label zeroLoop = label();
subPtr(TrustedImm32(sizeof(intptr_t) * 2), regT0);
diff --git a/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.cpp b/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.cpp
index e45b79706b..b5f6b39c60 100644
--- a/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.cpp
+++ b/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.cpp
@@ -174,7 +174,7 @@ void QSGOpenVGRectangleNode::render()
}
-QSGOpenVGImageNode::QSGOpenVGImageNode()
+QSGOpenVGImageNode::QSGOpenVGImageNode() : m_texture(nullptr), m_owns(false)
{
// Set Dummy material and geometry to avoid asserts
setMaterial((QSGMaterial*)1);
@@ -184,9 +184,8 @@ QSGOpenVGImageNode::QSGOpenVGImageNode()
QSGOpenVGImageNode::~QSGOpenVGImageNode()
{
- if (m_owns) {
- m_texture->deleteLater();
- }
+ if (m_owns)
+ delete m_texture;
}
void QSGOpenVGImageNode::setRect(const QRectF &rect)
@@ -212,6 +211,8 @@ QRectF QSGOpenVGImageNode::sourceRect() const
void QSGOpenVGImageNode::setTexture(QSGTexture *texture)
{
+ if (m_owns)
+ delete m_texture;
m_texture = texture;
markDirty(DirtyMaterial);
}
@@ -321,7 +322,7 @@ void QSGOpenVGImageNode::render()
}
-QSGOpenVGNinePatchNode::QSGOpenVGNinePatchNode()
+QSGOpenVGNinePatchNode::QSGOpenVGNinePatchNode() : m_texture(nullptr)
{
// Set Dummy material and geometry to avoid asserts
setMaterial((QSGMaterial*)1);
@@ -329,8 +330,14 @@ QSGOpenVGNinePatchNode::QSGOpenVGNinePatchNode()
}
+QSGOpenVGNinePatchNode::~QSGOpenVGNinePatchNode()
+{
+ delete m_texture;
+}
+
void QSGOpenVGNinePatchNode::setTexture(QSGTexture *texture)
{
+ delete m_texture;
m_texture = texture;
markDirty(DirtyMaterial);
}
diff --git a/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.h b/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.h
index 8e12c27824..e1cd3063a1 100644
--- a/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.h
+++ b/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.h
@@ -118,6 +118,7 @@ class QSGOpenVGNinePatchNode : public QSGNinePatchNode, public QSGOpenVGRenderab
{
public:
QSGOpenVGNinePatchNode();
+ ~QSGOpenVGNinePatchNode();
void setTexture(QSGTexture *texture) override;
void setBounds(const QRectF &bounds) override;
diff --git a/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp b/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp
index 9493920100..c41dfd7400 100644
--- a/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp
+++ b/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp
@@ -43,6 +43,7 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QElapsedTimer>
+#include <private/qquickanimatorcontroller_p.h>
#include <private/qquickwindow_p.h>
#include <private/qquickprofiler_p.h>
@@ -94,6 +95,8 @@ void QSGOpenVGRenderLoop::windowDestroyed(QQuickWindow *window)
} else if (vg && window == vg->window()) {
vg->doneCurrent();
}
+
+ delete d->animationController;
}
void QSGOpenVGRenderLoop::exposureChanged(QQuickWindow *window)
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp
index 9021fd0284..2421e8c1ea 100644
--- a/src/qml/compiler/qqmlirbuilder.cpp
+++ b/src/qml/compiler/qqmlirbuilder.cpp
@@ -1835,8 +1835,9 @@ JSCodeGen::JSCodeGen(const QString &sourceCode, QV4::Compiler::JSUnitGenerator *
, _scopeObject(nullptr)
, _qmlContextSlot(-1)
, _importedScriptsSlot(-1)
- , m_globalNames(globalNames)
{
+ m_globalNames = globalNames;
+
_module = jsModule;
_fileNameIsUrl = true;
}
@@ -2306,15 +2307,10 @@ QV4::Compiler::Codegen::Reference JSCodeGen::fallbackNameLookup(const QString &n
return Reference::fromQmlContextObject(base, data->coreIndex(), data->notifyIndex(), capturePolicy);
}
}
-
- Reference r = Reference::fromName(this, name);
- if (m_globalNames.contains(name))
- r.global = true;
- return r;
#else
Q_UNUSED(name)
- return Reference();
#endif // V4_BOOTSTRAP
+ return Reference();
}
#ifndef V4_BOOTSTRAP
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h
index d1e2b17bb7..3dde929cc4 100644
--- a/src/qml/compiler/qqmlirbuilder_p.h
+++ b/src/qml/compiler/qqmlirbuilder_p.h
@@ -640,7 +640,6 @@ private:
QQmlPropertyCache *_scopeObject;
int _qmlContextSlot;
int _importedScriptsSlot;
- QSet<QString> m_globalNames;
};
struct Q_QML_PRIVATE_EXPORT IRLoader {
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 8ec730a33d..f570af4819 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -102,6 +102,62 @@ Codegen::Codegen(QV4::Compiler::JSUnitGenerator *jsUnitGenerator, bool strict)
jsUnitGenerator->codeGeneratorName = QStringLiteral("moth");
}
+const char *globalNames[] = {
+ "isNaN",
+ "parseFloat",
+ "String",
+ "EvalError",
+ "URIError",
+ "Math",
+ "encodeURIComponent",
+ "RangeError",
+ "eval",
+ "isFinite",
+ "ReferenceError",
+ "Infinity",
+ "Function",
+ "RegExp",
+ "Number",
+ "parseInt",
+ "Object",
+ "decodeURI",
+ "TypeError",
+ "Boolean",
+ "encodeURI",
+ "NaN",
+ "Error",
+ "decodeURIComponent",
+ "Date",
+ "Array",
+ "Symbol",
+ "escape",
+ "unescape",
+ "SyntaxError",
+ "undefined",
+ "JSON",
+ "ArrayBuffer",
+ "SharedArrayBuffer",
+ "DataView",
+ "Int8Array",
+ "Uint8Array",
+ "Uint8ClampedArray",
+ "Int16Array",
+ "Uint16Array",
+ "Int32Array",
+ "Uint32Array",
+ "Float32Array",
+ "Float64Array",
+ "WeakSet",
+ "Set",
+ "WeakMap",
+ "Map",
+ "Reflect",
+ "Proxy",
+ "Atomics",
+ "Promise",
+ nullptr
+};
+
void Codegen::generateFromProgram(const QString &fileName,
const QString &finalUrl,
const QString &sourceCode,
@@ -118,6 +174,18 @@ void Codegen::generateFromProgram(const QString &fileName,
_module->fileName = fileName;
_module->finalUrl = finalUrl;
+ if (contextType == ContextType::ScriptImportedByQML) {
+ // the global object is frozen, so we know that members of it are
+ // pointing to the global object. This is important so that references
+ // to Math etc. do not go through the expensive path in the context wrapper
+ // that tries to see whether we have a matching type
+ //
+ // Since this can be called from the loader thread we can't get the list
+ // directly from the engine, so let's hardcode the most important ones here
+ for (const char **g = globalNames; *g != nullptr; ++g)
+ m_globalNames << QString::fromLatin1(*g);
+ }
+
ScanFunctions scan(this, sourceCode, contextType);
scan(node);
@@ -2336,6 +2404,8 @@ 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))
+ r.global = true;
return r;
}
diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h
index 289728f505..3f96afc7c2 100644
--- a/src/qml/compiler/qv4codegen_p.h
+++ b/src/qml/compiler/qv4codegen_p.h
@@ -708,6 +708,11 @@ public:
return *_returnLabel;
}
+ void setGlobalNames(const QSet<QString>& globalNames) {
+ m_globalNames = globalNames;
+ }
+
+
protected:
friend class ScanFunctions;
friend struct ControlFlow;
@@ -730,6 +735,7 @@ protected:
bool inFormalParameterList = false;
bool functionEndsWithReturn = false;
bool _tailCallsAreAllowed = true;
+ QSet<QString> m_globalNames;
ControlFlow *controlFlow = nullptr;
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index b8497937c1..e68a563a45 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -201,8 +201,8 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
// first locals
const quint32_le *localsIndices = compiledBlock->localsTable();
- for (quint32 i = 0; i < compiledBlock->nLocals; ++i)
- ic = ic->addMember(engine->identifierTable->asPropertyKey(runtimeStrings[localsIndices[i]]), Attr_NotConfigurable);
+ for (quint32 j = 0; j < compiledBlock->nLocals; ++j)
+ ic = ic->addMember(engine->identifierTable->asPropertyKey(runtimeStrings[localsIndices[j]]), Attr_NotConfigurable);
runtimeBlocks[i] = ic->d();
}
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf
index 40acc7c13f..ba4155c08b 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 qtgui qtquick qtdoc qtlinguist qmake qtscript qtwidgets
+depends += qtcore qtgui qtquick qtdoc qtlinguist qmake qtscript qtwidgets qtxmlpatterns qtquickcontrols
headerdirs += .. \
../../imports/models
diff --git a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
index f0ad2b7767..b643f18154 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
@@ -52,8 +52,8 @@ object, the object definition should declare a signal handler named
letter capitalized. The signal handler should contain the JavaScript code to be
executed when the signal handler is invoked.
-For example, the \l [QtQuick.Controls2]{Button} type from the
-\l{Qt Quick Controls 2}{Qt Quick Controls} module has a \c clicked signal, which
+For example, the \l [QtQuickControls]{Button} type from the
+\l{Qt Quick Controls} module has a \c clicked signal, which
is emitted whenever the button is clicked. In this case, the signal handler for
receiving this signal should be \c onClicked. In the example below, whenever
the button is clicked, the \c onClicked handler is invoked, applying a random
diff --git a/src/qml/jsruntime/qv4alloca_p.h b/src/qml/jsruntime/qv4alloca_p.h
index 1e9f83a90e..65c3e4d65a 100644
--- a/src/qml/jsruntime/qv4alloca_p.h
+++ b/src/qml/jsruntime/qv4alloca_p.h
@@ -89,7 +89,7 @@ public:
Qt_AllocaWrapper() { m_data = 0; }
~Qt_AllocaWrapper() { free(m_data); }
void *data() { return m_data; }
- void allocate(int size) { m_data = malloc(size); }
+ void allocate(int size) { m_data = malloc(size); memset(m_data, 0, size); }
private:
void *m_data;
};
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp
index 0c5436a0d6..936c032fad 100644
--- a/src/qml/jsruntime/qv4jsonobject.cpp
+++ b/src/qml/jsruntime/qv4jsonobject.cpp
@@ -739,7 +739,7 @@ QString Stringify::Str(const QString &key, const Value &v)
}
if (const QV4::VariantObject *v = value->as<QV4::VariantObject>()) {
- return v->d()->data().toString();
+ return quote(v->d()->data().toString());
}
o = value->asReturnedValue();
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index f80db86be5..7bbef3335e 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -241,6 +241,7 @@ Script *Script::createFromFileOrCache(ExecutionEngine *engine, QmlContext *qmlCo
QmlIR::Document::removeScriptPragmas(sourceCode);
auto result = new QV4::Script(engine, qmlContext, /*parseAsBinding*/false, sourceCode, originalUrl.toString());
+ result->contextType = QV4::Compiler::ContextType::ScriptImportedByQML;
result->parse();
return result;
}
diff --git a/src/qml/parser/qqmljslexer.cpp b/src/qml/parser/qqmljslexer.cpp
index e5b8894fb1..c53b13f64d 100644
--- a/src/qml/parser/qqmljslexer.cpp
+++ b/src/qml/parser/qqmljslexer.cpp
@@ -884,7 +884,7 @@ int Lexer::scanString(ScanStringMode mode)
scanChar();
while (_codePtr <= _endPtr) {
- if (_char == mode) {
+ if (_char == quote) {
scanChar();
if (_engine) {
diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp
index cbf5a6e259..3710cee162 100644
--- a/src/qml/qml/qqmlcontext.cpp
+++ b/src/qml/qml/qqmlcontext.cpp
@@ -640,7 +640,8 @@ void QQmlContextData::destroy()
QQmlData *co = contextObjects;
contextObjects = contextObjects->nextContextObject;
- co->context = nullptr;
+ if (co->context == this)
+ co->context = nullptr;
co->outerContext = nullptr;
co->nextContextObject = nullptr;
co->prevContextObject = nullptr;
@@ -783,13 +784,17 @@ void QQmlContextData::refreshExpressions()
}
}
-void QQmlContextData::addObject(QObject *o)
+void QQmlContextData::addObject(QQmlData *data)
{
- QQmlData *data = QQmlData::get(o, true);
-
- Q_ASSERT(data->context == nullptr);
+ if (data->outerContext) {
+ if (data->nextContextObject)
+ data->nextContextObject->prevContextObject = data->prevContextObject;
+ if (data->prevContextObject)
+ *data->prevContextObject = data->nextContextObject;
+ else if (data->outerContext->contextObjects == data)
+ data->outerContext->contextObjects = data->nextContextObject;
+ }
- data->context = this;
data->outerContext = this;
data->nextContextObject = contextObjects;
diff --git a/src/qml/qml/qqmlcontext_p.h b/src/qml/qml/qqmlcontext_p.h
index 290b7fc7ee..7e3cef8e1d 100644
--- a/src/qml/qml/qqmlcontext_p.h
+++ b/src/qml/qml/qqmlcontext_p.h
@@ -129,7 +129,7 @@ public:
void setParent(QQmlContextData *, bool stronglyReferencedByParent = false);
void refreshExpressions();
- void addObject(QObject *);
+ void addObject(QQmlData *data);
QUrl resolvedUrl(const QUrl &);
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index c400e9239b..6db43a50eb 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -1518,7 +1518,9 @@ void QQmlEngine::setContextForObject(QObject *object, QQmlContext *context)
}
QQmlContextData *contextData = QQmlContextData::get(context);
- contextData->addObject(object);
+ Q_ASSERT(data->context == nullptr);
+ data->context = contextData;
+ contextData->addObject(data);
}
/*!
@@ -1882,6 +1884,8 @@ void QQmlData::destroyed(QObject *object)
nextContextObject->prevContextObject = prevContextObject;
if (prevContextObject)
*prevContextObject = nextContextObject;
+ else if (outerContext && outerContext->contextObjects == this)
+ outerContext->contextObjects = nextContextObject;
QQmlAbstractBinding *binding = bindings;
while (binding) {
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index c181d791f5..68e2c2c928 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -1230,13 +1230,15 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo
QQmlContextData *c = ddata->context;
while (c->linkedContext) c = c->linkedContext;
c->linkedContext = context;
- } else
- context->addObject(instance);
+ } else {
+ ddata->context = context;
+ }
ddata->ownContext = ddata->context;
- } else if (!ddata->context)
- context->addObject(instance);
+ } else if (!ddata->context) {
+ ddata->context = context;
+ }
- ddata->outerContext = context;
+ context->addObject(ddata);
if (parserStatus) {
parserStatus->classBegin();
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 8a0d60a092..57bbf7465d 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -350,7 +350,7 @@ void QQmlDelegateModel::componentComplete()
{QAbstractItemModel} subclass or a simple list.
Models can also be created directly in QML, using a \l{ListModel} or
- \l{XmlListModel}.
+ \l{QtQuick.XmlListModel::XmlListModel}{XmlListModel}.
\sa {qml-data-models}{Data Models}
*/
diff --git a/src/qmltest/doc/src/qtquicktest-index.qdoc b/src/qmltest/doc/src/qtquicktest-index.qdoc
index 15ea33d06a..48b41d4f0a 100644
--- a/src/qmltest/doc/src/qtquicktest-index.qdoc
+++ b/src/qmltest/doc/src/qtquicktest-index.qdoc
@@ -151,17 +151,18 @@
\li Name
\li Purpose
\row
- \row
\li void applicationAvailable()
\li Called right after the QApplication object was instantiated.
Use this function to setup everything that is not related
to QML directly.
+ \row
\li void qmlEngineAvailable(QQmlEngine*)
\li Called when the QML engine is available.
Any \l {QQmlEngine::addImportPath}{import paths},
\l {QQmlEngine::addPluginPath}{plugin paths},
and \l {QQmlFileSelector::setExtraSelectors}{extra file selectors}
will have been set on the engine by this point.
+ \row
\li void cleanupTestCase()
\li Called right after the test execution has finished.
Use this function to clean up before everything will start to be destructed.
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index 94bc80bf93..b1268097fc 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -37,7 +37,7 @@ qhp.QtQuick.subprojects.examples.selectors = fake:example
tagfile = ../../../doc/qtquick/qtquick.tags
-depends += qtcore qtqml qtqmltest qtgui qtlinguist qtquickcontrols qtquickcontrols2 qtdoc qtquickdialogs qtsensors qtwidgets qmake qtmultimedia qtgraphicaleffects qtsql
+depends += qtcore qtqml qtqmltest qtgui qtlinguist qtquickcontrols1 qtquickcontrols qtdoc qtquickdialogs qtsensors qtwidgets qmake qtmultimedia qtgraphicaleffects qtsql qtxmlpatterns
headerdirs += ..\
../../quickwidgets
diff --git a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
index a849a30b4e..e4d837112f 100644
--- a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
+++ b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
@@ -331,9 +331,7 @@ signal after saving the changes.
Unlike the C++ item views such as QListView or QTableView, the \c setData()
method must be explicitly invoked from QML delegates whenever appropriate. This is done
-by simply assigning a new value to the corresponding model property. For example,
-on the \l[QML]{TextField::}{editingFinished}() or \l[QML]{TextField::}{accepted}()
-signal of \l[QtQuickControls]{TextField}.
+by simply assigning a new value to the corresponding model property.
\qml
ListView {
diff --git a/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc b/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc
index 0c6aaecf42..04dbf1cf20 100644
--- a/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc
+++ b/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc
@@ -226,7 +226,7 @@ To visualize data, bind the view's \c model property to a model and the
\section2 XML Model
XmlListModel allows construction of a model from an XML data source. The roles
- are specified via the \l XmlRole type. The type needs to be imported.
+ are specified via the \l [QML]{XmlRole} type. The type needs to be imported.
\code
import QtQuick.XmlListModel 2.0
diff --git a/src/quick/doc/src/examples.qdoc b/src/quick/doc/src/examples.qdoc
index 39fc7f27eb..77475e9812 100644
--- a/src/quick/doc/src/examples.qdoc
+++ b/src/quick/doc/src/examples.qdoc
@@ -77,9 +77,7 @@ steps such as use cases and introductory material. For more information about Qt
\b{Development Environment}
\list
\li \l{Qt Creator: Creating Qt Quick Projects}{Creating Qt Quick Projects}
- \li \l{Qt Creator: Using Qt Quick Designer}{Using Qt Quick Designer}
\li \l{Qt Creator: Creating Components}{Creating Components}
- \li \l{Qt Creator: Creating Screens}{Creating Screens}
\li \l{Qt Creator: Exporting Designs from Graphics Software}{Exporting Designs from Graphics Software}
\li \l{Qt Creator: Using QML Modules with Plugins}{Using QML Modules with Plugins}
\endlist
diff --git a/src/quick/doc/src/guidelines/qtquick-toolsnutilities.qdoc b/src/quick/doc/src/guidelines/qtquick-toolsnutilities.qdoc
index 5f00abc193..0669ec06c8 100644
--- a/src/quick/doc/src/guidelines/qtquick-toolsnutilities.qdoc
+++ b/src/quick/doc/src/guidelines/qtquick-toolsnutilities.qdoc
@@ -108,6 +108,5 @@ integrating 3rd party tools such as QmlLive and GammaRay.
\section2 Related Information
\list
\li \l{Qt Creator Manual}
-\li \l{Qt Creator: Integrating 3rd Party Tools}
\endlist
*/
diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc
index ddf90f88d9..04682c9f33 100644
--- a/src/quick/doc/src/qmltypereference.qdoc
+++ b/src/quick/doc/src/qmltypereference.qdoc
@@ -49,7 +49,7 @@ information about the concepts which are central to \c QtQuick.
Qt Quick includes several submodules which contain additional types.
\list
- \li \l{Qt Quick XmlListModel QML Types}{XML List Model} - contains types
+ \li \l{Qt Quick XmlListModel QML Types}{Xml List Model} - contains types
for creating models from XML data
\li \l{Qt Quick Local Storage QML Types}{Local Storage} - a submodule
containing a JavaScript interface for an SQLite database
diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp
index aa66c16007..48f0599284 100644
--- a/src/quick/handlers/qquickdraghandler.cpp
+++ b/src/quick/handlers/qquickdraghandler.cpp
@@ -82,7 +82,7 @@ Q_LOGGING_CATEGORY(lcDragHandler, "qt.quick.handler.drag")
and thus can be used to adjust some other feature independently of the
usual pinch behavior: for example adjust a tilt transformation, or adjust
some other numeric value, if the \c target is set to null. But if the
- \l target is an Item, \l centroid is the point at which the drag begins and
+ \c target is an Item, \c centroid is the point at which the drag begins and
to which the \c target will be moved (subject to constraints).
At this time, drag-and-drop is not yet supported.
diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp
index 6a106b5464..de21537f27 100644
--- a/src/quick/handlers/qquickhandlerpoint.cpp
+++ b/src/quick/handlers/qquickhandlerpoint.cpp
@@ -282,8 +282,6 @@ void QQuickHandlerPoint::reset(const QVector<QQuickHandlerPoint> &points)
This property holds the keyboard modifiers that were pressed at the time
the event occurred.
-
- \sa MouseArea::modifiers
*/
/*!
diff --git a/src/quick/handlers/qquickmultipointhandler.cpp b/src/quick/handlers/qquickmultipointhandler.cpp
index 2f4e9d45e9..228c99bb12 100644
--- a/src/quick/handlers/qquickmultipointhandler.cpp
+++ b/src/quick/handlers/qquickmultipointhandler.cpp
@@ -309,6 +309,8 @@ void QQuickMultiPointHandler::acceptPoints(const QVector<QQuickEventPoint *> &po
bool QQuickMultiPointHandler::grabPoints(QVector<QQuickEventPoint *> points)
{
+ if (points.isEmpty())
+ return false;
bool allowed = true;
for (QQuickEventPoint* point : points) {
if (point->exclusiveGrabber() != this && !canGrab(point)) {
diff --git a/src/quick/handlers/qquickpointhandler.cpp b/src/quick/handlers/qquickpointhandler.cpp
index 3bc1c06a1a..6d6ba07f5c 100644
--- a/src/quick/handlers/qquickpointhandler.cpp
+++ b/src/quick/handlers/qquickpointhandler.cpp
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
occurs within the bounds of the \l {PointerHandler::parent}, and
no sibling PointHandler within the same \l {PointerHandler::parent}
has yet acquired a passive grab on that point, and if the other
- constraints such as \l {SinglePointHandler::acceptedButtons},
+ constraints such as \l[QML]{SinglePointHandler::acceptedButtons},
\l {PointerDeviceHandler::acceptedDevices} etc. are satisfied, it's
eligible, and the PointHandler then acquires a passive grab. In
this way, the \l {PointerHandler::parent} acts like an exclusive
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp
index bae76ddd94..f24b2bfd7e 100644
--- a/src/quick/handlers/qquicktaphandler.cpp
+++ b/src/quick/handlers/qquicktaphandler.cpp
@@ -107,6 +107,10 @@ static bool dragOverThreshold(const QQuickEventPoint *point)
bool QQuickTapHandler::wantsEventPoint(QQuickEventPoint *point)
{
+ if (!point->pointerEvent()->asPointerMouseEvent() &&
+ !point->pointerEvent()->asPointerTouchEvent() &&
+ !point->pointerEvent()->asPointerTabletEvent() )
+ return false;
// If the user has not violated any constraint, it could be a tap.
// Otherwise we want to give up the grab so that a competing handler
// (e.g. DragHandler) gets a chance to take over.
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index 908801ce1c..62cbfcef2b 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -2456,7 +2456,18 @@ QString QQuickListView::currentSection() const
The default value for the duration properties is -1, i.e. the
highlight will take as much time as necessary to move at the set speed.
- These properties have the same characteristics as a SmoothedAnimation.
+ These properties have the same characteristics as a SmoothedAnimation:
+ if both the velocity and duration are set, the animation will use
+ whichever gives the shorter duration.
+
+ 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:
+
+ \code
+ highlightMoveDuration: 1000
+ highlightMoveVelocity: -1
+ \endcode
\sa highlightFollowsCurrentItem
*/
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 4d4540bc36..dd7fbccff5 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -2082,6 +2082,8 @@ void QQuickText::resetMaximumLineCount()
\code
<b></b> - bold
+ <del></del> - strike out (removed content)
+ <s></s> - strike out (no longer accurate or no longer relevant content)
<strong></strong> - bold
<i></i> - italic
<br> - new line
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 83a1268d1d..dd5960e925 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -2246,13 +2246,14 @@ QQuickPointerEvent *QQuickWindowPrivate::queryPointerEventInstance(QQuickPointer
{
// Search for a matching reusable event object.
for (QQuickPointerEvent *e : pointerEventInstances) {
- // If device can generate native gestures (e.g. a trackpad), there might be two QQuickPointerEvents:
- // QQuickPointerNativeGestureEvent and QQuickPointerTouchEvent. Use eventType to disambiguate.
+ // If device can generate native gestures (e.g. a trackpad), there might be multiple QQuickPointerEvents:
+ // QQuickPointerNativeGestureEvent, QQuickPointerScrollEvent, and QQuickPointerTouchEvent.
+ // Use eventType to disambiguate.
#if QT_CONFIG(gestures)
- if (eventType == QEvent::NativeGesture && !qobject_cast<QQuickPointerNativeGestureEvent*>(e))
+ if ((eventType == QEvent::NativeGesture) != bool(e->asPointerNativeGestureEvent()))
continue;
#endif
- if (eventType == QEvent::Wheel && !qobject_cast<QQuickPointerScrollEvent*>(e))
+ if ((eventType == QEvent::Wheel) != bool(e->asPointerScrollEvent()))
continue;
// Otherwise we assume there's only one event type per device.
// More disambiguation tests might need to be added above if that changes later.
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp
index bd0698be6c..20286a03d5 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp
@@ -156,10 +156,11 @@ void QSGSoftwareNinePatchNode::setTexture(QSGTexture *texture)
QSGSoftwarePixmapTexture *pt = qobject_cast<QSGSoftwarePixmapTexture*>(texture);
if (!pt) {
qWarning() << "Image used with invalid texture format.";
- return;
+ } else {
+ m_pixmap = pt->pixmap();
+ markDirty(DirtyMaterial);
}
- m_pixmap = pt->pixmap();
- markDirty(DirtyMaterial);
+ delete texture;
}
void QSGSoftwareNinePatchNode::setBounds(const QRectF &bounds)
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
index b400473128..f5a41410ee 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
@@ -45,6 +45,7 @@
#include <private/qquickwindow_p.h>
#include <QElapsedTimer>
+#include <private/qquickanimatorcontroller_p.h>
#include <private/qquickprofiler_p.h>
#include <private/qsgsoftwarerenderer_p.h>
#include <qpa/qplatformbackingstore.h>
@@ -98,6 +99,8 @@ void QSGSoftwareRenderLoop::windowDestroyed(QQuickWindow *window)
if (m_windows.size() == 0) {
rc->invalidate();
}
+
+ delete d->animationController;
}
void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window, bool isNewExpose)
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 0dd2a88ca1..dc8bed8125 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -471,6 +471,10 @@ QQuickPixmapReader::QQuickPixmapReader(QQmlEngine *eng)
eventLoopQuitHack->moveToThread(this);
connect(eventLoopQuitHack, SIGNAL(destroyed(QObject*)), SLOT(quit()), Qt::DirectConnection);
start(QThread::LowestPriority);
+#if !QT_CONFIG(thread)
+ // call nonblocking run ourself, as nothread qthread does not
+ run();
+#endif
}
QQuickPixmapReader::~QQuickPixmapReader()
@@ -948,8 +952,11 @@ void QQuickPixmapReader::run()
processJobs();
exec();
+#if QT_CONFIG(thread)
+ // nothread exec is empty and returns
delete threadObject;
threadObject = nullptr;
+#endif
}
class QQuickPixmapKey
@@ -1019,7 +1026,8 @@ QQuickPixmapStore::~QQuickPixmapStore()
m_timerId = -2;
// unreference all (leaked) pixmaps
- for (auto *pixmap : qAsConst(m_cache)) {
+ const auto cache = m_cache; // NOTE: intentional copy (QTBUG-65077); releasing items from the cache modifies m_cache.
+ for (auto *pixmap : cache) {
int currRefCount = pixmap->refCount;
if (currRefCount) {
#ifndef QT_NO_DEBUG
diff --git a/src/quick/util/qquickstyledtext.cpp b/src/quick/util/qquickstyledtext.cpp
index 762d49f2d2..5e1aaf121e 100644
--- a/src/quick/util/qquickstyledtext.cpp
+++ b/src/quick/util/qquickstyledtext.cpp
@@ -50,6 +50,8 @@
QQuickStyledText supports few tags:
<b></b> - bold
+ <del></del> - strike out (removed content)
+ <s></s> - strike out (no longer accurate or no longer relevant content)
<strong></strong> - bold
<i></i> - italic
<br> - new line
@@ -379,8 +381,16 @@ bool QQuickStyledTextPrivate::parseTag(const QChar *&ch, const QString &textIn,
format.setFontWeight(QFont::Bold);
return true;
}
- } else if (tag == QLatin1String("strong")) {
- format.setFontWeight(QFont::Bold);
+ } else if (char0 == QLatin1Char('s')) {
+ if (tagLength == 1) {
+ format.setFontStrikeOut(true);
+ return true;
+ } else if (tag == QLatin1String("strong")) {
+ format.setFontWeight(QFont::Bold);
+ return true;
+ }
+ } else if (tag == QLatin1String("del")) {
+ format.setFontStrikeOut(true);
return true;
} else if (tag == QLatin1String("ol")) {
List listItem;
@@ -511,7 +521,13 @@ bool QQuickStyledTextPrivate::parseCloseTag(const QChar *&ch, const QString &tex
return true;
} else if (tag == QLatin1String("font")) {
return true;
- } else if (tag == QLatin1String("strong")) {
+ } else if (char0 == QLatin1Char('s')) {
+ if (tagLength == 1) {
+ return true;
+ } else if (tag == QLatin1String("strong")) {
+ return true;
+ }
+ } else if (tag == QLatin1String("del")) {
return true;
} else if (tag == QLatin1String("ol")) {
if (!listStack.isEmpty()) {
diff --git a/tests/auto/qml/animation/qsequentialanimationgroupjob/BLACKLIST b/tests/auto/qml/animation/qsequentialanimationgroupjob/BLACKLIST
deleted file mode 100644
index 2afe6074d7..0000000000
--- a/tests/auto/qml/animation/qsequentialanimationgroupjob/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[finishWithUncontrolledAnimation]
-*
diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
index efd5bb571b..7c7c7d3bd0 100644
--- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
+++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
@@ -173,8 +173,8 @@ void tst_qqmlcomponent::qmlCreateWindow()
QQmlEngine engine;
QQmlComponent component(&engine);
component.loadUrl(testFileUrl("createWindow.qml"));
- QQuickWindow* window = qobject_cast<QQuickWindow *>(component.create());
- QVERIFY(window);
+ QScopedPointer<QQuickWindow> window(qobject_cast<QQuickWindow *>(component.create()));
+ QVERIFY(!window.isNull());
}
void tst_qqmlcomponent::qmlCreateObjectAutoParent_data()
@@ -192,8 +192,8 @@ void tst_qqmlcomponent::qmlCreateObjectAutoParent()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl(testFile));
- QQuickItem *root = qobject_cast<QQuickItem *>(component.create());
- QVERIFY(root);
+ QScopedPointer<QObject> root(qobject_cast<QQuickItem *>(component.create()));
+ QVERIFY(!root.isNull());
QObject *qtobjectParent = root->property("qtobjectParent").value<QObject*>();
QQuickItem *itemParent = qobject_cast<QQuickItem *>(root->property("itemParent").value<QObject*>());
QQuickWindow *windowParent = qobject_cast<QQuickWindow *>(root->property("windowParent").value<QObject*>());
@@ -251,45 +251,52 @@ void tst_qqmlcomponent::qmlCreateObjectWithProperties()
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("createObjectWithScript.qml"));
QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
- QObject *object = component.create();
- QVERIFY(object != nullptr);
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(!object.isNull());
- QObject *testObject1 = object->property("declarativerectangle").value<QObject*>();
- QVERIFY(testObject1);
- QCOMPARE(testObject1->parent(), object);
- QCOMPARE(testObject1->property("x").value<int>(), 17);
- QCOMPARE(testObject1->property("y").value<int>(), 17);
- QCOMPARE(testObject1->property("color").value<QColor>(), QColor(255,255,255));
- QCOMPARE(QQmlProperty::read(testObject1,"border.width").toInt(), 3);
- QCOMPARE(QQmlProperty::read(testObject1,"innerRect.border.width").toInt(), 20);
- delete testObject1;
-
- QObject *testObject2 = object->property("declarativeitem").value<QObject*>();
- QVERIFY(testObject2);
- QCOMPARE(testObject2->parent(), object);
- //QCOMPARE(testObject2->metaObject()->className(), "QDeclarativeItem_QML_2");
- QCOMPARE(testObject2->property("x").value<int>(), 17);
- QCOMPARE(testObject2->property("y").value<int>(), 17);
- QCOMPARE(testObject2->property("testBool").value<bool>(), true);
- QCOMPARE(testObject2->property("testInt").value<int>(), 17);
- QCOMPARE(testObject2->property("testObject").value<QObject*>(), object);
- delete testObject2;
-
- QObject *testBindingObj = object->property("bindingTestObject").value<QObject*>();
- QVERIFY(testBindingObj);
- QCOMPARE(testBindingObj->parent(), object);
- QCOMPARE(testBindingObj->property("testValue").value<int>(), 300);
- object->setProperty("width", 150);
- QCOMPARE(testBindingObj->property("testValue").value<int>(), 150 * 3);
- delete testBindingObj;
-
- QObject *testBindingThisObj = object->property("bindingThisTestObject").value<QObject*>();
- QVERIFY(testBindingThisObj);
- QCOMPARE(testBindingThisObj->parent(), object);
- QCOMPARE(testBindingThisObj->property("testValue").value<int>(), 900);
- testBindingThisObj->setProperty("width", 200);
- QCOMPARE(testBindingThisObj->property("testValue").value<int>(), 200 * 3);
- delete testBindingThisObj;
+ {
+ QScopedPointer<QObject> testObject1(object->property("declarativerectangle")
+ .value<QObject*>());
+ QVERIFY(testObject1);
+ QCOMPARE(testObject1->parent(), object.data());
+ QCOMPARE(testObject1->property("x").value<int>(), 17);
+ QCOMPARE(testObject1->property("y").value<int>(), 17);
+ QCOMPARE(testObject1->property("color").value<QColor>(), QColor(255,255,255));
+ QCOMPARE(QQmlProperty::read(testObject1.data(),"border.width").toInt(), 3);
+ QCOMPARE(QQmlProperty::read(testObject1.data(),"innerRect.border.width").toInt(), 20);
+ }
+
+ {
+ QScopedPointer<QObject> testObject2(object->property("declarativeitem").value<QObject*>());
+ QVERIFY(testObject2);
+ QCOMPARE(testObject2->parent(), object.data());
+ //QCOMPARE(testObject2->metaObject()->className(), "QDeclarativeItem_QML_2");
+ QCOMPARE(testObject2->property("x").value<int>(), 17);
+ QCOMPARE(testObject2->property("y").value<int>(), 17);
+ QCOMPARE(testObject2->property("testBool").value<bool>(), true);
+ QCOMPARE(testObject2->property("testInt").value<int>(), 17);
+ QCOMPARE(testObject2->property("testObject").value<QObject*>(), object.data());
+ }
+
+ {
+ QScopedPointer<QObject> testBindingObj(object->property("bindingTestObject")
+ .value<QObject*>());
+ QVERIFY(testBindingObj);
+ QCOMPARE(testBindingObj->parent(), object.data());
+ QCOMPARE(testBindingObj->property("testValue").value<int>(), 300);
+ object->setProperty("width", 150);
+ QCOMPARE(testBindingObj->property("testValue").value<int>(), 150 * 3);
+ }
+
+ {
+ QScopedPointer<QObject> testBindingThisObj(object->property("bindingThisTestObject")
+ .value<QObject*>());
+ QVERIFY(testBindingThisObj);
+ QCOMPARE(testBindingThisObj->parent(), object.data());
+ QCOMPARE(testBindingThisObj->property("testValue").value<int>(), 900);
+ testBindingThisObj->setProperty("width", 200);
+ QCOMPARE(testBindingThisObj->property("testValue").value<int>(), 200 * 3);
+ }
}
void tst_qqmlcomponent::qmlCreateParentReference()
diff --git a/tests/auto/qml/qqmlcontext/data/Drawer.qml b/tests/auto/qml/qqmlcontext/data/Drawer.qml
new file mode 100644
index 0000000000..b35d5c8d34
--- /dev/null
+++ b/tests/auto/qml/qqmlcontext/data/Drawer.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.12
+import QtQuick.Window 2.11
+
+Rectangle {
+ parent: Window.contentItem
+}
diff --git a/tests/auto/qml/qqmlcontext/data/contextObjectHierarchy.qml b/tests/auto/qml/qqmlcontext/data/contextObjectHierarchy.qml
new file mode 100644
index 0000000000..91978d98a0
--- /dev/null
+++ b/tests/auto/qml/qqmlcontext/data/contextObjectHierarchy.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.6
+import QtQuick.Window 2.2
+
+Window {
+ Drawer {}
+}
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
index 5838193a6b..cb4bee0d3a 100644
--- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
+++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
@@ -70,6 +70,7 @@ private slots:
void contextLeak();
void outerContextObject();
+ void contextObjectHierarchy();
private:
QQmlEngine engine;
@@ -873,6 +874,24 @@ void tst_qqmlcontext::outerContextObject()
QTRY_VERIFY(iterations >= 100);
}
+void tst_qqmlcontext::contextObjectHierarchy()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl("contextObjectHierarchy.qml"));
+ QVERIFY(component.isReady());
+ QScopedPointer<QObject> root(component.create());
+ QVERIFY(!root.isNull());
+
+ for (const QObject *child : root->children())
+ QVERIFY(QQmlData::get(child)->outerContext != nullptr);
+
+ connect(root.data(), &QObject::destroyed, [&root]() {
+ for (const QObject *child : root->children())
+ QCOMPARE(QQmlData::get(child)->outerContext, nullptr);
+ });
+}
+
QTEST_MAIN(tst_qqmlcontext)
#include "tst_qqmlcontext.moc"
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 71c4e03812..085cd5ffd0 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -360,6 +360,7 @@ private slots:
void importLexicalVariables_data();
void importLexicalVariables();
void hugeObject();
+ void templateStringTerminator();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -8463,7 +8464,8 @@ void tst_qqmlecmascript::stringify_qtbug_50592()
QScopedPointer<QObject> obj(component.create());
QVERIFY(obj != nullptr);
- QCOMPARE(obj->property("source").toString(), QString::fromLatin1("http://example.org/some_nonexistant_image.png"));
+ QCOMPARE(obj->property("source").toString(),
+ QString::fromLatin1("\"http://example.org/some_nonexistant_image.png\""));
}
// Tests for the JS-only instanceof. Tests for the QML extensions for
@@ -8858,6 +8860,14 @@ void tst_qqmlecmascript::hugeObject()
QVERIFY(!v.isError());
}
+void tst_qqmlecmascript::templateStringTerminator()
+{
+ QJSEngine engine;
+ const QJSValue value = engine.evaluate("let a = 123; let b = `x${a}\ny^`; b;");
+ QVERIFY(!value.isError());
+ QCOMPARE(value.toString(), QLatin1String("x123\ny^"));
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"
diff --git a/tests/auto/quick/pointerhandlers/qquicktaphandler/data/rightTapHandler.qml b/tests/auto/quick/pointerhandlers/qquicktaphandler/data/rightTapHandler.qml
new file mode 100644
index 0000000000..aea01c154c
--- /dev/null
+++ b/tests/auto/quick/pointerhandlers/qquicktaphandler/data/rightTapHandler.qml
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.12
+
+Rectangle {
+ width: 320
+ height: 240
+ color: rightTap.pressed ? "tomato" : "beige"
+ TapHandler {
+ id: rightTap
+ objectName: "right button TapHandler"
+ longPressThreshold: 0.5
+ acceptedButtons: Qt.RightButton
+ }
+}
diff --git a/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp b/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp
index 187ade58d5..33cea69147 100644
--- a/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp
@@ -70,6 +70,7 @@ private slots:
void mouseLongPress();
void buttonsMultiTouch();
void componentUserBehavioralOverride();
+ void rightLongPressIgnoreWheel();
private:
void createView(QScopedPointer<QQuickView> &window, const char *fileName);
@@ -676,6 +677,44 @@ void tst_TapHandler::componentUserBehavioralOverride()
QCOMPARE(userGrabChangedSpy.count(), 2);
}
+void tst_TapHandler::rightLongPressIgnoreWheel()
+{
+ QScopedPointer<QQuickView> windowPtr;
+ createView(windowPtr, "rightTapHandler.qml");
+ QQuickView * window = windowPtr.data();
+
+ QQuickTapHandler *tap = window->rootObject()->findChild<QQuickTapHandler*>();
+ QVERIFY(tap);
+ QSignalSpy tappedSpy(tap, SIGNAL(tapped(QQuickEventPoint *)));
+ QSignalSpy longPressedSpy(tap, SIGNAL(longPressed()));
+ QPoint p1(100, 100);
+
+ // Mouse wheel with ScrollBegin phase (because as soon as two fingers are touching
+ // the trackpad, it will send such an event: QTBUG-71955)
+ {
+ QWheelEvent wheelEvent(p1, p1, QPoint(0, 0), QPoint(0, 0),
+ Qt::NoButton, Qt::NoModifier, Qt::ScrollBegin, false, Qt::MouseEventNotSynthesized);
+ QGuiApplication::sendEvent(window, &wheelEvent);
+ }
+
+ // Press
+ QTest::mousePress(window, Qt::RightButton, Qt::NoModifier, p1);
+ QTRY_COMPARE(tap->isPressed(), true);
+
+ // Mouse wheel ScrollEnd phase
+ QWheelEvent wheelEvent(p1, p1, QPoint(0, 0), QPoint(0, 0),
+ Qt::NoButton, Qt::NoModifier, Qt::ScrollEnd, false, Qt::MouseEventNotSynthesized);
+ QGuiApplication::sendEvent(window, &wheelEvent);
+ QTRY_COMPARE(longPressedSpy.count(), 1);
+ QCOMPARE(tap->isPressed(), true);
+ QCOMPARE(tappedSpy.count(), 0);
+
+ // Release
+ QTest::mouseRelease(window, Qt::RightButton, Qt::NoModifier, p1, 500);
+ QTRY_COMPARE(tap->isPressed(), false);
+ QCOMPARE(tappedSpy.count(), 0);
+}
+
QTEST_MAIN(tst_TapHandler)
#include "tst_qquicktaphandler.moc"
diff --git a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
index 02e89ba0a7..9292e1886a 100644
--- a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
+++ b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
@@ -596,7 +596,9 @@ void tst_qquickborderimage::borderImageMesh()
window->setSource(testFileUrl("mesh.qml"));
QImage mesh = window->grabWindow();
- QVERIFY(QQuickVisualTestUtil::compareImages(mesh, nonmesh));
+ QString errorMessage;
+ QVERIFY2(QQuickVisualTestUtil::compareImages(mesh, nonmesh, &errorMessage),
+ qPrintable(errorMessage));
}
#endif
QTEST_MAIN(tst_qquickborderimage)
diff --git a/tests/auto/quick/qquickshape/tst_qquickshape.cpp b/tests/auto/quick/qquickshape/tst_qquickshape.cpp
index 3206129e72..61fb260612 100644
--- a/tests/auto/quick/qquickshape/tst_qquickshape.cpp
+++ b/tests/auto/quick/qquickshape/tst_qquickshape.cpp
@@ -233,7 +233,10 @@ void tst_QQuickShape::render()
QImage refImg(testFileUrl("pathitem3.png").toLocalFile());
QVERIFY(!refImg.isNull());
- QVERIFY(QQuickVisualTestUtil::compareImages(img.convertToFormat(refImg.format()), refImg));
+ QString errorMessage;
+ const QImage actualImg = img.convertToFormat(refImg.format());
+ QVERIFY2(QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage),
+ qPrintable(errorMessage));
}
void tst_QQuickShape::renderWithMultipleSp()
@@ -254,7 +257,10 @@ void tst_QQuickShape::renderWithMultipleSp()
QImage refImg(testFileUrl("pathitem4.png").toLocalFile());
QVERIFY(!refImg.isNull());
- QVERIFY(QQuickVisualTestUtil::compareImages(img.convertToFormat(refImg.format()), refImg));
+ QString errorMessage;
+ const QImage actualImg = img.convertToFormat(refImg.format());
+ QVERIFY2(QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage),
+ qPrintable(errorMessage));
}
void tst_QQuickShape::radialGrad()
@@ -275,7 +281,10 @@ void tst_QQuickShape::radialGrad()
QImage refImg(testFileUrl("pathitem5.png").toLocalFile());
QVERIFY(!refImg.isNull());
- QVERIFY(QQuickVisualTestUtil::compareImages(img.convertToFormat(refImg.format()), refImg));
+ QString errorMessage;
+ const QImage actualImg = img.convertToFormat(refImg.format());
+ QVERIFY2(QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage),
+ qPrintable(errorMessage));
}
void tst_QQuickShape::conicalGrad()
@@ -296,7 +305,10 @@ void tst_QQuickShape::conicalGrad()
QImage refImg(testFileUrl("pathitem6.png").toLocalFile());
QVERIFY(!refImg.isNull());
- QVERIFY(QQuickVisualTestUtil::compareImages(img.convertToFormat(refImg.format()), refImg));
+ QString errorMessage;
+ const QImage actualImg = img.convertToFormat(refImg.format());
+ QVERIFY2(QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage),
+ qPrintable(errorMessage));
}
QTEST_MAIN(tst_QQuickShape)
diff --git a/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp b/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp
index 6ca5ad2653..88b0e95e0a 100644
--- a/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp
+++ b/tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp
@@ -44,7 +44,8 @@ public:
Bold = 0x01,
Underline = 0x02,
Italic = 0x04,
- Anchor = 0x08
+ Anchor = 0x08,
+ StrikeOut = 0x10
};
Format(int t, int s, int l)
: type(t), start(s), length(l) {}
@@ -92,6 +93,10 @@ void tst_qquickstyledtext::textOutput_data()
QTest::newRow("underline") << "<u>underline</u>" << "underline" << (FormatList() << Format(Format::Underline, 0, 9)) << false;
QTest::newRow("strong") << "<strong>strong</strong>" << "strong" << (FormatList() << Format(Format::Bold, 0, 6)) << false;
QTest::newRow("underline") << "<u>underline</u>" << "underline" << (FormatList() << Format(Format::Underline, 0, 9)) << false;
+ QTest::newRow("strike out s") << "<s>strike out</s>" << "strike out" << (FormatList() << Format(Format::StrikeOut, 0, 10)) << false;
+ QTest::newRow("strike out del") << "<del>strike out</del>" << "strike out" << (FormatList() << Format(Format::StrikeOut, 0, 10)) << false;
+ QTest::newRow("strike out not s") << "this is <s>not</s> a test" << "this is not a test" << (FormatList() << Format(Format::StrikeOut, 8, 3)) << false;
+ QTest::newRow("strike out not del") << "this is <del>not</del> a test" << "this is not a test" << (FormatList() << Format(Format::StrikeOut, 8, 3)) << false;
QTest::newRow("missing >") << "<b>text</b" << "text" << (FormatList() << Format(Format::Bold, 0, 4)) << false;
QTest::newRow("missing b>") << "<b>text</" << "text" << (FormatList() << Format(Format::Bold, 0, 4)) << false;
QTest::newRow("missing /b>") << "<b>text<" << "text" << (FormatList() << Format(Format::Bold, 0, 4)) << false;
@@ -178,6 +183,7 @@ void tst_qquickstyledtext::textOutput()
QCOMPARE(layoutFormats.at(i).format.fontWeight(), int(QFont::Normal));
QVERIFY(layoutFormats.at(i).format.fontItalic() == bool(formats.at(i).type & Format::Italic));
QVERIFY(layoutFormats.at(i).format.fontUnderline() == bool(formats.at(i).type & Format::Underline));
+ QVERIFY(layoutFormats.at(i).format.fontStrikeOut() == bool(formats.at(i).type & Format::StrikeOut));
}
QCOMPARE(fontSizeModified, modifiesFontSize);
}
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 578ae56cca..ab101dc1be 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -1506,44 +1506,6 @@ void tst_qquickwindow::animationsWhileHidden()
QTRY_VERIFY(window->isVisible());
}
-// When running on native Nvidia graphics cards on linux, the
-// distance field glyph pixels have a measurable, but not visible
-// pixel error. Use a custom compare function to avoid
-//
-// This was GT-216 with the ubuntu "nvidia-319" driver package.
-// llvmpipe does not show the same issue.
-//
-bool compareImages(const QImage &ia, const QImage &ib)
-{
- if (ia.size() != ib.size())
- qDebug() << "images are of different size" << ia.size() << ib.size();
- Q_ASSERT(ia.size() == ib.size());
- Q_ASSERT(ia.format() == ib.format());
-
- int w = ia.width();
- int h = ia.height();
- const int tolerance = 5;
- for (int y=0; y<h; ++y) {
- const uint *as= (const uint *) ia.constScanLine(y);
- const uint *bs= (const uint *) ib.constScanLine(y);
- for (int x=0; x<w; ++x) {
- uint a = as[x];
- uint b = bs[x];
-
- // No tolerance for error in the alpha.
- if ((a & 0xff000000) != (b & 0xff000000))
- return false;
- if (qAbs(qRed(a) - qRed(b)) > tolerance)
- return false;
- if (qAbs(qRed(a) - qRed(b)) > tolerance)
- return false;
- if (qAbs(qRed(a) - qRed(b)) > tolerance)
- return false;
- }
- }
- return true;
-}
-
void tst_qquickwindow::headless()
{
QQmlEngine engine;
@@ -1597,7 +1559,9 @@ void tst_qquickwindow::headless()
// Verify that the visual output is the same
QImage newContent = window->grabWindow();
- QVERIFY(compareImages(newContent, originalContent));
+ QString errorMessage;
+ QVERIFY2(QQuickVisualTestUtil::compareImages(newContent, originalContent, &errorMessage),
+ qPrintable(errorMessage));
}
void tst_qquickwindow::noUpdateWhenNothingChanges()
diff --git a/tests/auto/quick/scenegraph/tst_scenegraph.cpp b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
index 2479450287..063358c795 100644
--- a/tests/auto/quick/scenegraph/tst_scenegraph.cpp
+++ b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
@@ -264,6 +264,7 @@ void tst_SceneGraph::manyWindows()
const int COUNT = 4;
QImage baseLine;
+ QString errorMessage;
for (int i=0; i<COUNT; ++i) {
views << createView(file, parent.data(), (i % 2) * 100, (i / 2) * 100, 100, 100);
}
@@ -275,7 +276,8 @@ void tst_SceneGraph::manyWindows()
baseLine = content;
QVERIFY(containsSomethingOtherThanWhite(baseLine));
} else {
- QVERIFY(compareImages(content, baseLine));
+ QVERIFY2(compareImages(content, baseLine, &errorMessage),
+ qPrintable(errorMessage));
}
}
@@ -284,7 +286,8 @@ void tst_SceneGraph::manyWindows()
QQuickView *last = createView(file, parent.data(), 100, 100, 100, 100);
QVERIFY(QTest::qWaitForWindowExposed(last));
views << last;
- QVERIFY(compareImages(baseLine, last->grabWindow()));
+ QVERIFY2(compareImages(baseLine, last->grabWindow(), &errorMessage),
+ qPrintable(errorMessage));
// Wipe and recreate all
qDeleteAll(views);
@@ -297,7 +300,8 @@ void tst_SceneGraph::manyWindows()
QQuickView *view = views.at(i);
QVERIFY(QTest::qWaitForWindowExposed(view));
QImage content = view->grabWindow();
- QVERIFY(compareImages(content, baseLine));
+ QVERIFY2(compareImages(content, baseLine, &errorMessage),
+ qPrintable(errorMessage));
}
}
diff --git a/tests/auto/quick/shared/visualtestutil.cpp b/tests/auto/quick/shared/visualtestutil.cpp
index eabfe5368b..de2cf2bd5b 100644
--- a/tests/auto/quick/shared/visualtestutil.cpp
+++ b/tests/auto/quick/shared/visualtestutil.cpp
@@ -66,12 +66,18 @@ void QQuickVisualTestUtil::dumpTree(QQuickItem *parent, int depth)
// distance field glyph pixels have a measurable, but not visible
// pixel error. This was GT-216 with the ubuntu "nvidia-319" driver package.
// llvmpipe does not show the same issue.
-bool QQuickVisualTestUtil::compareImages(const QImage &ia, const QImage &ib)
+
+bool QQuickVisualTestUtil::compareImages(const QImage &ia, const QImage &ib, QString *errorMessage)
{
- if (ia.size() != ib.size())
- qDebug() << "images are of different size" << ia.size() << ib.size();
- Q_ASSERT(ia.size() == ib.size());
- Q_ASSERT(ia.format() == ib.format());
+ if (ia.size() != ib.size()) {
+ QDebug(errorMessage) << "Images are of different size:" << ia.size() << ib.size()
+ << "DPR:" << ia.devicePixelRatio() << ib.devicePixelRatio();
+ return false;
+ }
+ if (ia.format() != ib.format()) {
+ QDebug(errorMessage) << "Images are of different formats:" << ia.format() << ib.format();
+ return false;
+ }
int w = ia.width();
int h = ia.height();
@@ -84,14 +90,14 @@ bool QQuickVisualTestUtil::compareImages(const QImage &ia, const QImage &ib)
uint b = bs[x];
// No tolerance for error in the alpha.
- if ((a & 0xff000000) != (b & 0xff000000))
- return false;
- if (qAbs(qRed(a) - qRed(b)) > tolerance)
- return false;
- if (qAbs(qRed(a) - qRed(b)) > tolerance)
- return false;
- if (qAbs(qRed(a) - qRed(b)) > tolerance)
+ if ((a & 0xff000000) != (b & 0xff000000)
+ || qAbs(qRed(a) - qRed(b)) > tolerance
+ || qAbs(qRed(a) - qRed(b)) > tolerance
+ || qAbs(qRed(a) - qRed(b)) > tolerance) {
+ QDebug(errorMessage) << "Mismatch at:" << x << y << ':'
+ << hex << showbase << a << b;
return false;
+ }
}
}
return true;
diff --git a/tests/auto/quick/shared/visualtestutil.h b/tests/auto/quick/shared/visualtestutil.h
index 2daf86cd83..1cdbaf838b 100644
--- a/tests/auto/quick/shared/visualtestutil.h
+++ b/tests/auto/quick/shared/visualtestutil.h
@@ -97,7 +97,7 @@ namespace QQuickVisualTestUtil
return items;
}
- bool compareImages(const QImage &ia, const QImage &ib);
+ bool compareImages(const QImage &ia, const QImage &ib, QString *errorMessage);
}
#define QQUICK_VERIFY_POLISH(item) \
diff --git a/tests/auto/quick/touchmouse/BLACKLIST b/tests/auto/quick/touchmouse/BLACKLIST
index e0d4bff131..b2ba52eca9 100644
--- a/tests/auto/quick/touchmouse/BLACKLIST
+++ b/tests/auto/quick/touchmouse/BLACKLIST
@@ -1,5 +1,2 @@
-# QTBUG-40856 hover regression on pointerhandler branch: TODO fix before merging to dev
-[hoverEnabled]
-*
[buttonOnDelayedPressFlickable]
windows gcc developer-build
diff --git a/tests/auto/quickwidgets/qquickwidget/BLACKLIST b/tests/auto/quickwidgets/qquickwidget/BLACKLIST
deleted file mode 100644
index 6594a22472..0000000000
--- a/tests/auto/quickwidgets/qquickwidget/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[enterLeave]
-osx
diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
index 24e55e3b3a..42dc766a13 100644
--- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
+++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
@@ -160,7 +160,7 @@ void tst_qquickwidget::showHide()
childView->setSource(testFileUrl("rectangle.qml"));
window.show();
- QVERIFY(QTest::qWaitForWindowExposed(&window, 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QVERIFY(childView->quickWindow()->isVisible());
QVERIFY(childView->quickWindow()->visibility() != QWindow::Hidden);
@@ -176,13 +176,13 @@ void tst_qquickwidget::reparentAfterShow()
QQuickWidget *childView = new QQuickWidget(&window);
childView->setSource(testFileUrl("rectangle.qml"));
window.show();
- QVERIFY(QTest::qWaitForWindowExposed(&window, 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QScopedPointer<QQuickWidget> toplevelView(new QQuickWidget);
toplevelView->setParent(&window);
toplevelView->setSource(testFileUrl("rectangle.qml"));
toplevelView->show();
- QVERIFY(QTest::qWaitForWindowExposed(&window, 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
}
void tst_qquickwidget::changeGeometry()
@@ -193,7 +193,7 @@ void tst_qquickwidget::changeGeometry()
childView->setSource(testFileUrl("rectangle.qml"));
window.show();
- QVERIFY(QTest::qWaitForWindowExposed(&window, 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
childView->setGeometry(100,100,100,100);
}
@@ -373,7 +373,7 @@ void tst_qquickwidget::readback()
view->setSource(testFileUrl("rectangle.qml"));
view->show();
- QVERIFY(QTest::qWaitForWindowExposed(view.data(), 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(view.data()));
QImage img = view->grabFramebuffer();
QVERIFY(!img.isNull());
@@ -409,7 +409,7 @@ void tst_qquickwidget::renderingSignals()
QCOMPARE(afterRenderingSpy.size(), 0);
widget.show();
- QVERIFY(QTest::qWaitForWindowExposed(&widget, 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
QTRY_VERIFY(beforeRenderingSpy.size() > 0);
QTRY_VERIFY(beforeSyncSpy.size() > 0);
@@ -441,9 +441,9 @@ void tst_qquickwidget::reparentToNewWindow()
QQuickWidget *qqw = new QQuickWidget(&window1);
qqw->setSource(testFileUrl("rectangle.qml"));
window1.show();
- QVERIFY(QTest::qWaitForWindowExposed(&window1, 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(&window1));
window2.show();
- QVERIFY(QTest::qWaitForWindowExposed(&window2, 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(&window2));
QSignalSpy afterRenderingSpy(qqw->quickWindow(), &QQuickWindow::afterRendering);
qqw->setParent(&window2);
@@ -488,7 +488,7 @@ void tst_qquickwidget::keyEvents()
KeyHandlingWidget widget;
widget.setSource(testFileUrl("rectangle.qml"));
widget.show();
- QVERIFY(QTest::qWaitForWindowExposed(widget.window(), 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(widget.window()));
// Note: send the event to the QWindow, not the QWidget, in order
// to simulate the full event processing chain.
@@ -516,7 +516,7 @@ void tst_qquickwidget::shortcuts()
KeyHandlingWidget widget;
widget.setSource(testFileUrl("rectangle.qml"));
widget.show();
- QVERIFY(QTest::qWaitForWindowExposed(widget.window(), 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(widget.window()));
// Send to the widget, verify that the QQuickWindow sees it.
@@ -534,14 +534,14 @@ void tst_qquickwidget::enterLeave()
QQuickWidget view;
view.setSource(testFileUrl("enterleave.qml"));
- // Ensure it is not inside the window first
+ // Ensure the cursor is away from the window first
const auto outside = m_availableGeometry.topLeft() + QPoint(50, 50);
QCursor::setPos(outside);
QTRY_VERIFY(QCursor::pos() == outside);
view.move(m_availableGeometry.topLeft() + QPoint(100, 100));
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view, 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QQuickItem *rootItem = view.rootObject();
QVERIFY(rootItem);
const QPoint frameOffset = view.geometry().topLeft() - view.frameGeometry().topLeft();
@@ -551,7 +551,7 @@ void tst_qquickwidget::enterLeave()
QCursor::setPos(view.pos() + QPoint(50, 50) + frameOffset);
QTRY_VERIFY(rootItem->property("hasMouse").toBool());
// Now check the leave
- QCursor::setPos(view.pos() - QPoint(50, 50));
+ QCursor::setPos(outside);
QTRY_VERIFY(!rootItem->property("hasMouse").toBool());
}
@@ -563,7 +563,7 @@ void tst_qquickwidget::mouseEventWindowPos()
quick->setSource(testFileUrl("mouse.qml"));
quick->move(50, 50);
widget.show();
- QVERIFY(QTest::qWaitForWindowExposed(&widget, 5000));
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
QQuickItem *rootItem = quick->rootObject();
QVERIFY(rootItem);
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index c9e7dbadc9..c1399c38e5 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -546,15 +546,15 @@ int main(int argc, char ** argv)
QLocale locale;
QTranslator qtTranslator;
if (qtTranslator.load(locale, QLatin1String("qt"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
- app->installTranslator(&qtTranslator);
+ QCoreApplication::installTranslator(&qtTranslator);
QTranslator translator;
if (translator.load(locale, QLatin1String("qmlscene"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
- app->installTranslator(&translator);
+ QCoreApplication::installTranslator(&translator);
QTranslator qmlTranslator;
if (!options.translationFile.isEmpty()) {
if (qmlTranslator.load(options.translationFile)) {
- app->installTranslator(&qmlTranslator);
+ QCoreApplication::installTranslator(&qmlTranslator);
} else {
fprintf(stderr, "Could not load the translation file \"%s\"\n",
qPrintable(options.translationFile));
diff --git a/tools/tools.pro b/tools/tools.pro
index 3f5f23eb32..d3ec380717 100644
--- a/tools/tools.pro
+++ b/tools/tools.pro
@@ -3,6 +3,7 @@ QT_FOR_CONFIG += qml-private
qtConfig(qml-devtools) {
SUBDIRS += \
+ qmllint \
qmlmin \
qmlimportscanner
@@ -13,7 +14,6 @@ qtConfig(thread):!android|android_app {
SUBDIRS += \
qml
- qtConfig(qml-devtools): SUBDIRS += qmllint
qtConfig(qml-profiler): SUBDIRS += qmlprofiler
qtConfig(qml-preview): SUBDIRS += qmlpreview