platform/upstream/qtdeclarative.git
12 years agoUse bit fields
Bea Lam [Tue, 17 Apr 2012 05:54:39 +0000 (15:54 +1000)]
Use bit fields

Change-Id: Ie04d59642117f00091e8b28ae4fb07df7e226f8c
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
12 years agoVertical layout direction for ListView and GridView
Bea Lam [Tue, 20 Mar 2012 01:37:10 +0000 (11:37 +1000)]
Vertical layout direction for ListView and GridView

Provide verticalLayoutDirection property with TopToBottom
and BottomToTop values.

Change-Id: If6f0da5dd4735036162868d391852a661854de5b
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
12 years agoCompile fix for qqmldebugservice test
Girish Ramakrishnan [Tue, 17 Apr 2012 01:00:58 +0000 (18:00 -0700)]
Compile fix for qqmldebugservice test

Change-Id: I8efd3686521c3221be79f5bbf5e28a8ef2bb4e19
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoFine-tune animation's pause()/resume() behaviors
Charles Yin [Fri, 16 Mar 2012 13:15:00 +0000 (23:15 +1000)]
Fine-tune animation's pause()/resume() behaviors

Only allow pause/resume to be used while running, and when stop the
animation reset the paused value to false.

Change-Id: Ia465045006478936146356f9e2e0632614c6b527
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoFix Text baselineOffset caclulations.
Andrew den Exter [Mon, 26 Mar 2012 05:54:16 +0000 (15:54 +1000)]
Fix Text baselineOffset caclulations.

Update the baselineOffset when short cutting layout due to an empty
text property.  And allow alterations to the baseline due to images,
font scaling and custom layouts when doing a layout.

Task-number: QTBUG-24303
Change-Id: I5a31a6108cded490fef8b0674e15558ea4e22d6b
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoDon't use QWindow::visible
Girish Ramakrishnan [Mon, 16 Apr 2012 14:14:00 +0000 (07:14 -0700)]
Don't use QWindow::visible

The deprecated method (in favor of QWindow::isVisible) is
going away.

Change-Id: I1ead05f8d74800a29c315ca4ca74577e89314882
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
12 years agoDebugger: Code cleanup for Inspect Tool
Simjees Abraham [Mon, 16 Apr 2012 13:14:12 +0000 (15:14 +0200)]
Debugger: Code cleanup for Inspect Tool

Code cleanup done for Inspect Tool. Member variables removed which were
not required.

Change-Id: I74ab43c4e8bf39d00a5428bb6219653b7887c46d
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
12 years agoQPointer used instead of QWeakPointer
Simjees Abraham [Mon, 16 Apr 2012 09:33:41 +0000 (11:33 +0200)]
QPointer used instead of QWeakPointer

Correctly used QPointer instead of QWeakPointer in QuickViewInspector
and Highlight classes.

Change-Id: I579bd148e71803b029d7a036cdcb7255740dbd91
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
12 years agoFix exports for the new Particles library.
Friedemann Kleint [Mon, 16 Apr 2012 08:36:03 +0000 (10:36 +0200)]
Fix exports for the new Particles library.

Change-Id: I3163c2bd00ad0d047f7fe2daa783e12071dd95b4
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
12 years agoQmlDebug: Fix qmake warning about declarative_debug
Kai Koehne [Fri, 13 Apr 2012 12:32:41 +0000 (14:32 +0200)]
QmlDebug: Fix qmake warning about declarative_debug

declarative_debug has been deprecated, and replaced by qml_debug.
In this case we can anyway use the define directly to avoid the warning
on startup.

Change-Id: Ia5ce1ecf698d2232ff46533822372f42db0825bd
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
12 years agoBe more explicit regarding the Locale object creation.
Martin Jones [Mon, 16 Apr 2012 02:43:49 +0000 (12:43 +1000)]
Be more explicit regarding the Locale object creation.

Change-Id: I6096c5919415b51b44f6e502da48b07f6de4d623
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
12 years agoAdd a new running property to QQuickTransition
Charles Yin [Fri, 16 Mar 2012 14:26:58 +0000 (00:26 +1000)]
Add a new running property to QQuickTransition

This read only property can be used to track the transition running
state. As all animation items inside a Transition item are just
animation defination templetes, so their running properties won't be
updated during the transition animations running, which makes it
hard to know the current running state of a transition animation.

Change-Id: If7fc0616ba384abc6bf2da67c7c639430c3d8fb9
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoAdd bug numbers for insignificant tests.
Jason McDonald [Fri, 13 Apr 2012 11:50:30 +0000 (21:50 +1000)]
Add bug numbers for insignificant tests.

Change-Id: Ic68f722e27edab52d68742cc45efa69d86ad4f3b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agoAdd support for variant properties in V4
Matthew Vogt [Thu, 29 Mar 2012 23:09:51 +0000 (09:09 +1000)]
Add support for variant properties in V4

Support initialization of variant properties in V4.  Variants can
be set to contain basic types in V4, but we can't extract data from
them since they may contain data types that V4 does not comprehend.

Task-number: QTBUG-25022
Change-Id: I1935d77b50c5a3481c4c8ddd86b9d3d970571217
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoExtract Particles code to an independent library
Matthew Vogt [Wed, 11 Apr 2012 06:54:33 +0000 (16:54 +1000)]
Extract Particles code to an independent library

QtQuick clients that do not use particles features should not have
to load these classes.

Task-number: QTBUG-25178
Change-Id: Ib15f7655dc4d821595e06f9160d2770375279027
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
12 years agoDon't use QWindow::move
Girish Ramakrishnan [Fri, 13 Apr 2012 20:18:25 +0000 (13:18 -0700)]
Don't use QWindow::move

It's deprecated. Use QWindow::setPos instead.

Change-Id: I16694d27eb583d18c9dca3ee066dbfddab1efe69
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoDon't use QWindow::visible() since it's deprecated
Girish Ramakrishnan [Fri, 13 Apr 2012 20:09:28 +0000 (13:09 -0700)]
Don't use QWindow::visible() since it's deprecated

Use QWindow::isVisible() instead.

Change-Id: I7dcd70e69a070d66f97f300cc292c1bfc51cf09c
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
12 years agoDebugger: Fix bug in Inspect Tool
Simjees Abraham [Fri, 13 Apr 2012 08:51:06 +0000 (10:51 +0200)]
Debugger: Fix bug in Inspect Tool

Changes made such that the reparenting of SelectionHighlight and
HoverHighlight is not done. Now the overlay remains the parent for
both.
Reparenting of SelectionHighlight and HoverHighlight created
issues when selection was done on QML lists. Even the highlight items
were getting added into the lists. This fixes the issue.

Change-Id: I116780408d62d2b3da0a17a92e11d6c4f63dd3dc
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
12 years agoFix broken wakeup() in threaded renderloop.
Gunnar Sletta [Fri, 13 Apr 2012 13:46:47 +0000 (15:46 +0200)]
Fix broken wakeup() in threaded renderloop.

It is cruicial that the sync handshake between GUI and render
does not get interrupted. If it does, the sync will happen with
the GUI unlocked which leads to crashes. When the sync event
comes through to the GUI afterwards the GUI will block waiting
while the renderer is most likely already done with the sync,
causing GUI to wait indefinitely.

Change-Id: I00bf0c36088510609a9e6f4d0649b9aaeefcd241
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoExtra tests for ShaderEffect and CustomParticle
Alan Alpert [Tue, 3 Apr 2012 03:13:49 +0000 (13:13 +1000)]
Extra tests for ShaderEffect and CustomParticle

Change-Id: Ieafa97f1f11337c8beac89a05fc5b5706ba6c215
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
12 years agotest: marked tst_qv8profilerservice as insignificant on mac
Rohan McGovern [Fri, 13 Apr 2012 06:19:21 +0000 (16:19 +1000)]
test: marked tst_qv8profilerservice as insignificant on mac

This autotest has repeatedly given different results on consecutive test
runs.  It seems to fail about 5% of the time in CI.

Task-number: QTBUG-25288
Change-Id: If7e8675521f6270877f514b7de81c926606cf232
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
12 years agoDon't ignore model changes when the ListView scroll position changes.
Andrew den Exter [Wed, 11 Apr 2012 06:22:52 +0000 (16:22 +1000)]
Don't ignore model changes when the ListView scroll position changes.

If there are pending changes when the ListView viewport changes then
do a full layout instead of a refill.  Likewise for GridView and when
animations finish or the cacheBuffer size changes.

Change-Id: I57a2b01fee5729381558af366dad24ba26c223ef
Reviewed-by: Bea Lam <bea.lam@nokia.com>
12 years agoMeasure offsets by rows instead of pixels
Bea Lam [Mon, 26 Mar 2012 01:56:04 +0000 (11:56 +1000)]
Measure offsets by rows instead of pixels

Will make it easier to test multiple flows and layout directions.

Change-Id: I33cabb650f65a2fd2932d23d501bf250d71ef80d
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
12 years agoExport all symbols on QSGDefaultRenderer.
Hannu Lyytinen [Wed, 11 Apr 2012 20:01:13 +0000 (23:01 +0300)]
Export all symbols on QSGDefaultRenderer.

Allow custom scene graph renderers to be based on QSGDefaultRenderer.

Change-Id: I67ec20b03abae34d0b0324f2e2bd8063322c14b7
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
12 years agoMake device specific projection matrix setter virtual.
Hannu Lyytinen [Wed, 11 Apr 2012 20:08:19 +0000 (23:08 +0300)]
Make device specific projection matrix setter virtual.

Allow custom scene graph renderers to set the device specific projection
matrix in their own way. This is needed for the KMS QPA platform, where
the Y coordinate of the screen gets inverted (see discussion at
http://lists.freedesktop.org/archives/wayland-devel/2012-March/
002506.html).

Change-Id: I08f3cd4b829e5b583fe96a9dfd67aa8d23a11b6b
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
12 years agoQQuickTextEdit to trigger input method updates on selectAll()
Pekka Vuorela [Wed, 25 Jan 2012 12:15:29 +0000 (14:15 +0200)]
QQuickTextEdit to trigger input method updates on selectAll()

Change-Id: I8642eca0e584b811308b73817e7decf2f392f1b5
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
12 years agoDoc: Fixing the Qt QML module page.
Jerome Pasion [Tue, 27 Mar 2012 13:20:42 +0000 (15:20 +0200)]
Doc: Fixing the Qt QML module page.

Change-Id: I0efffbab650423a78de437459c9060594f895f37
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
12 years agoBegin documenting QML's JS environment.
Michael Brasser [Wed, 26 Oct 2011 03:41:41 +0000 (13:41 +1000)]
Begin documenting QML's JS environment.

Provide a basic overview of QML's JavaScript host environment
that can be expanded as needed.

Change-Id: I1f178a9de26bd3ea6f5707821518419f76ab279d
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
12 years agoSilence warning with ICC about change of signal in integer conversion
Thiago Macieira [Thu, 20 Oct 2011 19:22:58 +0000 (21:22 +0200)]
Silence warning with ICC about change of signal in integer conversion

Change-Id: I7a9bc7de580dd37005d842d0ff5a000ba16f7c20
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
12 years agoAdd missing #include <stdlib.h>
Thiago Macieira [Thu, 20 Oct 2011 19:22:06 +0000 (21:22 +0200)]
Add missing #include <stdlib.h>

rand, malloc and free are defined in that header. Always include your
headers.

Change-Id: Iac052646617e0d038bc4a04709f32384d5f2e9e8
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
12 years agoGet SpriteGoal and GroupGoal tests running again
Alan Alpert [Mon, 2 Apr 2012 01:34:50 +0000 (11:34 +1000)]
Get SpriteGoal and GroupGoal tests running again

Missing from particles.pro, and needed quick-private removed from their
pro files. Also updated to match new sprite API, presumably these were
missed because they weren't running before.

Change-Id: I9be2d7f2b0bacc32c26829d40e91e8907c184906
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoMove doc pages into subfolders
Alan Alpert [Wed, 11 Apr 2012 06:37:43 +0000 (16:37 +1000)]
Move doc pages into subfolders

Change-Id: I611d0a4a069ac94a28ab2d264bcaa38347715909
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
12 years agoDebugger: Fix bugs in inspection tool
Simjees Abraham [Wed, 11 Apr 2012 09:21:28 +0000 (11:21 +0200)]
Debugger: Fix bugs in inspection tool

Incorrect display of hover and selection highlight for child items
having rotation and a different transform origin corrected.

Change-Id: Id25c5bf52b5c1abc3f98ac6bc90d89262cc4f2cd
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
12 years agoDebugger: Inspect tool - changes made to highlight on selection
Simjees Abraham [Wed, 11 Apr 2012 10:56:25 +0000 (12:56 +0200)]
Debugger: Inspect tool - changes made to highlight on selection

Changes made for the display of highlight on selection such that the
highlight is more prominent.

Change-Id: Iaf06bd04095be7b25881681e3f81c0fbf87df205
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
12 years agoSimplify date conversion functions
Matthew Vogt [Tue, 10 Apr 2012 07:12:58 +0000 (17:12 +1000)]
Simplify date conversion functions

Do not use the 3rd-party code from JSC, but instead use the QDateTime
functions for millisecond offsets from the epoch.

Note that this change is reviving the earlier change:
http://codereview.qt-project.org/1874.  The test failures for that
change no longer occur due to a change in the QDateTime behavior
applied by: http://codereview.qt-project.org/13169

There is still a semantic difference between QDateTime and the
ECMAScript specification with regards to the application of DST.
ECMAScript requires that the current DST adjustment should be applied
to historical dates, whereas QDateTime will apply the adjustment as
applicable at the epoch date to any prior dates.

Change-Id: Ibebd47c9d2b75a034342ffcda075501a6a527b8d
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoCreate accessible interfaces only for items with attached prop
Frederik Gladhorn [Fri, 23 Mar 2012 16:42:09 +0000 (17:42 +0100)]
Create accessible interfaces only for items with attached prop

If the attached property is not found, ignore the item, unless
it is part of the tree. We still create a valid hierarchy this
way, but filter out all irrelevant items. The same goes for
hit-testing.

On the other hand this patch enables the root item to be found
by setting isAccessible on it when updating the flags. Otherwise
the hierarchy is not valid again.

Change-Id: Ied422fd0506d13458757c87a5dad7cdb9d3079bf
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
12 years agoQQmlDebugServer: Use Q_D(const )
Aurindam Jana [Tue, 10 Apr 2012 15:36:31 +0000 (17:36 +0200)]
QQmlDebugServer: Use Q_D(const )

Change-Id: I118a7b9de886c712027c55c38be99f615aea6902
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoQmlDebug: Enable/Disable tool
Aurindam Jana [Wed, 4 Apr 2012 08:56:21 +0000 (10:56 +0200)]
QmlDebug: Enable/Disable tool

Change-Id: Icb200474f1edff62d2fdd4bad9389117966775d5
Reviewed-by: Simjees Abraham <simjees.abraham@nokia.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
12 years agoQmlDebug: Remove Color Tool
Aurindam Jana [Wed, 4 Apr 2012 14:18:17 +0000 (16:18 +0200)]
QmlDebug: Remove Color Tool

Change-Id: I3d54d24c2873648c9530ee8e7a33c95275e369e0
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
12 years agoQmlDebug: Highlight select items
Aurindam Jana [Thu, 5 Apr 2012 07:55:51 +0000 (09:55 +0200)]
QmlDebug: Highlight select items

Enable higlight of selected items only in Design Mode.

Change-Id: I06e97df51bf8632560932dda776e748df90bc163
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
12 years agoQmlDebug: Inspect Tool
Aurindam Jana [Wed, 4 Apr 2012 08:51:40 +0000 (10:51 +0200)]
QmlDebug: Inspect Tool

Select item on single click/tap and cycle through elements
in the view stack on double click/tap.

Change-Id: I36cdcbf3a8800a715eda6c916f4f206bac16e399
Reviewed-by: Simjees Abraham <simjees.abraham@nokia.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
12 years agoQmlDebug: Combine Selection and Zoom Tools
Aurindam Jana [Wed, 4 Apr 2012 08:33:00 +0000 (10:33 +0200)]
QmlDebug: Combine Selection and Zoom Tools

Combine the Selection and Zoom Tools into Inspect Tool.

Change-Id: I2477e2b27f5dde5d74489ecf3c43a049e2ed3aa3
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
12 years agoQmlDebug: Selection Tool Highlight
Aurindam Jana [Mon, 2 Apr 2012 07:19:13 +0000 (09:19 +0200)]
QmlDebug: Selection Tool Highlight

Show a light color overlay when hovering and a darker
overlay on selection.

Change-Id: I57c04840558a7345b7d5b0b8406c6e6dec72fde4
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
12 years agoUse relative position to when getting line from layout.
Andrew den Exter [Tue, 3 Apr 2012 23:59:58 +0000 (09:59 +1000)]
Use relative position to when getting line from layout.

textPos is the absolute position in the document, when querying an
individual layout use the position relative to the start of the layout.

Change-Id: Ic1d97fcc498051c99291357dba3303b3141ed502
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
12 years agoFix compilation on Linux
Anselmo L. S. Melo [Wed, 4 Apr 2012 14:28:22 +0000 (11:28 -0300)]
Fix compilation on Linux

Fix build error of QtDeclarative master (8b0831f0b0) on Linux with g++ 4.7.0.

Change-Id: I5aaa6e95c8ebd360a7fbf3bb3c85c699e6594ac7
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoFix erroneous signal emission in Loader
Chris Adams [Thu, 29 Mar 2012 01:14:59 +0000 (11:14 +1000)]
Fix erroneous signal emission in Loader

Previously, the incubator wasn't cleared when a Loader was
deactivated.  This commit clears it on deactivate, and also
ensures that the loadedSignal isn't emitted on error.

Finally, it re-enables a network-loading-related unit test.

Change-Id: I5dac92aead2c221c5d45011accf59077f7c9b402
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoMultiPointTouchArea documentation not to use deprecated signals
Pekka Vuorela [Wed, 4 Apr 2012 10:02:15 +0000 (13:02 +0300)]
MultiPointTouchArea documentation not to use deprecated signals

Change-Id: I9ba8b9f3dc35a3eec833f2f3cce6c94ebddd7ae0
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoProperly copy all event parameters in deliverMouseEvent()
Laszlo Agocs [Tue, 3 Apr 2012 09:24:52 +0000 (12:24 +0300)]
Properly copy all event parameters in deliverMouseEvent()

Timestamp and capabilities were missing. One of the very special flick
test cases needs to be fixed, because setting the proper timestamp
will now generate correct velocities. A potentially dangerous, legacy
implementation of flick() has also been updated to match how QTestLib
works in Qt 5.

Change-Id: Ibc99f7212ba21d41a419eaadac2fdda730658dc6
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoUse the updated module api registration function in example
Chris Adams [Mon, 2 Apr 2012 06:01:34 +0000 (16:01 +1000)]
Use the updated module api registration function in example

Previously, the example used the non-templated registration function.
This commit also links the qmlRegisterModuleApi documentation from the
"Creating QML Types" page.

Change-Id: I43afb5c051a52fef4059160972f7508f40dac523
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
12 years agoRewrite QAnimationGroupJob::clear() method
Charles Yin [Tue, 3 Apr 2012 06:52:29 +0000 (16:52 +1000)]
Rewrite QAnimationGroupJob::clear() method

Before removing and deleting children, set the m_group to 0 to avoid potential
cycling deletions when this method is called from QAnimationGroupJob::~QAnimationGroupJob().

Change-Id: Idb6920be71fc9e033e5a76b724c9550018995035
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoCreate plugins for Particles and Window submodules
Matthew Vogt [Thu, 5 Apr 2012 04:10:08 +0000 (14:10 +1000)]
Create plugins for Particles and Window submodules

To prevent errors when QML files import QtQuick.Particles or
QtQuick.Window before importing QtQuick itself, create plugins for
these submodules that make their import statements independent of
the QtQuick import.

Remove the automatic re-ordering of the imports list prior to loading
to ensure registered name conflicts can be resolved by changing the
order of import statements.

Task-number: QTBUG-24369
Change-Id: I248625fa30a813dddd2a64feb9a489768931939f
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoFix some issues with init_data() for qmltest
Charles Yin [Thu, 5 Apr 2012 00:17:34 +0000 (10:17 +1000)]
Fix some issues with init_data() for qmltest

1. should not use hasOwnProperty, replace it with 'in'
2. the default init_data() method is unnessary
3. when init_data() returns empty, the test function should run in non data driven mode

Change-Id: I8cb19d3499b285d07c8b3d04abd9ddf33b1c5395
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoFix access to uninitialised memory that might lead to crashes
Thiago Macieira [Sun, 18 Dec 2011 14:33:52 +0000 (15:33 +0100)]
Fix access to uninitialised memory that might lead to crashes

QMetaObject is POD, so its constructor is implicit and trivial
(doesn't initialise anything). QAbstractDynamicMetaObject doesn't add
a constructor, so the QMetaObject sub-object remains
uninitialised. The users of either class must ensure they initialise
the members if they will be accessed.

Change-Id: Ibb7f55ff23b78afb1fcb87382b30c8a28804c028
Task: QTBUG-23214
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoRemove sharing of V4 subscriptions
Roberto Raggi [Wed, 4 Apr 2012 11:37:33 +0000 (13:37 +0200)]
Remove sharing of V4 subscriptions

Unfortunately, sharing subscriptions doesn't play nice
with the linked lists we maintain to observe QML
bindings.

Change-Id: I8ab351987138caf8fa7fbdeff4dbf2b34184a05c
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoInline the methods of the V4 Register class
Roberto Raggi [Wed, 4 Apr 2012 07:16:02 +0000 (09:16 +0200)]
Inline the methods of the V4 Register class

Change-Id: Id4b5bfe2f5d3ec24dd1c4bc5f3d375c4f92345bd
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoRemove obsolete code
Roberto Raggi [Tue, 3 Apr 2012 14:12:19 +0000 (16:12 +0200)]
Remove obsolete code

Change-Id: I5812990703c4339018af4327cd7b44199a1705fd
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoDo not execute overwritten bindings
Aaron Kennedy [Wed, 4 Apr 2012 11:17:59 +0000 (12:17 +0100)]
Do not execute overwritten bindings

During the construction of an object, internal bindings can be
overwritten by the initialization of objects with outer scope.

Task-number: QTBUG-23138
Change-Id: I46a187d9cdc41f4dd96d068f39788a2255b8888d
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoRevert "Do not execute overwritten bindings"
Aaron Kennedy [Wed, 4 Apr 2012 11:19:06 +0000 (12:19 +0100)]
Revert "Do not execute overwritten bindings"

This reverts commit 639208cc7f3ab3d8356363559e8fcf168e32cf0b.

There were two problems with this submit:
    1. Maintaining a hash of all the properties we have assigned bindings
       to is massively inefficient.
    2. The autotest was in the qquickbinding testcase which is for the
       QtQuick "Binding" element, not for generic binding tests.

Change-Id: Id2150dbfe86c6844cc0b115d7f941ae8d6a60643
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoFlickable should only call ungrabMouse() if it is the mouse grabber
Andras Becsi [Mon, 2 Apr 2012 10:54:56 +0000 (12:54 +0200)]
Flickable should only call ungrabMouse() if it is the mouse grabber

Check whether the Flickable is the mouse grabber before ungrabbing
in mouseReleaseEvent() to suppress warnings in case event delivery
does not rely on mouse grabbing.

Change-Id: I3c3398ebbb9d8ab2cb6181677752b73e265cf02f
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoDo not crash on invalid binding diagnostic
Matthew Vogt [Wed, 4 Apr 2012 03:54:29 +0000 (13:54 +1000)]
Do not crash on invalid binding diagnostic

If there is no meta object for the property type of the recipient of
an invalid binding, fall back to QMetaType::typename().

Task-number: QTBUG-25161
Change-Id: I0bb768cbc166c04f62d20d8bb19e6ae883d7dc2f
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoDo not execute overwritten bindings
Matthew Vogt [Tue, 20 Mar 2012 23:17:25 +0000 (09:17 +1000)]
Do not execute overwritten bindings

During the construction of an object, internal bindings can be
overwritten by the initialization of objects with outer scope.

To yield the expected result, suppress the evaluation of inner
bindings that are overwritten by outer bindings, during the
completion phase of object creation.

Task-number: QTBUG-23138
Change-Id: I679309543a9b64c774bb99798ad5ccf518726d10
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
12 years agoSupport snapMode in PathView
Martin Jones [Wed, 21 Mar 2012 03:18:05 +0000 (13:18 +1000)]
Support snapMode in PathView

PathView missed out on snapMode, which is especially useful for
its SnapOneItem mode.

Change-Id: I0e9b080ef72d9bc1e305445cd8dfde8e21e4e3da
Reviewed-by: Bea Lam <bea.lam@nokia.com>
12 years agoUse wasDeleted function to check for deletion
Matthew Vogt [Wed, 4 Apr 2012 02:56:07 +0000 (12:56 +1000)]
Use wasDeleted function to check for deletion

Ensure that the check for deletion logic is consolidated in a single
location.

Task-number: QTBUG-25159
Change-Id: I27e856159afc745d68ec23cf3c872d740db8bcf3
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoUse the GCC pragma on GCC only
Thiago Macieira [Thu, 20 Oct 2011 19:23:32 +0000 (21:23 +0200)]
Use the GCC pragma on GCC only

Change-Id: I4a0680bddb4d4a73362406ddcd30569ee664d0cc
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoSilence warning about non-standard comma at the end of enum
Thiago Macieira [Thu, 20 Oct 2011 19:23:16 +0000 (21:23 +0200)]
Silence warning about non-standard comma at the end of enum

Change-Id: Iea14d05d3ce209d83ddf01a01ff94e17c6f11d86
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoRemove workaround for QTBUG-22919.
Andrew den Exter [Tue, 3 Apr 2012 23:59:25 +0000 (09:59 +1000)]
Remove workaround for QTBUG-22919.

Fixed in qtbase.

Change-Id: I2faff485d3aaf5639b211bd0a1b30bf9d37d2e69
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
12 years agoFixed crash when using 'var' property in ShaderEffect.
Kim Motoyoshi Kalland [Wed, 21 Mar 2012 13:21:51 +0000 (14:21 +0100)]
Fixed crash when using 'var' property in ShaderEffect.

Also made CustomParticle and ShaderEffect share some code.

Task-number: QTBUG-23924
Change-Id: I975f71f031b379cf5e29302a9c931e4ead5437ea
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
12 years agoRestore the declarative_debug config for qmltest
Charles Yin [Wed, 4 Apr 2012 00:58:35 +0000 (10:58 +1000)]
Restore the declarative_debug config for qmltest

There are some applications need this feature.

Change-Id: I036dd68177b70d334efa4989254b9166d9e41fcc
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoUpdate for API changes in the QPlatformSharedGraphicsCache
Eskil Abrahamsen Blomfeldt [Wed, 28 Mar 2012 14:12:02 +0000 (16:12 +0200)]
Update for API changes in the QPlatformSharedGraphicsCache

Change-Id: I6648d16a11343e2342b832c7416e72ce43ab175d
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
12 years agoDon't crash if calling a method on a QObject that has been gc()'d
Aaron Kennedy [Tue, 3 Apr 2012 11:37:29 +0000 (12:37 +0100)]
Don't crash if calling a method on a QObject that has been gc()'d

As we don't actually delete an object immediately when it is collected,
it is possible to get into a situation where a method is called on an
object after the collector has marked it to be destroyed.  This fixes
a crash in this case.

Change-Id: I131d4c5d7ed788a91aa52f6af2e5c089d9bf5e08
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoFix QML_BINDINGS_TEST and the V4 auto tests
Roberto Raggi [Tue, 3 Apr 2012 12:47:51 +0000 (14:47 +0200)]
Fix QML_BINDINGS_TEST and the V4 auto tests

Also, enable all the V4 auto tests.

Change-Id: I014a95298e6a834784a4a573ad3310e59e932ec4
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoAdd Throw instruction to the V4 virtual machine
Roberto Raggi [Mon, 2 Apr 2012 14:35:51 +0000 (16:35 +0200)]
Add Throw instruction to the V4 virtual machine

Also, throw an exception when trying to assign something that is not
a QUrl or a QString to a QUrl.

Change-Id: Ic48fd519c8318d391706ebca1955a5dd2ef6e80e
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoFix constant folding for simple binary expression
Roberto Raggi [Thu, 29 Mar 2012 09:46:41 +0000 (11:46 +0200)]
Fix constant folding for simple binary expression

This change improves constant folding of numeric and
string literals.

Also, we go back generating quadruples instead of
IR-tree-expressions. This is kind of needed to reduce register
pressure in the V4 VM. That is, V4 has typed registers so before
reusing a register we need to look at the type and eventually
dispose its contents (e.g. when a QString or a QUrl is stored
in the register). Unfortunately, we can't effort to have all
these checks in the V4 instructions. So we change `binop'
to generate literals (e.g. CONST or STRING) or a TEMP (aka
a preassigned register that cannot be reused).

For exmaple, the IR code generated for

  Rectangle {
    color: "b" + "l" + ("u" + "e")
    width: 10 + 20 + 30
  }

is

====================
line: 3 column: 10
L0x811ca10:
t0 = string_to_color("blue");
return t0;

====================
line: 4 column: 10
L0x811ca50:
return 60;

Change-Id: I4d8482ddab9193d8469bda6461bfb2e5a3eeb197
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoAdd support for floating conversions.
Roberto Raggi [Wed, 28 Mar 2012 09:31:02 +0000 (11:31 +0200)]
Add support for floating conversions.

Change-Id: I4feee2a3c5fcfa32b89859ddbfe17e6163983ab9
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoAdd floats to the high level IR type system.
Roberto Raggi [Wed, 28 Mar 2012 08:25:15 +0000 (10:25 +0200)]
Add floats to the high level IR type system.

Change-Id: If78870000eb72231e6eac67ec8a3d6441b5a4877
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoChange V4 to explicitly use doubles to represent numbers.
Roberto Raggi [Wed, 28 Mar 2012 07:33:16 +0000 (09:33 +0200)]
Change V4 to explicitly use doubles to represent numbers.

Rename the V4 instructions to match the new type system.

Change-Id: I640ab52c024a29179e816e29a12f0a36813d18c6
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoDo not automatically mark all text items as accessible.
Frederik Gladhorn [Fri, 23 Mar 2012 16:40:38 +0000 (17:40 +0100)]
Do not automatically mark all text items as accessible.

This adds more confusion and fails more often due
to invisible items and overlays that it helps.
The test saw lots of "children" before that were
text elements, these are gone now.

With this the hack to make children based on
item role invisible can go away.

Change-Id: Ic5a3bba6e271747237e0e85168f4290bf596bc8a
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
12 years agoProperly swizzle texture data before upload in QQuickPaintedItem.
Samuel Rødal [Tue, 3 Apr 2012 10:13:02 +0000 (12:13 +0200)]
Properly swizzle texture data before upload in QQuickPaintedItem.

We already did this properly in QSGPlainTexture, need to do it in
QSGPainterTexture as well, or red and blue channels will be swapped on
OpenGL ES 2.

Change-Id: I8b17a359b80d6c2e3b89d9c1d4c3d388a3ad1081
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
12 years agoFix the conversion of a colour from a string.
Thiago Macieira [Thu, 20 Oct 2011 08:51:09 +0000 (10:51 +0200)]
Fix the conversion of a colour from a string.

Don't assume it's HSL just because it isn't RGB.

This error was found by GCC's set-but-unused warning.

Change-Id: Ie22e1509892163fccb3868fe8ff7091dc7bf5091
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
12 years agoUse scope, not owner to look up enums in QQmlBoundSignal.
Michael Brasser [Tue, 3 Apr 2012 05:22:17 +0000 (15:22 +1000)]
Use scope, not owner to look up enums in QQmlBoundSignal.

With this, we no longer need to keep a pointer to the owner, so remove
it as well.

Change-Id: I0c38645b924bf5b0caadb46444cf6dd09abc1eb2
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoRevert "Add QQmlBoundSignalNoParams"
Michael Brasser [Tue, 3 Apr 2012 02:11:55 +0000 (12:11 +1000)]
Revert "Add QQmlBoundSignalNoParams"

This reverts commit ec7deb3d123bb44b5d57590615a60ed48b1d2860.

Other Qt modules may be relying on QObject::receivers() to
know when there is a QML signal handler for a signal, and
using QQmlNotifierEndpoint in QQmlBoundSignalNoParams breaks
this assumption.

Change-Id: I1b8085254697d909f85a88617eb4e3f258b88950
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoFix visibility of trailing preedit text.
Andrew den Exter [Tue, 3 Apr 2012 06:10:33 +0000 (16:10 +1000)]
Fix visibility of trailing preedit text.

The block iterator doesn't take into account pre-edit text so we need
to explicitly add pre-edit if it is positioned after the last fragment
in a block.

Change-Id: I1d26ee3ff86ea27674fc4f165b23ac5692a9ec17
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
12 years agoAdd init_data() function for default data driven testing
Charles Yin [Fri, 30 Mar 2012 12:59:20 +0000 (22:59 +1000)]
Add init_data() function for default data driven testing

If all or some test functions share the same test data, the test data
can be put into init_data() function, this can reduce unnecessary code
duplications.

Change-Id: I118dd9c3c1d0f2f238aab6e25e5d8af80b3d3049
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoAllow objects created in QML with incubateObject to be destroyed.
Michael Brasser [Tue, 3 Apr 2012 01:50:05 +0000 (11:50 +1000)]
Allow objects created in QML with incubateObject to be destroyed.

Change-Id: I8a0678ea8dff6f4a40ac367395a99dd025f7f08a
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoFix QQuickTextInput test instability.
Andrew den Exter [Tue, 3 Apr 2012 04:27:09 +0000 (14:27 +1000)]
Fix QQuickTextInput test instability.

Use a QWindow to steal focus rather than a second QQuickView, as it
appears there may be some issue with shared GL resources between views.

Change-Id: I8a134e3b4a1e54f645d0071543ec8f94338ff315
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
12 years agoSet cursorVisible to false when im cursor length is 0.
Andrew den Exter [Thu, 29 Mar 2012 06:34:09 +0000 (16:34 +1000)]
Set cursorVisible to false when im cursor length is 0.

If the length of the QInputMethodEvent::Cursor attribute is 0 the
cursor is supposed to be hidden.  To ensure this and any other IM
state is reverted when the input method is reset send a empty
event to the editor when preedit is cancelled or removed and
count formatting or cursor changes when determining if the
input method is composing (i.e has state that needs to be reset).

Change-Id: Ifca69aa0c18776b1aef355ed6ae9aecc40b9d475
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
12 years agoFix crash when changing the grandparent of an item with focus.
Andrew den Exter [Fri, 30 Mar 2012 07:36:40 +0000 (17:36 +1000)]
Fix crash when changing the grandparent of an item with focus.

When an item was reparented it's sub focus item was cleared and those
of it's children were cleared along with those in the tree the item was
removed from.  Since we now rely on the focus state of an unparented
tree to be correct we need to restore the sub focus items of the
unparented tree.

Change-Id: I236c512751b99092c7e9a39194f4680304bfacc5
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoScattered example fixes
Alan Alpert [Wed, 28 Mar 2012 08:46:31 +0000 (18:46 +1000)]
Scattered example fixes

Some using of pixel size, some moving an image because individual
sub-examples shouldn't depend on the shared folder.

Change-Id: If0f66f805f5fc9bcbf9b870274adac404466ec08
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
12 years agoirrelevant qDebug removed
Simjees Abraham [Fri, 30 Mar 2012 12:42:50 +0000 (14:42 +0200)]
irrelevant qDebug removed

syncing debugutil with the change done to remove the irrelevant qDebug
at stat of debug session.

Change-Id: I17520319684e6e213037b09550d1a97b493150cd
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
12 years agoDebugger: Use "QML" also in macro names
Kai Koehne [Fri, 30 Mar 2012 11:49:33 +0000 (13:49 +0200)]
Debugger: Use "QML" also in macro names

QT_DECLARATIVE_DEBUG will be removed as soon as qtbase is
updated.

Change-Id: I9dbfe95b8bcb3bf1502319a040a758389b6977a2
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
12 years agoirrelevant qDebug removed
Simjees Abraham [Fri, 30 Mar 2012 12:21:16 +0000 (14:21 +0200)]
irrelevant qDebug removed

Irrelevant debug statement which gets printed at start of debug session
is removed. The same is removed in Auto-tests as well.

Change-Id: If8f44950952f08b55ff884c1fe42670108e2369d
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
12 years agoFix exit crash when running samegame-desktop in qmlscene.
Friedemann Kleint [Thu, 29 Mar 2012 13:46:15 +0000 (15:46 +0200)]
Fix exit crash when running samegame-desktop in qmlscene.

Change-Id: Ib4c162a909eb45e99a7e5c31737587720e9e2deb
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
12 years agoAllocate QQuickView on heap instead of stack
Charles Yin [Fri, 30 Mar 2012 04:25:56 +0000 (14:25 +1000)]
Allocate QQuickView on heap instead of stack

Some qpa plugin will crash when delete the QApplication instance if
QQuickView is created on stack, this is a workaround fix, the real
reason still need to be investigated further.

Change-Id: Iea75541e53a94f65454e78f8020003e6533c0bd0
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoImprove the documentation of clearComponentCache()
Matthew Vogt [Fri, 30 Mar 2012 06:27:44 +0000 (16:27 +1000)]
Improve the documentation of clearComponentCache()

Change-Id: I842632a3173632b0fca521138caffe960b752da1
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoAllow V8 bindings to be assigned to aliases
Aaron Kennedy [Fri, 9 Mar 2012 11:29:51 +0000 (12:29 +0100)]
Allow V8 bindings to be assigned to aliases

V8 bindings must be able to be retargetted for them to be assignable
to aliases.

Change-Id: If72ff2a24188667113cbb46439129f8d2fcb8f90
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoLoosen shared binding tests
Aaron Kennedy [Fri, 9 Mar 2012 10:40:44 +0000 (11:40 +0100)]
Loosen shared binding tests

Previously we blocked all function calls, but only because we were trying
to prevent "eval" calls from appearing in shared bindings.  Instead this
test allows function calls as long as the identifier "eval" doesn't
appear.

This also exposed a crash with v8 bindings that is also fixed.

Change-Id: I22eefd290c7b82d9c01b2cd2907a46e560ae4db9
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoFix warnings in qtdeclarative.
Friedemann Kleint [Thu, 29 Mar 2012 09:16:37 +0000 (11:16 +0200)]
Fix warnings in qtdeclarative.

- QString from ASCII conversions
- Unused variables
- Pointer mismatches

Change-Id: I5f76dce4f2ba481c2c2bce8681cf8107bd629566
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoDebugger: Fix v8profiler failures on mac
Kai Koehne [Fri, 30 Mar 2012 07:42:53 +0000 (09:42 +0200)]
Debugger: Fix v8profiler failures on mac

Make the test more robust.

Change-Id: Id4e5d25e9f9cb0bdbe14670a060d7348bceeb823
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
12 years agoFix crash in QUrl-to-int conversion in v4
Chris Adams [Thu, 29 Mar 2012 05:15:23 +0000 (15:15 +1000)]
Fix crash in QUrl-to-int conversion in v4

Also adds various unit tests for other conversion operations.
Note that many of the conversion operations produce the wrong results,
and have been marked with QTBUG-24706.

Task-number: QTBUG-24706
Change-Id: Id96a7409e31f2e889dce6b501247f58b59fa6a98
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoFix forceActiveFocus() with multiple items having focus: true
Andrew den Exter [Wed, 28 Mar 2012 08:11:14 +0000 (18:11 +1000)]
Fix forceActiveFocus() with multiple items having focus: true

Ensure focus is cleared from an item if it is parented to an item that
already has a sub focus item.  Checking scopedFocusItem() didn't allow
for the case where an unparented item is the root of the focus tree
but not itself a focus scope, checking the unguarded subFocusItem
member will.

Change-Id: I482779e8077e9f282d22bd0090e669840764e52a
Reviewed-by: Bea Lam <bea.lam@nokia.com>