platform/upstream/qtdeclarative.git
10 years agoExtend the QML bootstrap library by the IR builders
Simon Hausmann [Wed, 12 Mar 2014 15:55:06 +0000 (16:55 +0100)]
Extend the QML bootstrap library by the IR builders

This is among other things needed to fix the qml import scanner to detect
dependencies from .js files correctly.

The patch also fixes the use of Q_QML_EXPORT towards Q_QML_PRIVATE_EXPORT
where appropriate and corrects the wrong include path for the double conversion
code to actually be relative to the file it is included from. This worked by
accident because of other include paths present in the build.

Change-Id: I338583dad2f76300819af8ab0dae8e5724c84430
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake the Clocks example use the resource system
Topi Reinio [Tue, 22 Apr 2014 11:32:56 +0000 (13:32 +0200)]
Make the Clocks example use the resource system

Make the Clocks example use the Qt resource system and the
shared main(), in order to have easy deployment to all
platforms and support for shadow builds.

Task-number: QTBUG-37203
Change-Id: Ia235b6b2397cfaeb20f0c7ea0d6196c603b20099
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoImplement the new inputmethod query API for Qt Quick
Paul Olav Tvete [Thu, 16 Jan 2014 09:42:47 +0000 (10:42 +0100)]
Implement the new inputmethod query API for Qt Quick

Part fixing Android input methods. This change corresponds
to 68a9229a97d358639 in the qtbase repository.

Task-number: QTBUG-37511
Change-Id: I483abf6a9d5dec86dbd1ae2dff2a85bc19d126f1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoIf a popup window is opened, do not change the focus
Shawn Rutledge [Wed, 22 Jan 2014 13:25:48 +0000 (14:25 +0100)]
If a popup window is opened, do not change the focus

It's not working to have QQuickWindow lose focus every time a menu is opened.
This doesn't happen on OSX because menus are implemented as special native
ones, but on X11 a menu is another window.  In QtQuick Controls it's
useful for copy/cut/paste Actions to be enabled based on whether
some text has focus.

Change-Id: I092b46133b9a8a44639ad9d89ee2bdfe30206bd9
Task-number: QTBUG-36292
Task-number: QTBUG-36332
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
10 years agoqmlplugindump: correctly merge composite types
Fawzi Mohamed [Wed, 9 Apr 2014 13:42:06 +0000 (15:42 +0200)]
qmlplugindump: correctly merge composite types

When hiding part of the hierarchy during the merging of composite
types properties/methods/signals that are hidden should not be dumped
twice.

Task-number: QTBUG-38354
Change-Id: I328cf25dd5a70e1c0fce017e8ae572e8a9e56245
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoQQuickItemView/QQuickPathView: Fix creation of delegates
Albert Astals Cid [Tue, 15 Apr 2014 13:27:29 +0000 (15:27 +0200)]
QQuickItemView/QQuickPathView: Fix creation of delegates

When the delegate is set before the model and
after the ItemView/PathView has been created

Task-number: QTBUG-38368
Change-Id: I6963abe28087699cf4e8921153dc7641bae3b220
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
10 years agoMake sure the clipPath is retained as state of Context2D
Ulf Hermann [Fri, 11 Apr 2014 15:28:52 +0000 (17:28 +0200)]
Make sure the clipPath is retained as state of Context2D

The W3C spec doesn't say anything about the clip path getting reset
automatically at any point and so I guess we should retain it. This of
course is terribly annoying if the canvas element gets resized and ends
up with a default clipPath that doesn't match the canvas anymore. You
basically have to call reset() in every onPaint now. However, this just
highlights a general problem with stateful canvas contexts and we cannot
ignore user defined clipPaths like this.

Task-number: QTBUG-38297
Change-Id: I233226af6458298ef3d752d08ecdebebae2e0a8f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoPrevent a crash when the item is deleted but not removed from cache
Andy Shaw [Thu, 17 Apr 2014 08:24:35 +0000 (10:24 +0200)]
Prevent a crash when the item is deleted but not removed from cache

If the item is not removed from the cache when it is deleted then the
cache can end up pointing to an invalid item which when accessed will
cause a crash.

Task-number: QTBUG-38430

[ChangeLog][QtQml] Prevent a crash when the item is deleted
but is not removed from the QQmlDelegateModel's cache.

Change-Id: I8cf76b014be62a432d909a3573231cec84a6d678
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoRefine fix for dynamic properties on QObjects wrapped in JavaScript
Simon Hausmann [Thu, 10 Apr 2014 10:58:15 +0000 (12:58 +0200)]
Refine fix for dynamic properties on QObjects wrapped in JavaScript

This is an ammendment to commit 60730cbb5e5475b5db6a15641211aa6958a93197
to further restrict the ability to set dynamic properties on JS wrapped
QObjects only on those that are associated with a qml context. Only one
such association comes with the static property lookup rules of QML and
therefore only those should be prohibited from dynamic properties.

The previous implementation on using the "compiledData" field to detect QML
association or not is not strong and reliable enough.

Change-Id: I10c0e6e58a2727c01a6cb56fdf912bf250333e1f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
10 years agoV4: fix register usage on ARM.
Erik Verbruggen [Thu, 10 Apr 2014 11:59:32 +0000 (13:59 +0200)]
V4: fix register usage on ARM.

JSC was using r3 as the address scratch register, which collides with
the 4th parameter in a function call. This sometimes shows up when
generateFunctionCall needs to do a calulated jump.

Also fix the usage of r11, which seems to be the fp on some platforms.

Change-Id: Ib2ea64b9342e5aa631db6a7641747f899b2fbd89
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDoc: Improved Qt Quick Demos documentation
Jerome Pasion [Mon, 14 Apr 2014 13:57:57 +0000 (15:57 +0200)]
Doc: Improved Qt Quick Demos documentation

-added include from qtbase/doc/global about running the example.
-added link to "QML Applications" (main landing page for QML)
-highlighted the names with \e
-various documentation changes

Task-number: QTBUG-33597
Change-Id: I9e23b8b61862c424f2a17003b3d1f5b2ef931ceb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agoMark tst_qquicktextinput as insignificant on Mac OS X
Simon Hausmann [Tue, 15 Apr 2014 12:14:15 +0000 (14:14 +0200)]
Mark tst_qquicktextinput as insignificant on Mac OS X

This will allow further integrations until QTBUG-38363 is fixed.

Change-Id: I277628c55b893d199bd1886ee6eb9ff466860a05
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoStabilize tst_qqmlxmlhttprequest::stateChangeCallingContext() on Mac.
Friedemann Kleint [Tue, 15 Apr 2014 07:22:24 +0000 (09:22 +0200)]
Stabilize tst_qqmlxmlhttprequest::stateChangeCallingContext() on Mac.

Fix fails:
tst_qqmlxmlhttprequest::stateChangeCallingContext() '(object->property("success").toBool() == true)' returned FALSE. ()

Debugging reveals that in most cases the function loadComponent()
is only called with parameter which=1; the call with parameter
which=0 never triggers.

Change-Id: I3c9c2f618d52c2bc8dd584a5fc3ab2f115715381
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRegenerate mipmaps after changing the imagedata of a texture.
Gunnar Sletta [Tue, 15 Apr 2014 05:38:30 +0000 (07:38 +0200)]
Regenerate mipmaps after changing the imagedata of a texture.

This has been a latent bug since the class was written, but has
only surfaced after 15999f14f146b5c04fb40b31b69ceeeece273430 when
mipmapping was allowed for all QSGPlainTextures.

Task-number: QTBUG-38321
Change-Id: I058e554c4035c573d2ddb4ea793d8ad53e11e54b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoDisable mipmap filtering by default in texture materials.
Gunnar Sletta [Tue, 15 Apr 2014 05:23:57 +0000 (07:23 +0200)]
Disable mipmap filtering by default in texture materials.

15999f14f146b5c04fb40b31b69ceeeece273430 changed QSGPlainTexture so it
allows mipmap filtering by default. This requires a call to
glGenerateMipmap() for textures to be valid, if mipmap filtering is
used. Our texture materials follow the GL default which is to use the
somewhat useless GL_NEAREST_MIPMAP_NEAREST. As a result we've had a
number of bugs where textures are used and the call to
glGenerateMipmap() is omitted. This happens for instance when using
QQuickTexture::createTextureFromId().

Generating mipmaps by default is also a serious performance regression.

To remedy this and minimize the impact on existing code, we disable
mipmapping by default.

[ChangeLog][QtQuick][SceneGraph] QSGTextureMaterial and
QSGOpaqueTextureMaterial uses QSGTexture::None as default mipmap mode.

Task-number: QTBUG-38321
Change-Id: Ia9d09fbcf710efb4575938053d0a2046f604a197
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix assignments of null strings in QML and JavaScript
Simon Hausmann [Fri, 11 Apr 2014 10:16:44 +0000 (12:16 +0200)]
Fix assignments of null strings in QML and JavaScript

Assigning "" to a string based property would exhibit inconsistent behavior:

  * When assigned as a literal, it would assign an empty string
  * When assigned from JavaScript, it would assign a null string

When the assignment was done _to_ a QByteArray property, it would hit
the case of calling QVariant::convert where the incoming variant is
either an empty or a null string and the target is a QByteArray. For historical
reasons - as documented - QVariant::convert will return false when the
incoming variant is a null variant.

In V8 assignment from JavaScript would produce an empty string and thus
hit the "succesfull" conversion code path in QVariant to convert to a
seemingly empty QByteArray. With v4 a null string would result in a failed
conversion and spurious warnings as seen in the reported task.

This patch ensures that we consistently map "" to a null string, when it comes
from JavaScript or QML as a literal string. We now also detect the situation of
trying to convert a (valid) null variant to another target type.

Task-number: QTBUG-37197
Change-Id: I68f9031262fdd287d69a38d5468fb38a20441d7b
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
10 years agoV4 IR: only mark blocks after iterator calculation as loop blocks.
Erik Verbruggen [Fri, 11 Apr 2014 14:42:55 +0000 (16:42 +0200)]
V4 IR: only mark blocks after iterator calculation as loop blocks.

When the iterator calculation contains a condition, newly created
basic-blocks were marked as loop blocks. However, their parent was not
the loop header.

Task-number: QTBUG-38187
Change-Id: I9ee7a3e0bd536c2a005b91f8333931ce929245af
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAvoid event propagation with Keys.forwardTo
J-P Nurmi [Thu, 10 Apr 2014 19:18:09 +0000 (21:18 +0200)]
Avoid event propagation with Keys.forwardTo

[ChangeLog][QtQuick][Important Behavior Changes] Keys.forwardTo no
longer propagates key events to the target item's parents. This makes
Keys.forwardTo act more as expected, like an event filter. This way
Keys.forwardTo becomes usable for composite types that want to enable
the Keys attached property handling by forwarding key events from an
internal editor.

Task-number: QTBUG-37924
Change-Id: I66d1b7245df39678767e79d4bdd46fc15e5c5c3f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
10 years agoFix the initial value of XmlListModel::count
J-P Nurmi [Wed, 9 Apr 2014 14:00:49 +0000 (16:00 +0200)]
Fix the initial value of XmlListModel::count

QAbstractItemModel::rowCount() should under no circumstances
return -1 or it will crash QSortFilterProxyModel.

Change-Id: Ib3d4a57d5fc3761a7fc6f6925c3d25bdea20ce78
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
10 years agoDocument QJSEngine as reentrant.
Michael Brasser [Thu, 10 Apr 2014 01:13:23 +0000 (20:13 -0500)]
Document QJSEngine as reentrant.

Change-Id: I7fc41b33036bca6736bc24fa62522ce5d30ef1f4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoqmlplugindump: set isCreatable true in composite types
Fawzi Mohamed [Wed, 9 Apr 2014 13:39:05 +0000 (15:39 +0200)]
qmlplugindump: set isCreatable true in composite types

the qmlengine defines isCreatable as "is creatable through the C++
interface", for the qmltypes and qml code model it makes sense to
define isCreatable as "can appear as component in QML"

Change-Id: Ib26cf25dd5a70e1c03ce017e8ae572e8a9e562c1
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
10 years agoReduce memory pressure on JS stack when garbage collecting
Simon Hausmann [Wed, 9 Apr 2014 13:09:16 +0000 (15:09 +0200)]
Reduce memory pressure on JS stack when garbage collecting

As the identifier table grows with long running programs, we may end up
allocating more identifiers than we have space left on the JS stack for them
alongside all the other objects in the environment. To mitigate this, we can
simply treat the identifiers as roots, mark them manually and only end up
putting sub-strings onto the JS stack if necessary.

Task-number: QTBUG-36183
Change-Id: Ie6994555305c84b007860792d066a8df60089847
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix unreliable behavior of array methods on qml list properties
Simon Hausmann [Wed, 9 Apr 2014 11:32:39 +0000 (13:32 +0200)]
Fix unreliable behavior of array methods on qml list properties

Array methods such as forEach rely on the hasProperty boolean of getIndexed to
be set appropriately. Some getIndexed implementation - such as the
QQmlListProperty one - didn't initialize it correctly and therefore the
behavior was undefined.

Task-number: QTBUG-38088
Change-Id: I34bc3136d8cc2bc280397d0c4d5051e7d72269e8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoAdd support for dynamic properties for QObjects in JavaScript
Simon Hausmann [Wed, 9 Apr 2014 10:17:40 +0000 (12:17 +0200)]
Add support for dynamic properties for QObjects in JavaScript

In QtScript you could add properties to a JS object that wraps a QObject.
Depending on the wrap option the property was either stored on the JavaScript
side or as dynamic QObject property.

In QJSEngine/QJSValue, neither was supported - properties could not be added.
For QObjects wrapped in JavaScript that weren't created by QML, we can restore
the behavior of storing dynamically added properties as JavaScript properties.

This makes porting from QtScript to QJS* much easier.

Task-number: QTBUG-37408
Change-Id: I5ef1f379c08c3d84de9bdcac9b6a9397238064de
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoListView: fix rounding errors
J-P Nurmi [Fri, 4 Apr 2014 08:42:37 +0000 (10:42 +0200)]
ListView: fix rounding errors

Task-number: QTBUG-37339
Change-Id: I223e4d6bcabb1daa705c0ed2212e7e2b2fc3f37c
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoFix remaining QQmlLocale auto-test failures
Simon Hausmann [Tue, 8 Apr 2014 13:50:09 +0000 (15:50 +0200)]
Fix remaining QQmlLocale auto-test failures

Thanks to improvements in QDateTime's parser, we can unskip a bunch of tests.
What remained was dateFromLocaleTimeString, which failed because it relied on
the earlier behavior of a failed conversion from a _time_ string to a date
also returning an invalid date object. This behavior is restored by leaving
the QDateTime object as invalid unless the converted time is valid.

In Qt <= 5.1, QDateTime::setTime would make the entire datetime object invalid
if the provided time was invalid. In Qt >= 5.2 it remains potentially valid
if the date at least is correct - which was the case here as it was initialized
from currentDateTime.

Change-Id: I32a2cd2a9631cca3b12773e4c55169baa3eeaf1a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix wrong register usage for integer binops
Simon Hausmann [Tue, 8 Apr 2014 07:43:49 +0000 (09:43 +0200)]
Fix wrong register usage for integer binops

When doing of integers where we use a three argument variant of masm
(lhs/rhs/target), we need three general purpose registers. If the target temp
of the binop is a register, we use that as a target, otherwise fall back to
ReturnValueRegister (scratch). In that case we don't need to move from RVR to
target register. Additionally we need to load lhs and rhs into registers, and
for the lhs we use the target register and for the rhs the scratch register.

So we start by loading the lhs into the target register and the rhs into
the scratch register. However if the rhs is already assigned to a register
and that register happens to be the target register, then the earlier load
of the lhs into the target register overwrote our rhs!

This is fixed by being more careful in the choice of the target temp's assigned
register as "scratch" register for the lhs, i.e. don't use it if the target
temp is also assigned to the same register as the rhs.

Task-number: QTBUG-38097
Change-Id: I2ffec55cb98818fa9ebb5a76a32b6dca72175893
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoZero memory in WinRT allocator
Andrew Knight [Tue, 8 Apr 2014 17:09:02 +0000 (20:09 +0300)]
Zero memory in WinRT allocator

The memory is assumed to be zero-initialized, and this wasn't happening
on WinRT.

Task-number: QTBUG-38132
Change-Id: I8686a40dacdc20bd702cc43a067209bfa997e7b2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agomake accessibility plugin declare that it extends Quick
Oswald Buddenhagen [Thu, 3 Apr 2014 14:04:26 +0000 (16:04 +0200)]
make accessibility plugin declare that it extends Quick

Change-Id: I62789da1ec45ad0647705dc5a7b509ff36c388f8
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoFix XHR auto tests always failing
Simon Hausmann [Tue, 8 Apr 2014 11:37:19 +0000 (13:37 +0200)]
Fix XHR auto tests always failing

The test (rightly so) expects that even for a 400 response, the responseBody
must be preserved - as per commit 0949071f13e7bcbc16a0f07f496e0b6a23b04edd.
However before commit fd5dd2712656cbc674c8360754394e41dd82e40c in qtbase, 400
was mapped to QNetworkReply::UnknownContentError, which is "handled" by
QQmlXMLHttpRequest::error in the sense that the body is preserved. After the
qtbase behavioral change, 400 now maps to
QNetworkReply::ProtocolInvalidOperationError, which was _not_ handled, the body
was cleared and the test failed.

The revdep of qtdeclarative for qtbase should've caught the behavioral change
in qtbase, but unfortunately the auto-test was disabled (marked insignificant).

This patch adjusts the xhr implementation to the behavioral change in qtbase
and also re-activates the xhr auto-test (we really should be testing our xhr
implementation in the CI system...).

Task-number: QTBUG-38180
Change-Id: I7655fd9037752ad644a98d01257bf5f81e7daa15
Reviewed-by: Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
10 years agoFix memory corruption in XHR implementation
Simon Hausmann [Tue, 8 Apr 2014 09:19:04 +0000 (11:19 +0200)]
Fix memory corruption in XHR implementation

Now that the member data of Object is also on the GC heap, it is even more
important to call the base implementation of markObjects when re-implementing
it ;-)

Fixes also three XHR auto tests (text, cdata and stateChangeCallingContext)

Change-Id: Ifd033cac64a8cf27a9186d8cd9eb94369d8a60a5
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
10 years agoSet font correctly in canvas example.
Mitch Curtis [Tue, 8 Apr 2014 07:50:52 +0000 (09:50 +0200)]
Set font correctly in canvas example.

This fixes the following warning:

Context2D: Missing or misplaced font family in font string (it must come after the font size).

Task-number: QTBUG-38103
Change-Id: I0902e6e095fb76cdc8619229dccf2601007c3216
Reviewed-by: Jeff Tranter <jtranter@ics.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoVerify empty SmoothedAnimation doesn't keep animation system running.
Michael Brasser [Mon, 7 Apr 2014 03:42:29 +0000 (22:42 -0500)]
Verify empty SmoothedAnimation doesn't keep animation system running.

Change-Id: I8f8a9d31241e1bff9e72524b69d625258885558a
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
10 years agoSupport dumping of animation jobs via QML_ANIMATION_TICK_DUMP.
Michael Brasser [Fri, 28 Mar 2014 16:43:47 +0000 (11:43 -0500)]
Support dumping of animation jobs via QML_ANIMATION_TICK_DUMP.

Change-Id: I0b444321667691be3e1037164d02f29ed4dfc13e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoOSX: fix QQuickListView test
Shawn Rutledge [Wed, 2 Apr 2014 07:41:02 +0000 (09:41 +0200)]
OSX: fix QQuickListView test

outsideViewportChangeNotAffectingView was failing on OSX.
Make the window larger; flick a longer distance in the same time to
ensure that the flick takes the list to the end.

Task-number: QTBUG-37828
Task-number: QTBUG-27740
Change-Id: Iefa44942a8f8318861781db820e830b459114a83
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
10 years agoFix marking of prototype objects in chain
Simon Hausmann [Mon, 7 Apr 2014 09:20:03 +0000 (11:20 +0200)]
Fix marking of prototype objects in chain

With a real prototype chain it can happen that an internal class' prototype's
class itself has a prototype. Therefore the first transition on the empty class
is a PrototypeChange one, but the class the transition leads to may have
PrototypeChange transitions itself, which weren't marked.

There are multiple solutions to this, but this patch is the minimal fix by
recursing fully through the internal class tree. That way it's easier to
back-port the fix also into 5.2.x based branches.

Task-number: QTBUG-37834

Change-Id: I901b13a2663fbad5844003ca5752f2f304de320c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDoc: Fix apidoc for QQuickLoader::sourceComponent
Kevin Funk [Fri, 21 Feb 2014 16:00:36 +0000 (17:00 +0100)]
Doc: Fix apidoc for QQuickLoader::sourceComponent

Setting this to an empty string doesn't make sense nor works

Change-Id: I4dd89d0356da30bc46e5fdac827e30b6f9a6a7a4
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoDon't start continuing animation when it doesn't have children.
Gunnar Sletta [Mon, 31 Mar 2014 11:47:26 +0000 (13:47 +0200)]
Don't start continuing animation when it doesn't have children.

If we did, it would never stop.

Change-Id: Ie9d8f1731f6fa555f8dd6a56d6967a8f8f19a9f4
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agoDon't mipmap by default in QSGSimpleTextureNode
Gunnar Sletta [Mon, 7 Apr 2014 07:15:14 +0000 (09:15 +0200)]
Don't mipmap by default in QSGSimpleTextureNode

Task-number: QTBUG-37646
Change-Id: I2f27568ebd89c1f451f910dd03ea21c01c4adad1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoDon't append garbage to the function parameter slots
Thiago Macieira [Thu, 3 Apr 2014 06:12:52 +0000 (23:12 -0700)]
Don't append garbage to the function parameter slots

If the argument is neither a temporary nor a constant, slot isn't
initialized. So don't try to add it.

qqmltypecompiler.cpp:2548:36: error: variable 'slot' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
qqmltypecompiler.cpp:2553:36: note: uninitialized use occurs here
        _functionParameters.append(slot);
                                   ^~~~

Change-Id: I5a538bfa0ef1fbbd00e23dfd6e15c404359c7c46
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRegression: Fix id objects in group properties
Simon Hausmann [Thu, 3 Apr 2014 15:20:18 +0000 (17:20 +0200)]
Regression: Fix id objects in group properties

Setting someGroupProperty.id should not be subject to the usual
restrictions with regards to valid values for id properties.

Task-number: QTBUG-38085
Change-Id: Ie66d9d4d4524ddaf5a6a0b0e260354db44d9995e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake the destroy method optional
Lars Knoll [Thu, 3 Apr 2014 10:35:26 +0000 (12:35 +0200)]
Make the destroy method optional

This allows us to avoid calling a destructor on objects
that don't require one. After the memberData change this
should be most objects.

Also fix a bug where we didn't call the destroy() method on
large objects, potentially leaking memory.

Change-Id: I1708055d568d85b0a3876899d35e8c3eb92dd222
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoGarbage collect member data
Lars Knoll [Mon, 31 Mar 2014 13:48:02 +0000 (15:48 +0200)]
Garbage collect member data

Move the allocated member data into the garbage collected
area, so that we can avoid using malloc/free for it.

Change-Id: I20625efa67ecd60238568742b74854b0c8cb2e3e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoStop the animation driver when no animations are ticking.
Gunnar Sletta [Mon, 31 Mar 2014 13:38:36 +0000 (15:38 +0200)]
Stop the animation driver when no animations are ticking.

When animations were registered we made a queued connection to
'startAnimations' to start the animation driver and also set the
'startAnimationPending' state to true. In 'stopTimer' we aborted
if 'startAnimationPending' was true, presumeably to avoid stopping
just to restart shortly after.

However, if an animation is registered which triggers the invoke
and then is immediately removed again, 'startAnimationPending' will
be true with no pending animations at the time of 'stopTimer'. As
a result, the driver would not stop and the system would continue
animating and trying to render.

Change-Id: Icbb01d7129c3a1bddef08a9f2a7aee957e3d2909
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agoUse global context sharing from QtGui instead of QSGContext
Jocelyn Turcotte [Fri, 28 Mar 2014 14:36:55 +0000 (15:36 +0100)]
Use global context sharing from QtGui instead of QSGContext

This removes QSGContext::sharedOpenGLContext and replace its uses
with QOpenGLContextPrivate::globalShareContext, which is also going
to be used by QOpenGLWidget and QQuickWidget.

Change-Id: I1e296c3e6832f717caaf31ba7d7b27c06249219b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoInitialize variables in QQuickItemParticle
Gunnar Sletta [Wed, 2 Apr 2014 12:25:15 +0000 (14:25 +0200)]
Initialize variables in QQuickItemParticle

Change-Id: I42a7b1481014e06e25ab4d9d6f2f36fb3515f735
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoDoc: Fix some code snippet warnings
Sergio Ahumada [Thu, 3 Apr 2014 09:10:49 +0000 (11:10 +0200)]
Doc: Fix some code snippet warnings

Seems like \qml \endqml is not able to parse some snippets, so using
\code \endcode instead to fix warnings like:

  Unable to parse QML snippet: "Expected token `{'" at line 1, column 13

Change-Id: Iecf033ff5610405d946390e69c3aa7ec54a21998
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
10 years agoUse RAII for VME profiler
Ulf Hermann [Wed, 2 Apr 2014 10:02:14 +0000 (12:02 +0200)]
Use RAII for VME profiler

Now that object creation is done in nested function calls we can
use an RAII-type profiler to trace it. This makes the profiling
much simpler and more robust.

Also, the stack of profiling data in the VME profiler has to match
the stack of completion callbacks in the VME, so the push and pop
operations are synchronized now.

Task-number: QTBUG-37978
Change-Id: I1bc5e0665b88e5b3772e48c8676cdda3fae59e1b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoQtQuick test: Do not complain about Qt specific arguments
Kai Koehne [Tue, 25 Mar 2014 15:22:03 +0000 (16:22 +0100)]
QtQuick test: Do not complain about Qt specific arguments

Commit 1ca5e82cccae0 caused a regression for Qt arguments like
-qmlsjsdebugger=xxx . These are automatically removed from argv by
QCoreApplication, but since we copied argv before instantiating
QCoreApplication this didn't have any effect.

Fix this by moving Q[Core]Application instantiation again before
the parsing and copying of testlib-specific arguments.

Task-number: QTBUG-37793
Change-Id: Ief41640b6cf3251f700a5d24d2e1141233a3888f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
10 years agoFix 'missing header' compilation error (shadow build)
Kai Koehne [Thu, 3 Apr 2014 07:38:48 +0000 (09:38 +0200)]
Fix 'missing header' compilation error (shadow build)

Change the private header path to the canonical one. This fixes
shadow builds for me on Windows.

Change-Id: I7c18ec2d9f0769a51d296deac16c78ae41894c36
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoWork around warning by GCC 4.8 with -O3 about array out of bounds
Thiago Macieira [Wed, 2 Apr 2014 00:38:11 +0000 (17:38 -0700)]
Work around warning by GCC 4.8 with -O3 about array out of bounds

qqmldelegatemodel.cpp:1140:53: error: array subscript is above array bounds [-Werror=array-bounds]
             attached->m_currentIndex[i] += deltas[i];
                                                     ^
qqmldelegatemodel.cpp:2009:29: error: array subscript is above array bounds [-Werror=array-bounds]
             m_currentIndex[i] = m_previousIndex[i] = incubationTask->index[i];
                             ^

I can't tell how the count can be higher than MaximumGroupCount. Either
GCC is seeing something I'm not while inlining multiple functions, or
it's just getting lost. If it's the former case, this is change could be
a fix, but it's probably the wrong type of fix. If it's the latter,
we're just throwing the inliner a curve ball and it just stops
complaining.

Change-Id: I7907074005f5327a8592f47d72a4e79f9c6cd5ff
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoOn Mac only editable text input should receive tab focus
Liang Qi [Tue, 1 Apr 2014 08:05:28 +0000 (10:05 +0200)]
On Mac only editable text input should receive tab focus

It's for all items with "readOnly: false" and has "text" property.

[ChangeLog][QtQuick] Mac: any editable text input will get tab focus
when "Text boxes and lists only" option was selected.

About "Text boxes and lists only", see commit
06332df7438c8d2215b02f1e01ce2ed28a49a320.

Task-number: QTBUG-38004
Change-Id: I73947b71b2fec69a66e122514d440656f4650e99
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
10 years agoReduce memory consumption of runtime compiled QML types
Simon Hausmann [Tue, 1 Apr 2014 09:00:27 +0000 (11:00 +0200)]
Reduce memory consumption of runtime compiled QML types

Don't store the string of binding scripts in the compiled data. The only
exception to the rule are properties of type QQmlScriptString as well as types
with custom parsers.

Change-Id: I7f53262bf957b442bac4db71d0a2c0bed74a9b54
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoAvoid recompiling of signal handlers defined in QtQuick state changes and Connection...
Simon Hausmann [Mon, 31 Mar 2014 14:49:14 +0000 (16:49 +0200)]
Avoid recompiling of signal handlers defined in QtQuick state changes and Connection objects

We can re-use the expression we've compiled at QML type compilation time, as
long as we "inject" the signal parameters in the dynamic qml lookup chain.

Change-Id: Icc417531c41dea06ff5d033011179af49b03f542
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix performance regression for bindings from QtQuick state changes
Simon Hausmann [Mon, 31 Mar 2014 13:43:33 +0000 (15:43 +0200)]
Fix performance regression for bindings from QtQuick state changes

This is a regression from the compiler change. We can and should try to
use the binding as it was compiled in the loader thread for things like

    PropertyChanges {
        target: foo
        width: someExpresion + to + calculate * width;
    }

It is already ensured that these expressions are compiled without type
optimizations.

Change-Id: Ib855d8a848fcab2524df008727eab436ac98514e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix compilation of script strings
Simon Hausmann [Mon, 31 Mar 2014 13:07:18 +0000 (15:07 +0200)]
Fix compilation of script strings

The right hand side of script string properties can be evaluated in entirely
dynamic scopes, due to QQmlExpressions' public API of allowing construction
from a QQmlScriptString and a variable scope/context. Nevertheless we should
compile these bindings at type compile time, as long as we make sure that the
compiled code doesn't try to do any compile time determined property lookups
and type resolution. This is implemented using a separate compilation pass
that ensures the disableAcceleratedLookups flag is set.

A few minor cleanups come with this patch:

 * Ensure that the property caches array is always symmetric to the list of
   compiled QML objects, as that allows the use of at() instead of value().
 * The code for creating a QML callable function object for a given run-time
   function is now centralized in a static function QmlBindingWrapper, used
   for script strings and bindings from custom parsers.

The provided unit test verifies the successful execution of the same script
string with two different scope objects.

Change-Id: Ica2cea46dd9e47263b4d494d922d3cc9664b08ae
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake example work when QOffscreenSurface == QWindow
Gunnar Sletta [Fri, 28 Mar 2014 09:11:33 +0000 (09:11 +0000)]
Make example work when QOffscreenSurface == QWindow

Change-Id: I7435d91b37a46c0bced301c5c9c82fdf499e0587
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoMaroon example: use multimedia for audio; mute when inactive
Shawn Rutledge [Mon, 24 Mar 2014 15:33:10 +0000 (16:33 +0100)]
Maroon example: use multimedia for audio; mute when inactive

Task-number: QTBUG-37742
Change-Id: If1a6ded9ccdaa4cd6f5e6e405e2d5caa21710d4c
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
10 years agoPinchArea docs: elaborate on confusing aspects
Shawn Rutledge [Tue, 1 Apr 2014 08:06:32 +0000 (10:06 +0200)]
PinchArea docs: elaborate on confusing aspects

The pinch property and the pinch signal parameter are confusing,
especially since limits in the property don't apply to the values
in the signal parameter.

Task-number: QTBUG-37917
Change-Id: Id8fac60f505a1c54cc8debd3a29e013ca9d29773
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
10 years agoGive the QML and the debug server thread an objectname.
Thomas McGuire [Tue, 1 Apr 2014 08:59:39 +0000 (10:59 +0200)]
Give the QML and the debug server thread an objectname.

Now it is easier to identify the threads in e.g. the debugger in
QtCreator.

Change-Id: I032822e869df09cf43dc1d6e01d14610005ce217
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
10 years agoMove inline function Bool Runtime::compareEqual() above usage.
Friedemann Kleint [Tue, 1 Apr 2014 08:06:39 +0000 (10:06 +0200)]
Move inline function Bool Runtime::compareEqual() above usage.

Fix MinGW-warnings:

src/qml/jsruntime/qv4runtime_p.h:496:13: warning:
'static QV4::Bool QV4::Runtime::compareEqual(QV4::ValueRef, QV4::ValueRef)' redeclared without dllimport attribute after being referenced with dll linkage

Change-Id: Ieb212ed6aba2a0deeeddd033126ae7e9737bb38e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMaking the CHUNKSIZE setable via environment variable
Karim Pinter [Tue, 25 Mar 2014 15:34:52 +0000 (17:34 +0200)]
Making the CHUNKSIZE setable via environment variable

With this modification the CHUNKSIZE is setable by QV4_MM_MAX_CHUNK_SIZE
environment variable so the memory usage which is important for embedded
devices can be finetuned.

Change-Id: I3cd75158f2255651edd341873de035c1222e3c92
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix typo
Simon Hausmann [Mon, 31 Mar 2014 12:37:32 +0000 (14:37 +0200)]
Fix typo

creatScriptFunction -> createScriptFunction

Change-Id: Icdb9214b1ae067fa2b8693d50cdac0be9fe6d390
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agoFix compilation on QNX
Sergio Ahumada [Mon, 31 Mar 2014 14:04:05 +0000 (16:04 +0200)]
Fix compilation on QNX

Task-number: QTBUG-37979
Change-Id: Ie877317cded5b9eaf95389344712c66192696552
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
10 years agoDocument the QSG_VISUALIZE environment variable.
Mitch Curtis [Tue, 4 Mar 2014 13:14:16 +0000 (14:14 +0100)]
Document the QSG_VISUALIZE environment variable.

The explanations are taken from 3f8d5d0.

Change-Id: I9901b5f2c42f7bec6573101eb91eb9116089d4e9
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoFix performance regression of parent setting during QML object creation
Simon Hausmann [Mon, 31 Mar 2014 07:58:13 +0000 (09:58 +0200)]
Fix performance regression of parent setting during QML object creation

This showed up in the profiles again: In QML we create a lot of objects
with many children and sending a child event each time is expensive. That's
why the VME didn't do that and hadn't done so in ages. This patch restores
that behavior and aspect of loading performance.

Change-Id: I5078fe330d913dc832b284aaecf031152dc80802
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDon't crash when render node doesn't have a batchroot
Gunnar Sletta [Sat, 29 Mar 2014 06:52:06 +0000 (06:52 +0000)]
Don't crash when render node doesn't have a batchroot

Change-Id: Ib8f70414eb477b4ec45097c8784a5fe1375cf012
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoRemove object index parameter from QQmlCustomParser::compile
Simon Hausmann [Sat, 29 Mar 2014 13:15:54 +0000 (14:15 +0100)]
Remove object index parameter from QQmlCustomParser::compile

There is no need anymore to pass through the object index of the
object being "custom compiled".

Change-Id: I8ef8e578b27523d9e7190503fbf95d1eb863a149
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoEliminate noop translation bindings
Simon Hausmann [Sat, 29 Mar 2014 13:11:38 +0000 (14:11 +0100)]
Eliminate noop translation bindings

We can store them as regular strings. This has the advantage that the
entire special handling from the custom parser of the list model goes away,
we don't need astForBinding in QQmlCustomParser anymore neither and types
with a custom parser can now generally benefit from the expression simplification
pass.

Change-Id: I39d1b76edd1273d8c73b847aed71f7bcce37d877
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove dead code
Simon Hausmann [Sat, 29 Mar 2014 10:30:17 +0000 (11:30 +0100)]
Remove dead code

Remove qquick anchor line comparison hooks, which were intended to be used
inside the old v4 interpreter (but that was incomplete) and are now completely
unused.

Change-Id: I06b0dd684a292adb44efa52d27258242954285ee
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake it possible to supply compilation units from plugins
Simon Hausmann [Sat, 29 Mar 2014 09:05:09 +0000 (10:05 +0100)]
Make it possible to supply compilation units from plugins

This also cleans up the script and type initialization in
the type loader, for example by getting rid of the m_irUnit
member for scripts.

Change-Id: I207afeb21c0bae9091d3c7b4cac2e80e9aae0ea3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoEnable GL context sharing for QtQuick windows by default
Simon Hausmann [Wed, 26 Mar 2014 11:30:34 +0000 (12:30 +0100)]
Enable GL context sharing for QtQuick windows by default

This is required for running QWebEngine inside qmlscene. It can be disabled
with --disable-context-sharing and it remains off in QtQuick. Instead apps have
to use QWebEngine API to enable this, where this patch here is merely
convenience.

Change-Id: I123893a7c8c644c49c66fe2b42d2b7b2e03622d9
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoDestroy render loop when QCoreApplication is cleaned up.
Gunnar Sletta [Fri, 28 Mar 2014 13:52:26 +0000 (13:52 +0000)]
Destroy render loop when QCoreApplication is cleaned up.

Doing it on 'aboutToQuit' meant we would clean it up whenever an
application ran QCoreApp::exec() which could be multiple times
per application run.

Change-Id: I59e06398a551ae7979e3832dff811937037fa106
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
10 years agoFix visual parent ownership with scenes that create windows
Simon Hausmann [Fri, 28 Mar 2014 17:41:26 +0000 (18:41 +0100)]
Fix visual parent ownership with scenes that create windows

Commit 39540124dd0900e0c99dcda8c0ebdf4f3cea8d5e introduced the concept that
a visual parent marks its children, by recursively marking the children of
the root item in a QQuickView. This allowed for the removal of an ugly hack
in QtQuick Controls.

Unfortunately that fix is incomplete in the sense that it makes the incorrect
assumption that a QQuickView is always used. The use-case in the bug report is
to have child items inside a QtQuick.Window (a regular ApplicationWindow in
fact). That window - implemented by QQuickWindowQmlImpl - also needs to mark
its children, so this patch introduces the use of the same GC marking helper
class (which now operates on a QQuickWindow instead of a QQuickViewPrivate).

Task-number: QTBUG-37711
Change-Id: Id788e84dbb041ac8ba6ff23dc4ef56f6fe9e465a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove custom code for converting from QString to QColor
Simon Hausmann [Fri, 28 Mar 2014 12:30:00 +0000 (13:30 +0100)]
Remove custom code for converting from QString to QColor

After commit 9b021a1fbd0b974a452a6e18a8c0b4b97cbf8edb in qtbase we can now
(about a year later ;-) remove the custom code from handling alpha when
converting from string to color and rely on the implementation in qtbase.

Change-Id: Ia8086c99f0f782742d3adf12cb2c3b79dee8d578
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
10 years agoFix crash in conversion from QVariantMap to QJSValue
Simon Hausmann [Fri, 28 Mar 2014 15:02:45 +0000 (16:02 +0100)]
Fix crash in conversion from QVariantMap to QJSValue

When the key is an array index, use arraySet instead of trying to insert
an array index as internal class member.

Task-number: QTBUG-37854
Change-Id: I23f01cc9d6be98b57d3f13ac7ee847298e9632a3
Reviewed-by: Matt Broadstone <mbroadst@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
10 years agoV4 string table cleanups
Simon Hausmann [Thu, 27 Mar 2014 18:18:55 +0000 (19:18 +0100)]
V4 string table cleanups

Move the string table (index and data) to the end of the compilation unit.
That makes it easier to extend the string table later with new strings - for
example when transitioning from JS data to an entire QML unit - because all the
other offsets within the JS data remain the same.

Change-Id: Ib28caf943ee2ec74b7acc19c2980de0853bb8086
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoVarious cleanups
Simon Hausmann [Thu, 27 Mar 2014 16:07:06 +0000 (17:07 +0100)]
Various cleanups

* Encapsulate the string pooling for the V4 data generation into a StringGenerator class.
* Move type reference collection into the IR::Document, where it belongs (as it writes
  into the typeReferences there)
* const fixes
* Remove unused methods and members
* Store unit and qml unit sizes right in the generated data structure. That makes copying
  easier (like we do when generating the QML data based on the JS fields)

Change-Id: I053146ab0b00cc90ac7f72f867415962d1be121b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix crash in sparse array handling
Simon Hausmann [Fri, 28 Mar 2014 13:12:41 +0000 (14:12 +0100)]
Fix crash in sparse array handling

When re-allocating the sparse array data, make sure to initialize the free list
correctly. Previously this was only done for the first allocation.

Test cases uses an object literal, as that's a reliable way to ensure
a sparse array is created.

Task-number: QTBUG-37892
Change-Id: Ib38cfce50104904af0c980f022c9dbb7461ae5f8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix a link in QQuickDragAttached::dragType documentation
Jędrzej Nowacki [Tue, 18 Mar 2014 13:46:26 +0000 (14:46 +0100)]
Fix a link in QQuickDragAttached::dragType documentation

Change-Id: Ia704b3c84215b519e86a0aed884d89538ba7e4f9
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoFix interpreter math routines.
Erik Verbruggen [Fri, 28 Mar 2014 12:08:23 +0000 (13:08 +0100)]
Fix interpreter math routines.

This:
    qint64 result = a + b;
is not equal to:
    qint64 result = static_cast<qint64>(a) + b;

So checking if the former will overflow, and then doing the "double
case", will get thrown out by an optimizing compiler.

While we're in the area, optimize the X86 case a bit too.

Change-Id: Idfb69b16dbaaa0ae9f013a430ff060ca789526ba
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix double deletion
Simon Hausmann [Fri, 28 Mar 2014 12:04:42 +0000 (13:04 +0100)]
Fix double deletion

Small regression from commit 7ae796cb141b73a1b215b2b0fd64b7ffbbd1e510.
Processing the deletables might result in the onDestruction emission, which in
turn may end up in GC allocation and thus GC runs. That in turn may result
in m_deletables processing, which at this point is nested then. For that to
work we need to set m_deletables back to zero _before_ beginning with the
iteration.

Fixes tst_qqmlecmascript with aggressive gc.

Change-Id: Ibb310b30cd496644557f4c1bb23318b18ee8f36c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDoc: Add a module page for Qt Quick Widgets
Topi Reinio [Fri, 21 Mar 2014 13:15:19 +0000 (14:15 +0100)]
Doc: Add a module page for Qt Quick Widgets

Although the documentation is part of Qt Quick, a separate
module page with a \qtvariable command is still needed to
have correct information about which module to link against.

Task-number: QTBUG-37272
Change-Id: Ie00e9418be4feec299cb36c526ca366504c89008
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix QtSharedPointer::ExternalRefCountData object leak in v4 engine
Liang Jian [Fri, 28 Mar 2014 05:23:36 +0000 (13:23 +0800)]
Fix QtSharedPointer::ExternalRefCountData object leak in v4 engine

Always call ~QObjectWrapper() to the wrapper object in
QObjectWrapper::destroy(), otherwise the m_object member of QObjectWrapper
may still hold a QtSharedPointer::ExternalRefCountData object which will
never been deleted.
I don't know why this will not cause leak in the past, but it seems that
the leak was introduced in 7ae796cb141b73a1b215b2b0fd64b7ffbbd1e510

Change-Id: I24b49bb11f95b7e3060c7adba1ab80b615da2942
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDoc: Document signals (not handlers) under \qmlattachedsignal
Sze Howe Koh [Thu, 20 Mar 2014 13:57:03 +0000 (21:57 +0800)]
Doc: Document signals (not handlers) under \qmlattachedsignal

- They're not "attached properties" either.
- Append the handler names to the end of the corresponding signal doc.
- Update descriptions and links

Task-number: QTBUG-35846
Change-Id: I54e93187b3209546ec344a20e0482c98d7f14109
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoBe a bit more conservative with allocating memory
Lars Knoll [Tue, 25 Mar 2014 09:08:01 +0000 (10:08 +0100)]
Be a bit more conservative with allocating memory

Cap the max chunk size at 2MB. This value still still doesn't
affect the v8 benchmark noticably, but should avoid extreme
memory usage in some corner cases

Task-number: QTBUG-37134
Change-Id: If2050374c4a7df7ff74194d64880e2d660ea26fd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix instantiation of QML list models with custom object properties
Simon Hausmann [Tue, 25 Mar 2014 15:24:03 +0000 (16:24 +0100)]
Fix instantiation of QML list models with custom object properties

When doing something like

    property Item blah: Item { ... }

in a list model, we would erroneously pass "blah" to the custom parser of the
list model, which is wrong as the binding to blah is on an existing property
(not custom). For regular properties there's a code path in place to avoid
passing this to the custom parser, but for sub-object bindings we'd
unconditionally register it with the custom parser. This patch corrects that
and also adds a unit test to verify that we don't pass any bindings to existing
properties to the custom parser.

Task-number: QTBUG-37795
Change-Id: I1a3091fb5fad4be08b577cf74a85f24c3ab62ef4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove the scribble option from the memory manager
Lars Knoll [Wed, 26 Mar 2014 14:30:27 +0000 (15:30 +0100)]
Remove the scribble option from the memory manager

This option doesn't make sense anymore, as we memset the object to
0 on destruction anyway.

Change-Id: Ie40563394f9cacda1b35fde114c9a6043f53d460
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoGet rid of collectDeletables
Lars Knoll [Wed, 26 Mar 2014 14:11:48 +0000 (15:11 +0100)]
Get rid of collectDeletables

The method is only required for the QObjectWrapper, but
there we can instead simply register the deletable in the
destroy method.

Change-Id: I944319d327859cce33ac31a174e8d56fc4babfc1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoOptimize ExecutionContext::setProperty
Lars Knoll [Wed, 26 Mar 2014 07:55:45 +0000 (08:55 +0100)]
Optimize ExecutionContext::setProperty

Optimize the code in case the setProperty call tries to
set something in the activation. Avoid resolving the property
index twice.

Change-Id: I60a4535adc014f7118bc3ab6773e10ed688ca0d6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDon't use scopes in the instanceOf operator
Lars Knoll [Wed, 26 Mar 2014 07:55:28 +0000 (08:55 +0100)]
Don't use scopes in the instanceOf operator

There's no need to use scopes here, as instanceof can't
trigger any calls into the memorymanager. This slightly
speeds up the code.

Change-Id: Ie7f5c8f3982df1e24d21cfc4e0841d479a75c664
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoOptimize construct calls
Lars Knoll [Wed, 26 Mar 2014 07:53:59 +0000 (08:53 +0100)]
Optimize construct calls

Optimize construction of the internalClass for the object
being constructed.

Change-Id: Id5fc02c291664ec01c3595ae0acbb6895cc5b147
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoSave another 4/8 bytes per QQmlBoundSignalExpression
Simon Hausmann [Thu, 27 Mar 2014 08:52:39 +0000 (09:52 +0100)]
Save another 4/8 bytes per QQmlBoundSignalExpression

We can move the persistent to hold the scope for a string compiled binding into
the extra data.

Change-Id: I033aa6d080402a1eb19cdae540f9af2c5c3a3fc7
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agoLet render loop be more tolerant wrt when markDirty is called.
Gunnar Sletta [Thu, 20 Mar 2014 12:01:51 +0000 (13:01 +0100)]
Let render loop be more tolerant wrt when markDirty is called.

Change-Id: I95f1d6fe4695a09b1b6ccaf026137dabc22ec82c
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agoFix reading of shader sources in scene graph example
hjk [Tue, 25 Mar 2014 13:17:26 +0000 (14:17 +0100)]
Fix reading of shader sources in scene graph example

Task-number: QTBUG-33080
Change-Id: I9219233ab7c7fbe89c0a9f1453d7c6aeeca498a1
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoCall tzset() from getLocalTZA() so we learn about tz changes
Iain Lane [Thu, 27 Mar 2014 11:53:23 +0000 (11:53 +0000)]
Call tzset() from getLocalTZA() so we learn about tz changes

Per POSIX, localtime_r isn't required to call tzset(). This means that
we don't notice that the timezone has changed when calling
Date.timeZoneUpdated() from JS.

Call this in getLocalTZA() so that it always returns results pertaining
to the selected timezone.

Task-number: QTBUG-37683

Change-Id: Ia9098ef0100b7c909a82b125a5ea4f39fba1f306
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDocument limitations of QQuickWindow::createTextureXxx functions.
Gunnar Sletta [Tue, 25 Mar 2014 16:15:10 +0000 (17:15 +0100)]
Document limitations of QQuickWindow::createTextureXxx functions.

Change-Id: I6813f5109cad3e4ace354337d258db8c120b52c5
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix build on older MinGW
Konstantin Ritt [Wed, 26 Mar 2014 18:29:29 +0000 (20:29 +0200)]
Fix build on older MinGW

The correct declaration of the SHGetPathFromIDList symbol is
being used in mingw-w64 as of r6215, which is a v3 snapshot;
until then, SHGetPathFromIDList was declared to use LPITEMIDLIST.

Change-Id: Icc2f7814bad475c9b825f7d70c0ae4da72f471d9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoUse an offscreen surface in Canvas
Laszlo Agocs [Tue, 25 Mar 2014 10:51:53 +0000 (11:51 +0100)]
Use an offscreen surface in Canvas

Canvas elements using the default Immediate render strategy
and an FBO result in a failing makeCurrent() and subsequent
crashes due to trying to make the Quick window's surface current
on the gui thread while it is current on the scenegraph render thread.

The EGL spec disallows this explicitly and so the makeCurrent fails with
EGL_BAD_ACCESS. Others, like GLX, do not seem to have this issue since
the spec says nothing about this scenario.

To overcome this, a QOffscreenSurface is used instead since what the
canvas does (rendering into an FBO on a thread that is different than
the one on which the rest of the rendering happens) is a primary use
case for offscreen surfaces (pbuffers) anyway.

This makes demos like stocqt functional again.

Task-number: QTBUG-37772
Change-Id: Id89f71545154856415bbbe4fa924176b25b5086f
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoPass the actual window format to the offscreen surface during cleanup
Laszlo Agocs [Tue, 25 Mar 2014 14:01:44 +0000 (15:01 +0100)]
Pass the actual window format to the offscreen surface during cleanup

Using the requested format (we don't have anything else since the platform
window is gone) is wrong on EGL implementations that offer a different set
of configurations for window and pbuffer surfaces, because we may end up
with a pbuffer surface that is incompatible with the context/window due to
having different color buffer sizes.

To be absolutely sure that the surface is compatible, store the actual
surface format so that it is available even after the platform window is
gone.

Change-Id: Id17c25439c463d4c37af95fc90f336d3f67c6427
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>