platform/upstream/qtdeclarative.git
9 years agoFix the visualization of unmerged batch geometries without index
Jocelyn Turcotte [Wed, 26 Nov 2014 14:58:12 +0000 (15:58 +0100)]
Fix the visualization of unmerged batch geometries without index

indexData() is null for most QSGGeometryNodes subclasses in QtQuick,
make sure that we draw using vertex array data in that case.

The patch also increases the contrast of the line pattern, since it
is almost invisible with brighter hue values, to make it easier to
see which batches aren't merged.

Change-Id: Ife7b26692ee318feb0810ee0e787289eb151ea8a
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoWindows: Don't disable JIT
Sérgio Martins [Sun, 7 Dec 2014 01:37:57 +0000 (01:37 +0000)]
Windows: Don't disable JIT

[ChangeLog][QtQml][Windows] V4 JIT was re-enabled after it was disabled by mistake in 5.4.0.

Task-number: QTBUG-43171
Change-Id: I16206e094c210b1eadbfef9ee04cf78d3a7dcebe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQML Debugging: Fix crash when stepping through try-catch block.
Erik Verbruggen [Fri, 5 Dec 2014 12:16:14 +0000 (13:16 +0100)]
QML Debugging: Fix crash when stepping through try-catch block.

Also fix the stack-trace generation, otherwise the debugger engine would
report a breakpoint hit on the wrong line.

Task-number: QTBUG-42723
Change-Id: I1f655a5174b28a1c9c31c85bbe023fbce5ddbb96
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQML: fix warning in tests
Erik Verbruggen [Mon, 8 Dec 2014 09:26:08 +0000 (10:26 +0100)]
QML: fix warning in tests

Mark unused fields as Q_UNUSED. They are still "used" to check if the
compiler will generate warnings/errors (which it shouldn't).

Change-Id: I38e1668e88d94ab8f26a92a06f5207b77369e136
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQML: fix warning in tests
Erik Verbruggen [Mon, 8 Dec 2014 09:25:09 +0000 (10:25 +0100)]
QML: fix warning in tests

Remove unused function that wouldn't be emitted anyway.

Change-Id: I623d5d44bca9a1358cf9e66ff557992aba9ae451
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQML: fix warning in tests
Erik Verbruggen [Mon, 8 Dec 2014 09:24:42 +0000 (10:24 +0100)]
QML: fix warning in tests

Remove unused constant.

Change-Id: I3fb3512f7ea54102450eeeda1a56c73fe6b26025
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMerge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into refs/staging/5.4
Simon Hausmann [Tue, 9 Dec 2014 08:53:01 +0000 (09:53 +0100)]
Merge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into refs/staging/5.4

9 years agoQML: fix warning in tests
Erik Verbruggen [Mon, 8 Dec 2014 09:24:06 +0000 (10:24 +0100)]
QML: fix warning in tests

Remove unused class field.

Change-Id: I90981546e33d4839a91c418a8746e6f2ebc3bf46
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQuick: fix test
Erik Verbruggen [Mon, 8 Dec 2014 09:22:47 +0000 (10:22 +0100)]
Quick: fix test

/Users/erik/dev/qt5-stable/qtdeclarative/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp:1561:60: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
                    items << qMakePair(QString("new item " + j), QString::number(j));
                                               ~~~~~~~~~~~~^~~

Change-Id: I94bd952abf82a8f174772482330b5fdd636578ad
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAvoid string-based connect in QQuickImageBase.
Michael Brasser [Sat, 6 Dec 2014 16:38:34 +0000 (10:38 -0600)]
Avoid string-based connect in QQuickImageBase.

String-based connect is relatively slow, and should be avoided in core
items. This improves performance of the

tst_librarymetrics_performance::instantiation_cached(043) image - empty

test case (approximately halving the time).

Task-number: QTBUG-43096
Change-Id: I02485c515435eceacc95c55f877fc8566e7406d7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix \inqmlmodule usage: only use one parameter
Alejandro Exojo [Fri, 5 Dec 2014 19:14:20 +0000 (20:14 +0100)]
Fix \inqmlmodule usage: only use one parameter

Since the command just links back to the corresponding module page, only the
first parameter is used, and the version causes more confusion.

Change-Id: I73ed289550c576747132f77b83c1257094059cd1
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
9 years agoMerge remote-tracking branch 'origin/5.4.0' into 5.4
Simon Hausmann [Fri, 5 Dec 2014 10:58:05 +0000 (11:58 +0100)]
Merge remote-tracking branch 'origin/5.4.0' into 5.4

Change-Id: I5978bab8a4fde4c2ee33907fd81f49cb69e4fb26

9 years agoQQmlInspectorService: handle views only with supported plugins. v5.4.0
Ulf Hermann [Tue, 2 Dec 2014 17:26:46 +0000 (18:26 +0100)]
QQmlInspectorService: handle views only with supported plugins.

Task-number: QTBUG-43048
Change-Id: I5b32bd0a1e28fdf56b5346580daf21e7ec1b9f8c
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
9 years agoqttest: make findChild available only for QtTest 1.1
Fawzi Mohamed [Thu, 4 Dec 2014 17:00:40 +0000 (18:00 +0100)]
qttest: make findChild available only for QtTest 1.1

Change-Id: I4ceb1a969bd4296b82f899088b02b5e8cf100bcd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoUpdate plugins.qmltypes
Kai Koehne [Thu, 4 Dec 2014 08:50:44 +0000 (09:50 +0100)]
Update plugins.qmltypes

Change-Id: I9b6c54b572d4653d609b154000e274b9e64d591f
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAdd string::arg method in installTranslatorFunctions
Kai Koehne [Thu, 4 Dec 2014 13:19:09 +0000 (14:19 +0100)]
Add string::arg method in installTranslatorFunctions

QJSEngine::installTranslatorFunctions install the translator functions
to any given JS object. However, the custom string::arg() method is only
added in qqmlbuiltinfunctions.cpp, making the use of qsTr() in other
pure-JS programs quite hard.

Task-number: QTBUG-43113
Change-Id: Ia9ed97a4c07a4d167c792f3ea13e4f6e96c97423
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoCorrect QtQml.Models \qmlmodule version.
Mitch Curtis [Tue, 18 Nov 2014 09:16:52 +0000 (10:16 +0100)]
Correct QtQml.Models \qmlmodule version.

For example, the following documentation [1] says:

Import Statement:   import QtQml.Models 2.0

This should be:

Import Statement:   import QtQml.Models 2.1

The module documentation [2] is correct, but there's no visible link to
that page from [1].

[1] http://qt-project.org/doc/qt-5/qml-qtqml-models-objectmodel.html
[2] http://qt-project.org/doc/qt-5/qtqml-models-qmlmodule.html

Change-Id: Ib2ab7b821ad7e98c20b396b26f745ee39434b7fb
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix QtQuick2 module unload support
Chris Adams [Mon, 1 Dec 2014 04:32:57 +0000 (14:32 +1000)]
Fix QtQuick2 module unload support

This commit ensures that the value type providers installed by the
QtQuick2 QML module during initialization are uninstalled when the
plugin is unloaded.

It also fixes a bug in the type compiler so that it now works with
types from plugins which get unloaded and then reloaded.

Task-number: QTBUG-43004
Change-Id: I4b3fb75aae65dfbc5de9c88701ed82514087ab7d
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
9 years agoError out when trying to set an item as its own parent
Frederik Gladhorn [Wed, 3 Dec 2014 13:42:12 +0000 (14:42 +0100)]
Error out when trying to set an item as its own parent

Task-number: QTBUG-43063
Change-Id: I92a33047ac7fa2afeff4986b6e42c07afbc59918
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoFix crashes on QNX/x86
Simon Hausmann [Wed, 3 Dec 2014 09:37:16 +0000 (10:37 +0100)]
Fix crashes on QNX/x86

On x86 we assume that ebx holds the address of the global offset table for
position independent code. So before placing a run-time call we restore the
register from it's position we saved it on earlier on the stack. However after
commit d9f33ccdef985badc56fd8940373748626beffc7 the register wasn't saved on the
stack anymore in the prologue because we skipped because it's caller saved. So
when we seemingly reloaded ebx with the GOT from the stack, we loaded it from a location
we never saved it to. This patch makes sure to always save it on the stack so that
we can always restore it.

Change-Id: I8f6a8e38779151fff517f17220f29a7cb45ca89d
Task-number: QTBUG-43036
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
9 years agoFix application build when combining with Mac OS X Cocoa headers
Simon Hausmann [Mon, 1 Dec 2014 12:11:03 +0000 (13:11 +0100)]
Fix application build when combining with Mac OS X Cocoa headers

OSX's AssertMacros.h unconditionally defines macros like "check" and that
clashes with qml's type discovery templates that define a check function
and that are used by qmlRegisterType and friends.

There's a comment in the OS X headers suggesting that this will be fixed
in the "next" release, but that hasn't happened for a while and the bug
is still present in 10.10. So let's work around it and make life easier
for people using Qml and Cocoa at the same time.

Change-Id: I005d21188f92deaebd45bce2e6484cd4deeb9a34
Task-number: QTBUG-36309
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoFix conditional breakpoints in QML
Simon Hausmann [Mon, 1 Dec 2014 14:51:05 +0000 (15:51 +0100)]
Fix conditional breakpoints in QML

We need to set "inheritContext" to true for the QV4::Script that's used during
conditional break point evaluation, because that will also disable fast
property lookups, which is still required for QML lookups to work.

Change-Id: I8976df1c827b5058eae9bdce6e86e5ea856cbfe1
Task-number: QTBUG-43018
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoFix expression evaluation in specific frames in the debugger
Simon Hausmann [Fri, 28 Nov 2014 08:24:35 +0000 (09:24 +0100)]
Fix expression evaluation in specific frames in the debugger

Expressions from the QML/JS console are intended to be executed in a specific
frame / context. However that wasn't implemented properly, we should pop the
current context frameNr times.

[ChangeLog][QtQml] Fix inspecting objects in QML/JS console in different frames.

Change-Id: If575d4005c52a9fe6805538a7b1a02b9e32049d6
Task-number: QTBUG-42831
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoRemove dead code
Simon Hausmann [Thu, 27 Nov 2014 14:45:02 +0000 (15:45 +0100)]
Remove dead code

The eval code tracking was used last time for the old exception handling,
but that's long gone :)

Change-Id: I6fa80a5197745fde461e4da66cd65a50149c6048
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoQtQuick.Window: add missing documentation for Window methods
Shawn Rutledge [Fri, 7 Nov 2014 11:55:03 +0000 (12:55 +0100)]
QtQuick.Window: add missing documentation for Window methods

Several more methods/slots are inherited from QWindow but are not
documented for the QML Window type.  Also some other documentation
improvements.

Task-number: QTBUG-40093
Task-number: QTBUG-42426
Change-Id: Ib753be269cbc41ee540e6556e0ef483758eefe62
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoMerge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into refs/staging/5.4
Simon Hausmann [Tue, 2 Dec 2014 18:56:43 +0000 (19:56 +0100)]
Merge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into refs/staging/5.4

9 years agoMerge remote-tracking branch 'origin/5.4.0' into 5.4
Simon Hausmann [Tue, 2 Dec 2014 12:41:31 +0000 (13:41 +0100)]
Merge remote-tracking branch 'origin/5.4.0' into 5.4

Change-Id: I89bbb2977350a03c156d531f810d08a5560ffbb3

9 years agoFix permissions of files
Kai Koehne [Wed, 26 Nov 2014 08:59:11 +0000 (09:59 +0100)]
Fix permissions of files

Change-Id: I22958892d846da348325ba608084f8d9a05473d4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAdded change log for 5.4.0
Simon Hausmann [Sat, 29 Nov 2014 08:55:50 +0000 (09:55 +0100)]
Added change log for 5.4.0

Change-Id: Ie3e238a3ccac1d95978229316977d131be3010d6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoRegression: Fix array data corruption
Simon Hausmann [Mon, 1 Dec 2014 09:21:27 +0000 (10:21 +0100)]
Regression: Fix array data corruption

When inserting into a sparse JS array, we may have to re-allocate the
underlying data vector. When that happens we must reload the ArrayData
pointer, to avoid returning a wrong pointer in ArrayData::insert.

This patch also fixes the valgrind support in the memory allocator by correctly
marking the mmap'ed memory region as inaccessible.

Change-Id: I86aabc2cec74a4f3c8396463910d90c8968a741d
Task-number: QTBUG-42956
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoSkip tst_qquickwindow::headless() when using ANGLE/Windows.
Friedemann Kleint [Mon, 1 Dec 2014 09:45:00 +0000 (10:45 +0100)]
Skip tst_qquickwindow::headless() when using ANGLE/Windows.

The test crashes frequently.

Task-number: QTBUG-42967
Change-Id: Ic17c6187bfa657154a9b04eb9c5b9a3de291cb1e
Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoFix loading of .ui.qml form files with cached compilation units
Simon Hausmann [Mon, 24 Nov 2014 14:52:42 +0000 (15:52 +0100)]
Fix loading of .ui.qml form files with cached compilation units

Simplify the type loading logic and try the Type -> Type.qml and Type ->
Type.ui.qml mapping in a simple loop that tries off-disk and cached
compilation unit loading.

Change-Id: I537feabd0a158a71f330bede9e6988291298ae81
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoDon't default to HighQualitySubPixelAntialiasing on WinRT
Andrew Knight [Fri, 28 Nov 2014 11:43:12 +0000 (13:43 +0200)]
Don't default to HighQualitySubPixelAntialiasing on WinRT

The subpixel shader is probably not a good default here because most
devices are mobile (can change screen orientation) and have high pixel
densities. Furthermore, it breaks text rendering on the Surface RT, where
the graphics hardware is too weak to support the number of uniforms the
subpixel shader uses.

Task-number: QTBUG-41769
Change-Id: I10210af91976ab55e611025c0452a1ee1f3114a9
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoMake effectiveDevicePixelRatio() return a qreal.
Morten Johan Sørvig [Tue, 25 Nov 2014 13:22:15 +0000 (14:22 +0100)]
Make effectiveDevicePixelRatio() return a qreal.

Fractional scale factors are not as broken as previously
believed, especially for Qt Quick. Keep the door open
for finding a way to support it at some point in the
future.

Change-Id: Ifeadcc53175ac6c25ea0288d5fe1966e3de408f9
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoAdd missing call to rendercontrol
Laszlo Agocs [Sat, 22 Nov 2014 20:17:34 +0000 (21:17 +0100)]
Add missing call to rendercontrol

Change-Id: Ic8c8e6d7a9d99216292b8b4faa2926d849333a05
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
9 years agoAdd since 5.4 markers
Albert Astals Cid [Tue, 25 Nov 2014 21:56:30 +0000 (22:56 +0100)]
Add since 5.4 markers

Change-Id: Ic0e594cb53016e6f68fbfb6e6064707344afefef
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoStabilize tst_qquickflickable.
Friedemann Kleint [Wed, 26 Nov 2014 09:01:15 +0000 (10:01 +0100)]
Stabilize tst_qquickflickable.

- Use one engine per test
- Use QQuickView for the margins test
- Verify QWindow cleanup.

Change-Id: Id2a10b56101832c362822963a2a7bd1d66daa143
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoDocument Qt.application.supportsMultipleWindows property.
Mitch Curtis [Thu, 13 Nov 2014 15:30:03 +0000 (16:30 +0100)]
Document Qt.application.supportsMultipleWindows property.

The documentation was not added in
0df606e2ab8f3b60e1ad57dba245acf2e7810612.

Change-Id: I0a5802a66021e17d1280f3969981c9e8a62c8119
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
9 years agoMerge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into refs/staging/5.4
Frederik Gladhorn [Fri, 21 Nov 2014 12:47:31 +0000 (13:47 +0100)]
Merge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into refs/staging/5.4

9 years agoMerge remote-tracking branch 'origin/5.4.0' into 5.4
Frederik Gladhorn [Fri, 21 Nov 2014 12:45:07 +0000 (13:45 +0100)]
Merge remote-tracking branch 'origin/5.4.0' into 5.4

Change-Id: I2e7fc085663e00dd0390593a91c30d23d1369c4e

9 years agoFix multirow spritesheet rendering in paused state
Joni Poikelin [Thu, 20 Nov 2014 12:10:03 +0000 (14:10 +0200)]
Fix multirow spritesheet rendering in paused state

Task-number: QTBUG-42777
Change-Id: I8027f100c593ae7c57df7c952e66cc2b3fae1dd9
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoDo not send deferred deletes from QQuickRenderControl::invalidate()
Laszlo Agocs [Mon, 17 Nov 2014 15:11:22 +0000 (16:11 +0100)]
Do not send deferred deletes from QQuickRenderControl::invalidate()

Leave it up to the clients of QQuickRenderControl to do this, if they
want it. It is usually not necessary.

In the single-threaded widget world forcing deferred deletes to execute
on every invalidate(), so for example from the hide event handler of
QQuickWidget, is dangerous because widget apps tend to deleteLater()
all sorts of widgets which can then be destroyed at unexpected times.

From windowDestroyed() we continue to send the deferred deletes, just
like all the render loops do.

Task-number: QTBUG-42618
Task-number: QTBUG-40435
Change-Id: I8189124e2e7675361ee97bd8ba3e88b10ef193fa
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoDoc: removed reference to sizeHint
Nico Vertriest [Mon, 27 Oct 2014 13:58:40 +0000 (14:58 +0100)]
Doc: removed reference to sizeHint

sizeHint is not a property of QQuickView
Task-number: QTBUG-39044
Change-Id: I6e19e975ab71f73ddaf703956afb90f2e607b6f8
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix render control docs
Laszlo Agocs [Thu, 13 Nov 2014 13:47:21 +0000 (14:47 +0100)]
Fix render control docs

Fix a typo and add a note to the signals.

Change-Id: Ia8810562c5b5f192d7e54bc965807b8e78a26985
Reviewed-by: Karim Pinter <karim.pinter@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
9 years agoInvalidate font caches when switching between threads
Eskil Abrahamsen Blomfeldt [Thu, 16 Oct 2014 14:57:08 +0000 (16:57 +0200)]
Invalidate font caches when switching between threads

The font caches can only be used from a single thread at a time.
QFontEngineFT for instance, uses a global static thread storage
which is accessed on releasing and creating engines, and this
causes a crash if the font engine is created on one thread and
released on another.

We use the updatePolish() function to make sure the caches are
empty before entering updatePaintNode(), and then we invalidate
the cache again after updatePaintNode() is done.

[ChangeLog][Text] Fixed uncommon crash in text nodes.

Change-Id: I01dbc2ed58aeebd03d77a157c700330334bdb385
Task-number: QTBUG-38800
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
9 years agoexample, touchinteraction: use forceActiveFocus to gain focus
Richard Moe Gustavsen [Wed, 12 Nov 2014 19:47:23 +0000 (20:47 +0100)]
example, touchinteraction: use forceActiveFocus to gain focus

Use forceActiveFocus to gain focus when the user clicks on
a note. Just setting focus on an item is not enough to gain
keyboard focus.

Change-Id: Ia4a68a17df0df4b321cc6edb646b39c36167e982
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
9 years agoDoc: Change the div classes for three-column layout
Topi Reinio [Wed, 5 Nov 2014 11:24:53 +0000 (12:24 +0100)]
Doc: Change the div classes for three-column layout

The new documentation style for publishing docs under qt.io
requires dedicated div classes for pages that use a three-
column layout.

The new divs enable the columns to stack and react to changes
in the window width.

Task-number: QTBUG-42086
Change-Id: Id0ccb0ef7e0be237789b8c891db05413efc1f8aa
Reviewed-by: Martin Smith <martin.smith@digia.com>
9 years agoAdd padding to distance field glyph cache
Eskil Abrahamsen Blomfeldt [Thu, 6 Nov 2014 11:10:00 +0000 (12:10 +0100)]
Add padding to distance field glyph cache

Linear filtering can cause pixels outside the glyph's bounding rect
to be sampled. On drivers where uninitialized texture data is actually
uninitialized, this could cause artifacts in rendering for glyphs at
the right edge of the initiliazed area since they would sometimes sample
random pixels. To avoid this, we add padding between the glyphs in the
cache.

[ChangeLog][Qt Quick] Fixed uncommon artifacts in rendering of distance
field glyphs.

Task-number: QTBUG-42148
Change-Id: I6982b4a150d9459185d50a4362e1ead588d3860f
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
9 years agoDon't embded qmldbg_tcp plugin to libQt5Qml in static build
Pasi Petäjäjärvi [Fri, 24 Oct 2014 08:31:38 +0000 (11:31 +0300)]
Don't embded qmldbg_tcp plugin to libQt5Qml in static build

Embedding qmldbg_tcp sources to libQt5Qml causes multipled
definitions of QTcpServerConnection symbols with static
build on Qt Quick 2 applications. Qmake can resolve
dependencies to static plugins applications use, so no
need to embed this to libQt5Qml.

Change-Id: I18c5e44b9ac3de4ef8be29cc5944de3527566b3c
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
9 years agoqml: obey QT_NO_REGULAREXPRESSION define
Pasi Petäjäjärvi [Fri, 24 Oct 2014 08:44:30 +0000 (11:44 +0300)]
qml: obey QT_NO_REGULAREXPRESSION define

Not all platforms do have QRegularExpression as it is based on
pcre.

Change-Id: I3247f8b2213f78a6e537f6781d97b0c6382482ad
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRevert "Fix pixel bleed in BorderImage"
Eskil Abrahamsen Blomfeldt [Mon, 10 Nov 2014 13:22:05 +0000 (14:22 +0100)]
Revert "Fix pixel bleed in BorderImage"

This reverts commit a9238292145e05d36be7c35bdd50829c6400a3de.

It also reverts follow-up commits:
  87755d0437413cfb875c50e3dfa53030601567c9
  c2c710e5a8d66fa696276aa69c2e3b00436eefe5
  cc8a76ce8ea76afe912902067e95ca2abf9e482f

The new implementation is much too slow because it will cause each
section of the border image to be uploaded to the atlas, and it will
not be shared between different border images nor between different
sizes of the border. The performance regression is so significant
that it's not worth it for the original bug fix.

We leave the tests around, so some of those might regress due to
this.

Change-Id: I3f56f4564255ebb77e6487881a6a11b19ad0234e
Task-number: QTBUG-42288
Task-number: QTBUG-35838
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agoMerge "Merge remote-tracking branch 'origin/5.4' into 5.4.0" into refs/staging/5.4.0
Jani Heikkinen [Mon, 10 Nov 2014 15:06:02 +0000 (16:06 +0100)]
Merge "Merge remote-tracking branch 'origin/5.4' into 5.4.0" into refs/staging/5.4.0

10 years agoMerge remote-tracking branch 'origin/5.4' into 5.4.0
Oswald Buddenhagen [Mon, 10 Nov 2014 10:42:05 +0000 (11:42 +0100)]
Merge remote-tracking branch 'origin/5.4' into 5.4.0

Change-Id: I2c69deb3bc69da1a06485aaf72fb298b08756734

10 years agoFix not having a context when cleaning up on Windows
Laszlo Agocs [Thu, 6 Nov 2014 21:06:26 +0000 (13:06 -0800)]
Fix not having a context when cleaning up on Windows

The same old issue surfaces in the windows render loop too.
The basic render loop is already fixed, apply a similar patch
to the windows one too.

Task-number: QTBUG-42213
Change-Id: I07068315f5164014e329b8ce061947c97ae9da61
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
10 years agoqmlscene: Simplify context sharing logic.
Pierre Rossi [Tue, 28 Oct 2014 14:40:49 +0000 (15:40 +0100)]
qmlscene: Simplify context sharing logic.

We can use the new application attribute for this now.

Change-Id: Ia0a6d13d36316ec9becfb5d3251b8461ac73a2d0
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoQQuickWindow: let 'clearFocusObject' clear all the way to the root
Richard Moe Gustavsen [Fri, 7 Nov 2014 10:33:14 +0000 (11:33 +0100)]
QQuickWindow: let 'clearFocusObject' clear all the way to the root

The previous code was wrong, as it cleared focus from the active
focus item directly. By doing so we would only clear focus inside
the focus scope that surrounded the item, but leave the scope itself
with active focus (which would then be the focus object). The intended
result is rather to end up with the root as focus object.

Change-Id: I455a8939f8bc6c48765119b995aa781aee6d1e70
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
10 years agoQQuickWindow autotest: verify that onClosing can block close()
Shawn Rutledge [Fri, 7 Nov 2014 11:54:16 +0000 (12:54 +0100)]
QQuickWindow autotest: verify that onClosing can block close()

Task-number: QTBUG-40093
Change-Id: I800259f45d95736172d500494e68042180178e93
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
10 years agoDebug: Make it possible to save distance field cache on Windows
Eskil Abrahamsen Blomfeldt [Thu, 6 Nov 2014 10:35:35 +0000 (11:35 +0100)]
Debug: Make it possible to save distance field cache on Windows

This makes compilation possible of the saveTexture() function which is
used to store the distance field glyph cache on disk when debugging.
It also changes the warnings output from here to have no prefix, since
this is anyway always available as the context in Qt 5.

Change-Id: If3b64f0921a59c485b5321a5465369708e764afc
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
10 years agoInspector: Do not assert when trying to stream QModelIndex
Kai Koehne [Thu, 6 Nov 2014 10:43:19 +0000 (11:43 +0100)]
Inspector: Do not assert when trying to stream QModelIndex

Some QVariant's like QModelIndex cannot be streamed in a meaningful way:
QDataType::save() will return false for them. However, this leads to a
qWarning and Q_ASSERT in QVariant::operator<<().

To prevent this we're calling QDataType::save() manually beforehand. We
however throw away the result if it succeeds, and still call
QVariant::operator<<() to get the benefits of the QDataStream version
handling.

The alternatives would be to make QVariant::operator<<() not assert,
or blacklist all known types with problems manually. Both seem to
be difficult though ...

Change-Id: I4f5fe6d5a3a076c24fbc73371a4d12d720de53da
Task-number: QTBUG-42438
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAvoid stack overflow when destroying InternalClass
Ulf Hermann [Thu, 6 Nov 2014 13:40:37 +0000 (14:40 +0100)]
Avoid stack overflow when destroying InternalClass

If there are deep object hierarchies connected to an InternalClass the
recursive nature of the destroy() method could lead to a stack
overflow. By changing the recursion into an iteration this is avoided.

Change-Id: I6667f268a366749c2dbc5f7147882388f192a9c5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoStabilize tst_QQuickAccessible
Jan Arve Sæther [Thu, 6 Nov 2014 09:53:49 +0000 (10:53 +0100)]
Stabilize tst_QQuickAccessible

There is no reason to wait for the window to activate

Task-number: QTBUG-42355
Change-Id: I5faaff5bddd367e6dd57a6a922011c87c847148e
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
10 years agoInitialize member variable QSGAnimationDriver::m_lag.
Friedemann Kleint [Wed, 5 Nov 2014 08:22:11 +0000 (09:22 +0100)]
Initialize member variable QSGAnimationDriver::m_lag.

Fixes purify warning:
[W] UMR: Uninitialized memory read in QSGAnimationDriver::advance(void) {1 occurrence}
QSGAnimationDriver::advance(void) [qtdeclarative\src\quick\scenegraph\qsgcontext.cpp:221]

Task-number: QTBUG-42213
Change-Id: Ide35830c60c5935644747da5cfbad1cdbd357232
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
10 years agoqv4: assign split of edges to loop header to the correct group
Fawzi Mohamed [Wed, 5 Nov 2014 10:27:15 +0000 (11:27 +0100)]
qv4: assign split of edges to loop header to the correct group

(i.e assign split edges to the correct loop group, now for real)
The fix of 25b6fae1eb26645a30b3e7e254ce0b585757351c did try fix QTBUG-41766
and simplify the logic to assign the inserted statement to a loop group.
Unfortunately that was incorrect if the target basic block starts a group.
In that case if the source was already inside the group we should add it
to the target basic block, otherwise to the one containing the target
block (as before).
There was no visible regression caused by this.

Change-Id: Id50c42305fc5ac6aedaffa89d8f8dc3b5e976aa4
Task-number: QTBUG-41766
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAdd attached Window::contentItem property
J-P Nurmi [Mon, 3 Nov 2014 16:23:11 +0000 (17:23 +0100)]
Add attached Window::contentItem property

This is essential to the Qt Quick Controls for implementing floating
text selection handle popups.

Change-Id: Ibae65110a5db6d65dacd197fef3ad567d11342dc
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
10 years agoMark cleanup function as unused if compiled with QT_QML_NO_DEBUGGER
Ulf Hermann [Wed, 5 Nov 2014 13:02:55 +0000 (14:02 +0100)]
Mark cleanup function as unused if compiled with QT_QML_NO_DEBUGGER

The static cleanup function in qqmldebugserver.cpp is only used if the
debug server is actually created. If not we can mark it as unused to
avoid compile warnings. Enclosing it in #ifdef would be uglier.

Task-number: QTBUG-42394
Change-Id: Ieb7fa38ecb346e80ce815ced85eb3a168bad9d99
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAdd a debug function to save contents of distance field cache
Eskil Abrahamsen Blomfeldt [Wed, 5 Nov 2014 12:35:12 +0000 (13:35 +0100)]
Add a debug function to save contents of distance field cache

Just copy the one from QSGSharedDistanceFieldCache with some
compile fixes to the superclass so we store the default cache
as well.

Change-Id: I1fcc390601eea58f8b7729c9cead418e4c94714c
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
10 years agoDocumentation: Update QtQuick import value to 2.4
Caroline Chao [Wed, 5 Nov 2014 09:57:45 +0000 (10:57 +0100)]
Documentation: Update QtQuick import value to 2.4

There are new APIs in Qt 5.4, the import version needed is 2.4.

Change-Id: I1c52c6a50362f539670d9ad00e03e57208234a17
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agoqv4: assign split edges to the correct loop group
Fawzi Mohamed [Tue, 4 Nov 2014 13:55:26 +0000 (14:55 +0100)]
qv4: assign split edges to the correct loop group

edge splitting had a strange logic to assign the inserted statement to a loop,
which would go wrong for example for the statement just after the loop header.
I guess that was done to increase the likelihood that the goto removed from the
final instructions.
Given that we are talking about critical edges it is always possible to emit
them in a bad order, and I do not think that the old logic was really better
than simply always use the loop group of the target which is always correct.
It might be worthwhile to ensure that the block it is emitted just before the
target block, or improve the handling of empty gotos in the backend, but in this
patch we go for the simplest solution.
If one would notice worse code, either one of the provious improvements could be
done, or the old logic could be kept, changing just the if (container == 0) to
container = toBB->containingGroup();

Change-Id: I26a488e9e2cb2b692fa8187ee658fb4dd98bfa8b
Task-number: QTBUG-41766
Reviewed-by: Bernd Lamecker <bernd.lamecker@basyskom.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix memory leak in QQmlLocaleData
Liang Jian [Tue, 4 Nov 2014 09:18:15 +0000 (17:18 +0800)]
Fix memory leak in QQmlLocaleData

Call the correct destructor in QQmlLocaleData::destroy() to prevent memory
leak.

Change-Id: Id5b7657443521fbb46486bfbc5575d914c7c7b71
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix disappearing nodes when adding in two levels of batch root
Eskil Abrahamsen Blomfeldt [Thu, 30 Oct 2014 08:08:00 +0000 (09:08 +0100)]
Fix disappearing nodes when adding in two levels of batch root

When having e.g. a clip node inside another clip node and adding
children to the innermost, we would get into the situation where
we did a partial rebuild for the outermost root, but its available
render order count would not be updated to reflect the change
deeper down in the tree. Since the z range would be based on the
outermost batch root's knowledge of the maximum render order in
the tree, what would happen is that the z of the rendered nodes
would increase steadily until they went outside of the viewing
volume and disappeared.

When decreasing the available order count of a batch root, we need
to also decrease the available order count of its parents. If any
of them drop below zero, we need to rebuild the render lists.

[ChangeLog][QtQuick] Fixed nodes sometimes disappearing when
adding many new nodes to the tree.

Change-Id: I39c34acf0e1e0e87601f0fcd983f8da38cee029f
Task-number: QTBUG-42096
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
10 years agoFix memory leak in QV4::QQmlSequence
Liang Jian [Tue, 4 Nov 2014 00:32:28 +0000 (08:32 +0800)]
Fix memory leak in QV4::QQmlSequence

Use the correct destructor in QV4::QQmlSequence::destroy() to prevent
memory leak

Change-Id: If9531f731abe5cd9aecfb9642ebf4f5108978f99
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDoc: Qt Quick Designer UI forms
Leena Miettinen [Tue, 28 Oct 2014 13:41:13 +0000 (14:41 +0100)]
Doc: Qt Quick Designer UI forms

Since Qt Creator 3.3 and Qt 5.4, Qt Quick Designer
handles .ui.qml files that are similar to the .ui
files of Qt Designer.

Change-Id: I147e82a111ca7d3b806c4c6c94cc73b35a67785b
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
10 years agoFix memory leak caused by QV4::ErrorObject
Jian Liang [Sun, 2 Nov 2014 11:01:23 +0000 (19:01 +0800)]
Fix memory leak caused by QV4::ErrorObject

We should destruct QV4::ErrorObject::Data instead of QV4::ErrorObject in
QV4::ErrorObject::destroy() since all the members is stored in
QV4::ErrorObject::Data.

Task-number: QTBUG-42340
Change-Id: Ifff6413c0726591c335a421a5f289c1886f80980
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDon't use qDebug and qWarning for formatted output
Thiago Macieira [Tue, 2 Sep 2014 19:21:04 +0000 (12:21 -0700)]
Don't use qDebug and qWarning for formatted output

They are not meant to be used like that. If you want formatted output to
the console, use stdio.h functions or std::cout. Otherwise, you get
something like:

 $ qmlscene -h
 [233103.196] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?): Usage: qmlscene [options] <filename>
 [233103.197] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?):
 [233103.197] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?):  Options:
 [233103.198] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?):   --maximized ............................... Run maximized
 [...]

I've replaced all qDebug with puts/printf and most qWarning with fprintf
to stderr. In my opinion, some of the qWarnings aren't errors, so I
replaced those with puts/printf too.

Change-Id: I3e493950bc4a588059fec6c7441b010c2780dffd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoGet rid of !this and similar constructs
Lars Knoll [Thu, 30 Oct 2014 21:30:01 +0000 (22:30 +0100)]
Get rid of !this and similar constructs

The C++ standard doesn't allow calling member functions
on a mull object. Fix all such places, by moving the checks
to the caller where required.

Change-Id: I10fb22acaf0324d8ffd3a6d8e19152e5d32f56bb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDon't allocate less memory than required
Lars Knoll [Fri, 31 Oct 2014 09:40:14 +0000 (10:40 +0100)]
Don't allocate less memory than required

When switching from a simple to a sparse array,
keep the previously allocated size, to not corrupt
memory.

Change-Id: I33f0fb049a2ad6f24ee3703f2c333855830fe9d2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoBorderImage: Fix white area when size changes after first paint
Eskil Abrahamsen Blomfeldt [Mon, 27 Oct 2014 11:55:54 +0000 (12:55 +0100)]
BorderImage: Fix white area when size changes after first paint

When e.g. growing the size of the border image in an animation,
we would not get updates of the paint nodes when the size was
so small that the bounded target rect and source rect did not
change (when the size was smaller than the sum of the borders).
Since this can happen, we also need to detect when the size
changes and update the node for this case.

Task-number: QTBUG-42022
Change-Id: I0849d740f363e66a3a4fd6de23fc9d7399ab0779
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
10 years agoFix ICC-on-Mac warning about unknown #pragma
Thiago Macieira [Thu, 30 Oct 2014 21:10:34 +0000 (14:10 -0700)]
Fix ICC-on-Mac warning about unknown #pragma

qqml.h(506): warning #161: unrecognized #pragma

Change-Id: I089007db4c4d0701eff32ce0b1c2fff1f65d5c48
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix Canvas documentation.
Mitch Curtis [Tue, 28 Oct 2014 09:04:08 +0000 (10:04 +0100)]
Fix Canvas documentation.

getContext documentation wasn't showing up due to a syntax error:

"any ..."

Also fixed some small issues here and there.

Change-Id: I3c0444d25bd0fea72fb4fcbf07b3e00794ff1414
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
10 years agotext input: always let cursor rect have a width == 1
Richard Moe Gustavsen [Tue, 14 Oct 2014 08:44:47 +0000 (10:44 +0200)]
text input: always let cursor rect have a width == 1

Instead of using a cursor width of null when a cursor
delegate is set, we should to use a value of 1.
Otherwise the rect we e.g return from cursorRect() will
be invalid. An alternative would be to use the width of
the delegate, but that was found to be controversial.

On iOS we saw a bug with this when telling iOS to position
text spelling popups underneath the cursor. Since the
cursor rect we got was invalid (zero-width), no popup
would show.

Change-Id: Ice51b9a1bd33f331183e3acec61b7d9c0f5163cd
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
10 years agoRepeater & itemviews: fix setModel() JS array handling
J-P Nurmi [Wed, 29 Oct 2014 12:59:46 +0000 (13:59 +0100)]
Repeater & itemviews: fix setModel() JS array handling

QVariant comparison in setModel() started failing because
JS arrays are now passed as a QJSValue. Re-assigning the
same array content should not trigger a model change.

This change restores the old behavior it had before, when
JS arrays were passed as QVariantLists.

Change-Id: I1882b3531f2893b116dbd817edeecab1ae812ce8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove mouse grabber if touch used for mouse emulation has been grabbed
Daniel d'Andrada [Fri, 10 Oct 2014 19:54:39 +0000 (16:54 -0300)]
Remove mouse grabber if touch used for mouse emulation has been grabbed

If an item grabs a touch that is currently being used for mouse pointer
emulation, the current mouse grabber should lose the mouse as mouse
events will no longer be generated from that touch point.

Example of what happens without this patch:
-User touches a MouseArea. It gets pressed.
-Some other item grabs that touch.
-This touch eventually ends.
-The MouseArea would still be pressed.
And what will happens instead after this patch:
-User touches a MouseArea. It gets pressed.
-Some other item grabs that touch.
-The MouseArea gets canceled and released
-This touch eventually ends.

Change-Id: I24114f18be564553a4a768243bb20379affe7a8f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
10 years agoRevert: use the new form of QTranslator::load() for more flexibility
Shawn Rutledge [Thu, 16 Oct 2014 08:10:04 +0000 (10:10 +0200)]
Revert: use the new form of QTranslator::load() for more flexibility

This reverts commit 427646b8d7c52e5b84240e07ffd391217ce3bfa8.
It seems that it should have been more correct, but we are still not
shipping English translations, and static QString find_translation()
in qtranslator.cpp will return any language which is in
QLocale::uiLanguages() for which the translation file is found.
That is a long list on OSX.

Reverting the patch means find_translation() is not called in
such cases.  This change can be re-done whenever we are more sure
that the attempt to find a translation will succeed in finding a
sensible one, or fall back to not translating, rather than choosing
a language that the user didn't intend.

Task-number: QTBUG-41977
Change-Id: I425946cc71cec96b4f38629eb2b7e80220c5236d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
10 years agoDo not crash QML apps on startup
Jan Arve Saether [Tue, 28 Oct 2014 08:59:23 +0000 (09:59 +0100)]
Do not crash QML apps on startup

This started crashing because of 8f6436f125faae91eb472ddddbbae06dba5da671

Task-number: QTBUG-42227
Change-Id: I9e4862f6008c6ad6ec54469f2b39dd6be583e422
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
10 years agoDon't document Context2D's TextMetrics as its own QML type.
Mitch Curtis [Wed, 22 Oct 2014 10:43:42 +0000 (12:43 +0200)]
Don't document Context2D's TextMetrics as its own QML type.

It can't be instantiated like a QML type, so it's actually better to
just document measureText() (which is the only way to construct objects
of this type) as returning an object containing some metrics for the
current font. This should have no effect on user code.

This solves the issue of the new TextMetrics type's documentation not
showing up. TextMetrics is a type that *can* be instantiated and is
more feature complete. It provides a declarative API for the functions
that take arguments in QFontMetrics.

Change-Id: I46251e6f3aa7179ab569f5131307181f71043df4
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
10 years agoReduce memory pressure on system malloc when allocating large items on the GC heap
Simon Hausmann [Mon, 27 Oct 2014 12:51:27 +0000 (13:51 +0100)]
Reduce memory pressure on system malloc when allocating large items on the GC heap

Try to free our large items for every 8 megabytes of additional large item
memory we allocate. This helps in particular on 32-bit builds and was noticable
in tst_qqmlecmascript::push_and_shift().

Change-Id: I4cc0b188e58ccaf32026e38c7aaf1cfadc83148b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDon't check the this pointer for 0 in member functions
Lars Knoll [Mon, 27 Oct 2014 07:54:26 +0000 (08:54 +0100)]
Don't check the this pointer for 0 in member functions

This actually violates the C++ standard that defines that
you aren't allowed to call member functions on an invalid
object.

Instead insert the 0 pointer checks on the caller side where
required.

Change-Id: I8be3c3831594bb6482e9ef6de6e590ec437ac0f8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoReduce size of ArrayData by one pointer
Lars Knoll [Wed, 22 Oct 2014 14:00:35 +0000 (16:00 +0200)]
Reduce size of ArrayData by one pointer

The pointer to the real data is not required anymore, as
it always follows the class itself. Like this we save one
pointer of overhead, and one indirection when doing reads
and writes of array data.

Change-Id: If6afdac8e97b57420b50e7b7eb8979f77e8dbbcf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRework our simple array implementation
Lars Knoll [Tue, 21 Oct 2014 12:54:45 +0000 (14:54 +0200)]
Rework our simple array implementation

Implement the simple array as a circular buffer instead
of an array with head room. This fixes a couple of severe
issues with performance and memory management if the array
is being used as a queue.

Task-number: QTBUG-41421
Change-Id: I146ad8a874407c108aa8fe1eae68e9957e154847
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix QQmlTypeData object leak
Jian Liang [Sat, 25 Oct 2014 09:15:49 +0000 (17:15 +0800)]
Fix QQmlTypeData object leak

Drop the refcount added in QQmlTypeLoader::getType() to prevent object
leakage in resolveQmlType.

Change-Id: I8bd9c486294912cc00ce5feb350c3ff79c6aac09
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMove action handlers to the Accessible attached object
Jan Arve Saether [Wed, 15 Oct 2014 11:58:34 +0000 (13:58 +0200)]
Move action handlers to the Accessible attached object

With this change, instead of writing:

    function accessiblePressAction() { submit() }

You should write:

    Accessible.onPressAction: { submit() }

For the moment, only 4 actions are added:
press, toggle, increase and decrease.

The old style action handlers are deprecated, and removed from the
documentation. New style action handlers will be preferred in case an
item declares both styles.

Change-Id: I11919e631d8476d55540f94252757b911c44ade4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
10 years agoFix leaks in QQuickImageParticle
Jocelyn Turcotte [Thu, 23 Oct 2014 14:01:57 +0000 (16:01 +0200)]
Fix leaks in QQuickImageParticle

Make sure that ImageData instances, m_shadowData as well as the
QSGGeometry of particle nodes are destroyed together with their
QQuickImageParticle.

Also implement the assignment operator for QQuickParticleData to
avoid its v8Datum pointer to be copied over to the shadow datum
in getShadowDatum. This would cause a double delete of the
QQuickV4ParticleData when trying to call clearShadows() in the
destructor.

Task-number: QTBUG-36782
Change-Id: Ie03f2be0415daeb7f4f6e5f92295a3ab26a62155
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
10 years agoQML State Machine plugin: correct URL in Q_PLUGIN_METADATA
Shawn Rutledge [Fri, 17 Oct 2014 06:46:30 +0000 (08:46 +0200)]
QML State Machine plugin: correct URL in Q_PLUGIN_METADATA

org.qt-project.org is redundant

Change-Id: Id6a6794e1fc1e4403b3bfcdebbe06a487f904041
Reviewed-by: Sebastian Sauer <sebastian.sauer@kdab.com>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
10 years agoRemove logic that some accessible objects cannot have children
Frederik Gladhorn [Thu, 16 Oct 2014 12:18:19 +0000 (14:18 +0200)]
Remove logic that some accessible objects cannot have children

There are many places where this doesn't make sense (a button in a
search field, a line in a list represented as button with a child button
to remove the list item...).

Change-Id: Iab1d411adda696a01b1dcfdebb0a250066d6a7c2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
10 years agoExpose searchEdit accessible property to Qt Quick
Frederik Gladhorn [Thu, 16 Oct 2014 16:01:22 +0000 (18:01 +0200)]
Expose searchEdit accessible property to Qt Quick

Change-Id: I9230deaa75d1e9a9614f364d4adf92349c8a1901
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
10 years agoProperly handle negative years when printing JS Dates to strings.
Ulf Hermann [Fri, 24 Oct 2014 13:06:22 +0000 (15:06 +0200)]
Properly handle negative years when printing JS Dates to strings.

JavaScript knows a year 0. That is correctly translated into QDateTime
terms when creating a Date object, but it's not correctly translated
back when converting the JavaScript date to a string.

Task-number: QTBUG-29491
Change-Id: I46b200a144434187656d08e87f422f97523acd0e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix syntax error when trying to declare read-only object properties
Simon Hausmann [Thu, 23 Oct 2014 10:05:44 +0000 (12:05 +0200)]
Fix syntax error when trying to declare read-only object properties

The grammar did not allow for the declaration of

    readonly property QtObject foo: QtObject { ... }

and it required a workaround through an alias:

    readonly property alias foo: _foo
    property QtObject _foo: QtObject { ... }

This was merely a glitch in the grammar, I see no reason not to support this.
The semantics are like a const pointer in C++, the property itself is read-only
but the object pointed to has per-property defined read/write semantics.

Task-number: QTBUG-41971
Change-Id: I99e2e7ed58731e387a38e46ec39922d280a21ceb
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix license headers in Qml grammar specification
Simon Hausmann [Thu, 23 Oct 2014 07:50:12 +0000 (09:50 +0200)]
Fix license headers in Qml grammar specification

The grammar file itself wasn't updated accordignly and the license headers that
are embedded in the grammar that will be copied into the generated files were
also oudated. Re-generating the parser would produce files with the wrong
license headers.

Change-Id: I1db83df8a9c4bddfb58901f41a4d40f6b1396507
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix crash in SpriteSequence
Alex Blasche [Mon, 20 Oct 2014 11:07:21 +0000 (13:07 +0200)]
Fix crash in SpriteSequence

When QML declares sprites and goalSprite in wrong order the goalsprite
attempts to set it on null spriteEngine. This patch ensures that the
order doesn't matter anymore.

Task-number: QTBUG-40595
Change-Id: I57f1c8754b2e2af91e0c7f72d1d67fec3ad4ede5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDoc: Updated the code snippets for the toLocalexxx functions
Venu [Thu, 23 Oct 2014 14:32:47 +0000 (16:32 +0200)]
Doc: Updated the code snippets for the toLocalexxx functions

Using Date() as a regular function without the new operator
returns a string and not a date object.

Change-Id: I083bb62c0cb3041a053d43e3085c3d0d10423db6
Task-number: QTBUG-41712
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>