profile/ivi/qtdeclarative.git
12 years agoFix the logic in void return type check
Kent Hansen [Wed, 23 May 2012 21:09:15 +0000 (23:09 +0200)]
Fix the logic in void return type check

Since the introduction of QMetaType::UnknownType, QMetaType::Void no
longer has value 0. Hence, the optimization in this code (avoiding
return type construction/passing/conversion when the return type is
void) was "lost".

Change-Id: I32313f8287c4f0e01fee3c2b4ba722f31457242c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
12 years agoMake qqmlmoduleplugin tests pass in shadow builds.
Andrew den Exter [Thu, 17 May 2012 04:38:33 +0000 (14:38 +1000)]
Make qqmlmoduleplugin tests pass in shadow builds.

The plugin binary and qml files for a module need to be in the same
directory.  This was solved for source builds because the files were
already located in the import path, but with shadow builds the files
were split between the build and source trees.  To solve this we copy
the files to the import path when doing a build.  So no files are
copied on top of themselves all mixed module files have been relocated
to their module source directory.

Change-Id: I238af998a0f766e67ed6d0023e5ab4c2a4ea67af
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoRemove QJSEngine::ContextOwnership and associated constructor
Kent Hansen [Tue, 22 May 2012 13:30:11 +0000 (15:30 +0200)]
Remove QJSEngine::ContextOwnership and associated constructor

This API was intended for QtWebKit integration, but we decided to
keep it out of the public headers and introduce it in a different
way later.

Change-Id: I7f30b20b741eca8569e63a7e4e27171d75293567
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
12 years agoRemove QQmlEngine::collectGarbage() overload
Kent Hansen [Tue, 22 May 2012 13:13:08 +0000 (15:13 +0200)]
Remove QQmlEngine::collectGarbage() overload

QQmlEngine inherits from QJSEngine, which has a collectGarbage()
function that does exactly the same.

Also remove doc references to non-existing function
reportAdditionalMemoryCost().

Change-Id: Iff12d2cf940f3afcd88967eb9a841c2f6082ca37
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
12 years agoRemove duplicated doc files and images
Bea Lam [Thu, 24 May 2012 05:34:59 +0000 (15:34 +1000)]
Remove duplicated doc files and images

- Remove doc/ files which were duplicated under src/quick/doc and
  src/qml/doc
- Remove duplicated images under src/doc/qml/images which were already
  under src/doc/quick/images
- Merged 0102413396c91e97ed856235cd1a52f7185c4862 and
  3b04bbde6356797368114fce1b45b85271e9fed8 which made it into doc/src
  but not src/qml/doc

Change-Id: I275b7d29f9fc2222dcf801c257c1f67b5880446b
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
12 years agoOptimize QML enum resolution
Martin Jones [Fri, 18 May 2012 01:52:17 +0000 (11:52 +1000)]
Optimize QML enum resolution

Change-Id: Ibc9ffe882045adf1c1149601c3499e31b9393eeb
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoEnable binding to properties of type QJSValue.
Andrew den Exter [Fri, 11 May 2012 07:37:07 +0000 (17:37 +1000)]
Enable binding to properties of type QJSValue.

This allows javascript objects of all types to be bound to properties
declared in c++.  Compared to a QVariant the primary benefit this offers
is a type which functions and objects with functions can be bound to.

Change-Id: Idb3313e7ff1d616ab12d44f616083c8296201f3a
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
12 years agoFix crash in VisualDataModel drag selection example.
Andrew den Exter [Wed, 23 May 2012 04:58:13 +0000 (14:58 +1000)]
Fix crash in VisualDataModel drag selection example.

The crash was an assert on an invalid pre-condition, and that's simply
been removed.  But it did highlight another issue when moving items
due to separate code paths for iterating forwards and backward in
a composited list.  Basically when iterating backwards because we're
looking for the first instance of an index it's necessary to overshoot
a little to an index prior and then iterate forwards, and as such
there's little difference between iterating forward or backwards.

Change-Id: I6252e3e0170dc2c72d0204137c69275c8ccc519b
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoFix performance regression in VisualDataModel.
Andrew den Exter [Thu, 24 May 2012 00:55:06 +0000 (10:55 +1000)]
Fix performance regression in VisualDataModel.

Restore assignment of the shared property cache to individual items
created.

Change-Id: I7d4bc0253d644e07a8803f47b3afabaa8ef47146
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoContruct per-delegate QQmlContextData directly.
Andrew den Exter [Mon, 2 Apr 2012 03:20:04 +0000 (13:20 +1000)]
Contruct per-delegate QQmlContextData directly.

The QQmlContext object created per item is a weighty (QObject) wrapper
around QQmlContextData that isn't utilized except as an intermeditrary
for the QQmlComponent API.  By duplicating a little code out of
QQmlComponent we can avoid the need to ever contruct the wrapper.

Change-Id: I74558c7e746ead2c5127a8754d5f04550b8f4d10
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoDon't construct VisualDataModel attached properties unless requested.
Andrew den Exter [Wed, 28 Mar 2012 07:42:32 +0000 (17:42 +1000)]
Don't construct VisualDataModel attached properties unless requested.

This saves allocating a QObject per item model in the common case.

Change-Id: I0e77e6c6c0c64ac6c5e482ef55e194c68e778b32
Reviewed-by: Bea Lam <bea.lam@nokia.com>
12 years agoEnsure that main thread processes worker data events
Matthew Vogt [Wed, 23 May 2012 05:52:31 +0000 (15:52 +1000)]
Ensure that main thread processes worker data events

If the main thread goes into a wait for the worker thread before
the worker thread posts the event that triggers the main thread to
process generated data, deadlock results.

Change-Id: I3788acef73e82aa96f2b86bcb48933d01ae86841
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
12 years agoOptimize qmldir parsing
Martin Jones [Fri, 18 May 2012 05:53:51 +0000 (15:53 +1000)]
Optimize qmldir parsing

From 840K instr to 340K instr for large project.

Change-Id: Ib1e4d5ea94001b6650211b96f262db28a05d8260
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoOptimize QML parser
Martin Jones [Fri, 18 May 2012 04:24:59 +0000 (14:24 +1000)]
Optimize QML parser

Inlining and faster number parsing.  Reduces parsing of large
project from 20.5mil instr to 19mil instr.

Change-Id: I83aff3eaf03fd19b07f5e84ec6f9d17b7f0cb931
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoEnsure QQuickView's engine outlives the root component
Matthew Vogt [Wed, 23 May 2012 22:55:39 +0000 (08:55 +1000)]
Ensure QQuickView's engine outlives the  root component

If the engine is destroyed before the root component, assumptions of
resource availability are broken.

Change-Id: I7fe27ff38ae3c215d58fb8811aff449b6c1f7b5b
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoRemove default parenting in Qt.createComponent()
Matthew Vogt [Wed, 23 May 2012 06:12:44 +0000 (16:12 +1000)]
Remove default parenting in Qt.createComponent()

Remove the default parent applied to component instances created by
Qt.createComponent().  This allows these objects to be managed by usual
JS reference management, and thus to be appropriately garbage
collected.

Task-number: QTBUG-24841
Change-Id: I29efbb9d8f5a2ef4c74415399fa3024e6590004b
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoOrganize data members in QQuickParticleData
Alan Alpert [Tue, 22 May 2012 07:27:23 +0000 (17:27 +1000)]
Organize data members in QQuickParticleData

Change-Id: Ibf14dc0f9ef9e17225f07f31276085c9ca83d4f1
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
12 years agoRemove deprectated MultiPointTouchArea signals.
Michael Brasser [Fri, 18 May 2012 03:03:22 +0000 (13:03 +1000)]
Remove deprectated MultiPointTouchArea signals.

Change-Id: Icea6d17704b2ddb7917bc0c0fea11dd625562685
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
12 years agoOptimize QML type registration.
Martin Jones [Fri, 18 May 2012 00:54:09 +0000 (10:54 +1000)]
Optimize QML type registration.

Change-Id: I981f5e2e6d7f6089e9f326d41a65e54668b73120
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoIntroduce a new constructor to QQuickView
Charles Yin [Thu, 3 May 2012 01:36:36 +0000 (11:36 +1000)]
Introduce a new constructor to QQuickView

Make it possible let QQuickView use an existing qml engine
and multiple QQuickView objects can share one QQmlEngine instance.

Change-Id: I035d1c15155be22f1131b504c40cf4ffb5da0f45
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
12 years agoAdd unit tests for SVG path
Charles Yin [Tue, 22 May 2012 01:37:50 +0000 (11:37 +1000)]
Add unit tests for SVG path

Change-Id: I4358416ccf973940fbd54633254274ba0a18e777
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoRemoved CONFIG+=parallel_test from suspected parallel-unsafe test [2]
Rohan McGovern [Wed, 23 May 2012 00:20:10 +0000 (10:20 +1000)]
Removed CONFIG+=parallel_test from suspected parallel-unsafe test [2]

This test has failed a parallel stress test and may contribute to
instability in test runs.

Change-Id: I7db5313078f3b3b9a7ae59facd5dbcb03777e7b8
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
12 years agoOnly preallocate 1 change listener per animation instance
Charles Yin [Fri, 18 May 2012 02:04:17 +0000 (12:04 +1000)]
Only preallocate 1 change listener per animation instance

In most cases, only one animation change listener is added to animation instance,
so change QPODVector's Increment parameter from 4 to 1 can save 24 bytes (8 bytes for each listener) per animation instance.

Change-Id: Iaf50016899963689f2bf84c3dd14fcd05c306d21
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoAdd completeToBeginning()/completeToEnd() to animation controller
Charles Yin [Thu, 17 May 2012 04:43:43 +0000 (14:43 +1000)]
Add completeToBeginning()/completeToEnd() to animation controller

Change-Id: I1abac96754cc82c8e0e00c58a27c09b68c5075c1
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoUse the default timeout for tryCompare
Charles Yin [Tue, 22 May 2012 06:14:27 +0000 (16:14 +1000)]
Use the default timeout for tryCompare

Even with this fix, the test still fails in CI,
so mark this test as insignificant until we figure out the real reason.

Change-Id: Idd07820c63b0c9627c86ed87f97b5ade6a552f7e
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoAdd QQuickCanvas::update()
Gunnar Sletta [Wed, 16 May 2012 18:16:07 +0000 (20:16 +0200)]
Add QQuickCanvas::update()

We would like to make a distinction between QQuickItem::update()
which triggers updatePaintNode() to synchronize the scene
graph and requesting the toplevel QQuickCanvas to be repainted.

If we have this distinction in place it is possible for the
scene graph to detect that the scene is unchanged and avoid
rendering unless the user has explicitely asked for the
canvas to be repainted, which is often the case when hooking
into QQuickCanvas::beforeRender().

Change-Id: Ibe77f58423593deb217ef9f8082fa12009f45daf
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoReexport the shader effect texture
Gunnar Sletta [Tue, 22 May 2012 12:14:11 +0000 (14:14 +0200)]
Reexport the shader effect texture

Change-Id: I4fd2b40bc2ed6bb977cb410a4822517f750f53ff
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
12 years agoReplace (un)checkAction with toggleAction (2/3)
Jan-Arve Saether [Tue, 22 May 2012 07:04:59 +0000 (09:04 +0200)]
Replace (un)checkAction with toggleAction (2/3)

Needed in order to finalize the replacement of {check,uncheck}Action
with toggleAction.

Change-Id: I7328275aa86cf4e8dc093f86597529b41fefd4a6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
12 years agoQtDeclarative: Fix warnings about deprecated QCoreApplication::translate().
Friedemann Kleint [Mon, 21 May 2012 10:38:46 +0000 (12:38 +0200)]
QtDeclarative: Fix warnings about deprecated QCoreApplication::translate().

Change-Id: I4abd4ee98ca9d4267c5ad71d3b9c2e7d5de60902
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoQuick/QQuickFontLoader: Output warning on failure.
Friedemann Kleint [Tue, 22 May 2012 06:28:04 +0000 (08:28 +0200)]
Quick/QQuickFontLoader: Output warning on failure.

Helps in case the 'file::' prefix is missing from local file URLs
on Windows. 'C:\foo' is then interpreted as URL with protocol
'c', causing an error.

Change-Id: I252ab453a7ce241f3bd290ef59d3106110146662
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
12 years agoDoc: Added two new articles for the QML documentation
Jerome Pasion [Tue, 22 May 2012 10:04:25 +0000 (12:04 +0200)]
Doc: Added two new articles for the QML documentation

-for the new documentation structure

Change-Id: I5b047fb47e479eb1ae25bd44f8e29b6b705f1b83
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
12 years agoAccessibility: Implement invisible and checkable state
Jan-Arve Saether [Tue, 15 May 2012 12:26:09 +0000 (14:26 +0200)]
Accessibility: Implement invisible and checkable state

Change-Id: I3a079b4171e611b0136ef1582f6f16f71cf8f340
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
12 years agodoc fix
Charles Yin [Mon, 21 May 2012 04:50:40 +0000 (14:50 +1000)]
doc fix

renderTarget/renderStrategy property type should be enumeration.

Change-Id: I454c5c1d7b5be8290a25b81f8a9b9a54ebf515ec
Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
12 years agoExamples cleanup
Alan Alpert [Mon, 14 May 2012 03:52:41 +0000 (13:52 +1000)]
Examples cleanup

Rename calculator/CalculatorCore to calculator/content for consistency.
Also fix license headers in calculator and samegame to be the examples
license instead of the source license.

Change-Id: Ia2254fcd7cce1114199921ede91bf8f032058f77
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoRemoved CONFIG+=parallel_test from suspected parallel-unsafe tests
Rohan McGovern [Mon, 21 May 2012 22:45:27 +0000 (08:45 +1000)]
Removed CONFIG+=parallel_test from suspected parallel-unsafe tests

These tests have failed a parallel stress test and may contribute to
instability in test runs.

Change-Id: I8d82e9df7df6cac374b8b2eda43de8e96b676972
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoDebugger: Response for DESTROY_OBJECT request sent correctly
Simjees Abraham [Mon, 21 May 2012 12:22:08 +0000 (14:22 +0200)]
Debugger: Response for DESTROY_OBJECT request sent correctly

The response for request DESTROY_OBJECT is sent after the
object has been destroyed. This enables the creator to
sync the objects tree displayed for debugging.

Change-Id: Icedaf92df4402f067fd5b8590811c770e4b9063e
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
12 years agoSimplify a type name query.
Jędrzej Nowacki [Fri, 18 May 2012 15:21:09 +0000 (17:21 +0200)]
Simplify a type name query.

QVariant::typeToName is calling QMetaType::typeName and returns the same
data.

Change-Id: I4028f54ef318292e27eaa0e6981ea114e6e6cd52
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoSimplify QVariant::convert and QVariant::canConvert calls.
Jędrzej Nowacki [Fri, 18 May 2012 15:30:03 +0000 (17:30 +0200)]
Simplify QVariant::convert and QVariant::canConvert calls.

QVariant::Type casts are not necessary in Qt5.

Change-Id: Ia2e7d8fa367a59c23bd06993db36d96a0a46a229
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoQtDeclarative: Fix warning about construction of a QString from ASCII.
Friedemann Kleint [Mon, 21 May 2012 10:41:37 +0000 (12:41 +0200)]
QtDeclarative: Fix warning about construction of a QString from ASCII.

Change-Id: I893fc4cb9741ec930e35fabdc9bdccca0e467e5e
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoQtDeclarative: Fix warnings about uninitialized variables.
Friedemann Kleint [Mon, 21 May 2012 11:41:43 +0000 (13:41 +0200)]
QtDeclarative: Fix warnings about uninitialized variables.

Change-Id: Ie918f1e813b243b250cedfc2e94e9c66288d08e3
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agodoc: Added missing qdoc text
Martin Smith [Mon, 21 May 2012 09:05:11 +0000 (11:05 +0200)]
doc: Added missing qdoc text

A \table command was not matched by a
\entable command, and the qdoc comment
for one \qmlproperty command was not
terminated, so that a second \qmlproperty
command appeared in the same comment.

Change-Id: I398e8afd1dba84a74b62b6881990de81070c24b7
Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com>
12 years agoNull out the d pointer in QQuickMouseEventEx dtor
Laszlo Agocs [Mon, 21 May 2012 06:30:07 +0000 (09:30 +0300)]
Null out the d pointer in QQuickMouseEventEx dtor

Otherwise every single app will assert in ~QEvent when
QML_TRANSLATE_TOUCH_TO_MOUSE is enabled.

Change-Id: Ib0590a980cb00b913ec096bcdfba57fffaa19eb1
Reviewed-by: Shawn Rutledge <shawn.rutledge@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoQml : Resetting binding corrected
Simjees Abraham [Wed, 16 May 2012 13:20:59 +0000 (15:20 +0200)]
Qml : Resetting binding corrected

Resetting the binding for property corrected in case the property is
nested (eg: font.bold)

Task-number: QTCREATORBUG-6294
Change-Id: I39cca54c17860c4e6df1cf864cc2f70214d50c8f
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
12 years agoFix crash in QQuickVisualDataModel test.
Andrew den Exter [Fri, 18 May 2012 06:07:52 +0000 (16:07 +1000)]
Fix crash in QQuickVisualDataModel test.

"item" + 1 will not concatenate.

Change-Id: Icea095fd3183ba1b0e9b0e19b0c1fb6758f39ff3
Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
12 years agoAlways emit signal after ShaderEffectSource::scheduleUpdate().
Kim Motoyoshi Kalland [Fri, 18 May 2012 12:23:29 +0000 (14:23 +0200)]
Always emit signal after ShaderEffectSource::scheduleUpdate().

The scheduledUpdateCompleted signal was originally added so that
you can take some action after updating a ShaderEffectSource with
scheduleUpdate(). However, before this commit, the signal would
not be emitted if the ShaderEffectSource was already up-to-date.
Instead, the signal would be delayed until the next time the
ShaderEffectSource was redrawn. This commit ensures the signal is
emitted even if the ShaderEffectSource is already up-to-date.

Change-Id: Idd22cdea1f7c14ed7a45081c98b8cfbef896dccd
Reviewed-by: Kim Gronholm <kim.1.gronholm@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
12 years agoRemove unused variable.
Kim Motoyoshi Kalland [Fri, 18 May 2012 11:53:27 +0000 (13:53 +0200)]
Remove unused variable.

Change-Id: I49fee9c96a9f1b54a790d2dd8a3d1f0a3c7f8a5a
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
12 years agoEnsure repeated compilation does not fail
Matthew Vogt [Mon, 21 May 2012 03:40:22 +0000 (13:40 +1000)]
Ensure repeated compilation does not fail

Failure could result from the allocation of an address previously used
for the same class.  The test is repeated for a surprisingly large
count of repetitions to increase the chance of this occurring.

Change-Id: I045902c50021f23adbbd61fccf41b9c38657387a
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoDetect and abort if an object is deleted during signal handling
Kent Hansen [Wed, 16 May 2012 06:58:37 +0000 (08:58 +0200)]
Detect and abort if an object is deleted during signal handling

If an object gets deleted while one of its own signal handler
expressions is being evaluated, a subsequent crash is inevitable.

While we could introduce guards/checks in the signal handler kernel
(QMetaObject::activate(), QQmlNotifier::emitNotify() and friends) to
detect and mask the sender deletion, this arguably isn't helpful; the
code that emitted the signal is likely to access member variables
directly after emitting the signal, causing semi-random crashes.

This situation is a symptom of misbehaving application code. Catch it
early rather than later, and issue a qFatal() with a helpful message.
Coupled with a backtrace, this should make it easier to track down
the flawed C++ application logic.

Change-Id: I8c77800e49c475def613224f208181c2d0af60e6
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoDoc: Moved and added Qt Quick and Qt QML documentation.
Jerome Pasion [Wed, 16 May 2012 14:15:57 +0000 (16:15 +0200)]
Doc: Moved and added Qt Quick and Qt QML documentation.

-moved the documentation to separate aspects:
    QML the language
    QML engine
    QML bindings
-fixed landing page for Qt Quick
-removed duplicate module pages
-added content as a base structure
-added Qt QML source in the Qt Quick module documentation

Part of QTBUG-25689

Change-Id: Ib12ceedfbd689a9f764a91e669bc7c2a433643aa
Reviewed-by: Peter Yard <peter.yard@nokia.com>
Reviewed-by: Bea Lam <bea.lam@nokia.com>
12 years agoFixed missing repaints with threaded renderer.
Samuel Rødal [Sat, 19 May 2012 11:19:09 +0000 (13:19 +0200)]
Fixed missing repaints with threaded renderer.

Update when we get an expose event, like the trivial renderer does.

Change-Id: Ib95559da35b94d84c0935c6abb24fdfb1e05fa1c
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
12 years agoImprove detection of deleted VisualDataModel items.
Andrew den Exter [Wed, 28 Mar 2012 06:30:50 +0000 (16:30 +1000)]
Improve detection of deleted VisualDataModel items.

The data object for each delegate object has a pointer guard with a
virtual objectDestroyed() function, that's a better tool for detecting
deletion than the destructor of a child object.

Change-Id: Iad1516e3daeb5e019ece6c3b2eb65da768cf43cb
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoInitialize VisualDataModel v8 object constructor on demand.
Andrew den Exter [Wed, 28 Mar 2012 05:28:33 +0000 (15:28 +1000)]
Initialize VisualDataModel v8 object constructor on demand.

Avoid allocating data that isn't needed.

Change-Id: I6f1d55f535599516a8b5e711f977e81afd337bd6
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoRefactor QQuickVisualAdaptorModel to reduce memory consumption.
Andrew den Exter [Fri, 16 Mar 2012 05:37:14 +0000 (15:37 +1000)]
Refactor QQuickVisualAdaptorModel to reduce memory consumption.

Don't inherit from QObject.
Use a single QQmlGuard for all model types, and reset the model
property if the model is deleted.
Construct v8 object template on demand.
Store model type specific data in a separate class that is allocated
on demand.

Change-Id: Id4f7b235741555b6ffba3fcf11727d85d6920e9e
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoAllow the existence of a VME metaobject to be asserted
Matthew Vogt [Tue, 15 May 2012 06:56:40 +0000 (16:56 +1000)]
Allow the existence of a VME metaobject to be asserted

Test for the existence of a VME metaobject.  Otherwise, assertion of
a static cast result is not meaningful.

Change-Id: Ic9e9c38e5dce65c41d20e405c33e179334c37b00
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoRemove dead code from QQmlNotifierEndpoint
Chris Adams [Fri, 18 May 2012 03:23:09 +0000 (13:23 +1000)]
Remove dead code from QQmlNotifierEndpoint

The copyAndClear() function is unused and untested.

Change-Id: I75cece92e4af691c03c6b7251be3182fa10cfe6c
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoImprove memory usage of Connections and signal handlers.
Michael Brasser [Mon, 14 May 2012 05:51:28 +0000 (15:51 +1000)]
Improve memory usage of Connections and signal handlers.

Following the pattern of 330152354aed8496ac78d145e14b25ee2d7bf8fb, store
the source as Utf8. Keep one less copy of the source when possible.

Change-Id: Ifa5f5fdc9ea3d48e904489dc262145eff36e710c
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
12 years agoRemove QSKIP from test.
Andrew den Exter [Thu, 17 May 2012 06:50:44 +0000 (16:50 +1000)]
Remove QSKIP from test.

Fix merged in qtbase.

Task-number: QTBUG-24801

Change-Id: I41de3b20938bd63861fba14a43b23ed8d91414d5
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
12 years agoRemove unnecessary exports
Matthew Vogt [Mon, 14 May 2012 23:02:09 +0000 (09:02 +1000)]
Remove unnecessary exports

Reduce library load time by removing any exports which are not required
by existing clients.

Task-number: QTBUG-24768
Change-Id: Ia5754d6f97bb2ed46e290820a5b092f85a4bc5b0
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoAdd optional width and height arguments to mapToItem()/mapFromItem()
Yann Bodson [Wed, 16 May 2012 02:59:32 +0000 (12:59 +1000)]
Add optional width and height arguments to mapToItem()/mapFromItem()

When specifying the width and height from QML, mapToItem()/mapFromItem()
will use QQuickItem::mapRectToItem (and mapRectFromItem).

Task-number: QTBUG-25755
Change-Id: Iae87671913623969d7428dd008afaa6faf3faf33
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoOptimize type resolution
Martin Jones [Wed, 16 May 2012 07:49:32 +0000 (17:49 +1000)]
Optimize type resolution

Faster qmlType() and resolveType() lookup.

Change-Id: I096439f23bf6071e8bfdf0cda366cc71e00293ba
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoImprove composite property type unit test
Chris Adams [Thu, 17 May 2012 03:40:50 +0000 (13:40 +1000)]
Improve composite property type unit test

Previously, the test ensured that the (variant) value returned by
QQmlProperty::read() was identical to that returned by
QMetaProperty::read(), which isn't the case if an engine is passed
to the QQmlProperty constructor.  This commit expands the unit test
to ensure that the actual QObject-ptr value is identical, rather
than the variant value (which may have differing type information),
regardless of whether an engine is passed in or not.

For list properties, the individual values are (in general) not able
to be accessed, and so the unit test for list properties is relaxed.

Change-Id: Iec40dca147a0bb793359b28facbcae69cc49c1ad
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoAdd QQmlEngine::trimComponentCache()
Matthew Vogt [Thu, 3 May 2012 22:32:45 +0000 (08:32 +1000)]
Add QQmlEngine::trimComponentCache()

Allow unused data in the engine's component cache to be safely discarded
so that the memory can be freed for other purposes.

Unloading of scripts that are no longer required after trimming unused
components is not yet supported.

Task-number: QTBUG-25653
Change-Id: I37bc9d5592eeb5edceeb34d010a555dcffd11cea
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoFix signal handlers for signals with default arguments.
Michael Brasser [Wed, 16 May 2012 02:31:59 +0000 (12:31 +1000)]
Fix signal handlers for signals with default arguments.

For cloned signals, connect to the index of the original. This was a
regression caused by the switch to QQmlNotifierEndpoint for signal
handlers. This change also makes parameters with default arguments
available from QML, while previously they were unavailable.

Change-Id: I1feb3412c3e9b0f2a5d6644c404c56d53c5544ac
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoMore defense programming in animation code
Charles Yin [Wed, 9 May 2012 06:01:51 +0000 (16:01 +1000)]
More defense programming in animation code

1. Add more deletion checkings in animation job code
2. Add some more asserts

Change-Id: I34772792ea4638b61eb2c3d65da5d35ce75183d7
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoSkip failing test.
Andrew den Exter [Wed, 16 May 2012 23:35:34 +0000 (09:35 +1000)]
Skip failing test.

Fix in qtbase can't be merged until the QEXPECT_FAIL's are removed.

Change-Id: Id416627cce3074549eda13331b7a88cc0313a910
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
12 years agoFix incorrect text alignment in TextEdit.
Andrew den Exter [Wed, 16 May 2012 06:07:47 +0000 (16:07 +1000)]
Fix incorrect text alignment in TextEdit.

QTextDocument always spans the full width of a TextEdit so the text
node shouldn't be offset by the x position of the bounding rect.

Change-Id: I882a44baeea4d054279cadc5632df6d8863caea1
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
12 years agoOnly genereate new texture if texture id is 0
Charles Yin [Wed, 16 May 2012 06:05:06 +0000 (16:05 +1000)]
Only genereate new texture if texture id is 0

Otherwise a new texture would be created for accessing textureId()
function everytime and even worse thing is these textures will never
been deleted and eventually cause gl out of memory.

Change-Id: I349fcf15b5aeabbd9420a8dd645e0fdcc1d256bf
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
12 years agoUsing QStringLiteral or QLatin1String instead of QLatin1Literal
Debao Zhang [Tue, 24 Apr 2012 03:22:22 +0000 (20:22 -0700)]
Using QStringLiteral or QLatin1String instead of QLatin1Literal

Change-Id: Ie1435f1ac5c81d8781e7118121ed07c7202ab124
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoRemoved ### from scenegraph
Gunnar Sletta [Wed, 16 May 2012 12:41:30 +0000 (14:41 +0200)]
Removed ### from scenegraph

Change-Id: I6b114938d2c52df95469975ffa87449f7fd8c647
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
12 years agoAccessibility: Do not look for the "text" property as a last resort.
Jan-Arve Saether [Tue, 15 May 2012 13:01:23 +0000 (15:01 +0200)]
Accessibility: Do not look for the "text" property as a last resort.

This does not work very well with items where the text property
is just an alias to the concrete property on a child item.
The screen reader might then read aloud the text twice, one for the
item with the alias, and another time for the child item.

Change-Id: I11764c2988b1b3b10b6d80ed8978ef2191d51097
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
12 years agoLocal Storage: Moving local storage documentation from doc to src
Jerome Pasion [Wed, 16 May 2012 13:24:34 +0000 (15:24 +0200)]
Local Storage: Moving local storage documentation from doc to src

-A submodule of QtQuick, moving to src/quick/doc/src/localstorage

Change-Id: I394ceacac695e17b656339445c22450cea973e95
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
12 years agoDocument the dangers of executing the event loop in QML API
Martin Jones [Wed, 16 May 2012 00:34:19 +0000 (10:34 +1000)]
Document the dangers of executing the event loop in QML API

Change-Id: I0294dd85fcc60615240a33c6e4a108fbde17a4bc
Reviewed-by: Bea Lam <bea.lam@nokia.com>
12 years agoFix documentation for QSGGeometry::allocate()
Glenn Watson [Wed, 9 May 2012 01:31:45 +0000 (11:31 +1000)]
Fix documentation for QSGGeometry::allocate()

Make clear in the documentation that client code must dirty the
geometry node that contains the geometry class, to allow the
renderer implementation to update internal buffers.

Change-Id: I5cfddee1d0969410d7b3175c381679bd9083cc2b
Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
Reviewed-by: Alex Wilson <alex.wilson@nokia.com>
12 years agoEnsure that we don't attempt to dispose handle twice
Chris Adams [Tue, 15 May 2012 02:15:35 +0000 (12:15 +1000)]
Ensure that we don't attempt to dispose handle twice

If a weak ref callback causes disposal of a v8object associated with
a qobject, the later qqmldata::destroyed() handler could cause a
double dispose, due to 753d9f4be5960be8b11ad067b29fc87c168ee663.

Change-Id: I07c1c8e2e7b444a7e873da26bc4d0c19bcfe57b5
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
12 years agoFix composite type property support
Chris Adams [Wed, 9 May 2012 02:21:41 +0000 (12:21 +1000)]
Fix composite type property support

The metatype changes caused a regression in composite type properties
for which there was no autotest.  In particular, declarative previously
used the transitional QMetaType::registerType() function, whose
implementation specifies a zero-size, which means that accessing a
property of that type via QObject::property would fail.

This commit adds some unit tests to track the issue, and also fixes the
implementation of QQmlEnginePrivate::registerCompositeType to use the
updated metatype registration functions.

Task-number: QTBUG-25697
Change-Id: Ic4abc1711aee8cf4a50a2ef1769465ef73f5d022
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
12 years agoDocument inconsistency with JS-to-Qt date/time conversion
Matthew Vogt [Mon, 14 May 2012 23:41:34 +0000 (09:41 +1000)]
Document inconsistency with JS-to-Qt date/time conversion

The Qt locale object can yield an incorrect date/time string when
there is a variation in interpretation of historical DST
applicability.

Change-Id: Ie1e66f0ed838da4972359634bd3ea1ebd692cc3d
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoEnable memory profiler symbol lookup.
Glenn Watson [Tue, 15 May 2012 22:14:13 +0000 (08:14 +1000)]
Enable memory profiler symbol lookup.

Enable the profiler initialization, now that the required
API is available in qtbase.

Change-Id: I620eade732cfe2de88360515350a7f95676fca04
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoMore efficient property interceptor implementation
Aaron Kennedy [Mon, 14 May 2012 10:12:00 +0000 (11:12 +0100)]
More efficient property interceptor implementation

The initial implementation vastly overestimated the number of interceptors
that would exist.

Change-Id: Ieddc55306e5976a9373a2b468013936240228992
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoQml module is not dependent on gui module
Tapani Mikola [Tue, 15 May 2012 10:44:37 +0000 (13:44 +0300)]
Qml module is not dependent on gui module

Change-Id: If69f6b064b92d2e188f41d7bb9f909f61f35c717
Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoOptimize cross-thread calls into the shared graphics cache
Eskil Abrahamsen Blomfeldt [Tue, 15 May 2012 12:37:37 +0000 (14:37 +0200)]
Optimize cross-thread calls into the shared graphics cache

QMetaObject::invokeMethod() is quite slow compared to just
posting events, since we don't really require deep copies of
the input data as long as it's read-only.

Change-Id: Ib5c0a14e1aac3120871a9bcf4aee8804e7d8b287
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
12 years agoRemove usage of deprecated plugin loader functionality.
Friedemann Kleint [Mon, 14 May 2012 10:36:03 +0000 (12:36 +0200)]
Remove usage of deprecated plugin loader functionality.

Use QFactoryLoader::instance(int) instead if deprecated
QFactoryLoader::instance(key).

Change-Id: I61d087e7e03d472f69427e53f5f194856eb5bffe
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
12 years agoRevert "Allow function assignment to cause binding for non-var props"
Chris Adams [Mon, 14 May 2012 03:29:47 +0000 (13:29 +1000)]
Revert "Allow function assignment to cause binding for non-var props"

This reverts commit 92b1f9981d225ecee28da1f0a88fb3046000cb5e.

Conflicts:

src/qml/qml/v8/qv8qobjectwrapper.cpp

Also remove XPASS tests from qjsonbinding

Change-Id: Ibc9da28d5f0bdffbf62e7e20f12bb55ff36ae271
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
12 years agoAdd hooks for declarative memory profiler.
Glenn Watson [Tue, 15 May 2012 01:57:51 +0000 (11:57 +1000)]
Add hooks for declarative memory profiler.

These macros effectively do nothing if the profiling library has not
been preloaded. However, if the library is loaded they provide some
additional context for each heap allocation, by tagging each
subsequent allocation with the QML file that caused the allocation
to occur.

Change-Id: Ib1f56d0df0664e118e04e53e22a6942317b1baed
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agodoc: Remove references to QScript*
Girish Ramakrishnan [Fri, 11 May 2012 16:01:43 +0000 (09:01 -0700)]
doc: Remove references to QScript*

The second document snippet won't work anymore since the equivalent
of QScriptValue::PropertyFlag doesn't exist. It is thus removed.

Change-Id: Ib8fadef6c6aec4bc257cc245bb58948f64b69945
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
12 years agoDon't pass the expression string to the signal handler profiler.
Michael Brasser [Mon, 14 May 2012 01:56:36 +0000 (11:56 +1000)]
Don't pass the expression string to the signal handler profiler.

Working towards removing the need to store a copy of the expression
string in the expression.

Author: Christiaan Janssen <christiaan.janssen@nokia.com>
Change-Id: I2cedfcf455c9aa4f1fb2ed422533945371038c58
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoInspector:Modified Apply changes on Save for unsync. changes
Simjees Abraham [Fri, 11 May 2012 12:37:33 +0000 (14:37 +0200)]
Inspector:Modified Apply changes on Save for unsync. changes

Changes done to reload the view if the user opts to do so after making
unsynchronizable changes. Inspector informs the QmlEngine about the
changes which caches it. The cache is used to load the files which
were changed when reloading the view.

Change-Id: I22d476cace294d6ecf4e428dac104a557c3f7dde
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
12 years agoQtQuick: Fix string related warnings, single character strings.
Friedemann Kleint [Mon, 14 May 2012 11:50:46 +0000 (13:50 +0200)]
QtQuick: Fix string related warnings, single character strings.

- Fix warnings about truncation from size_t to int (MSVC 2010,
  64bit).
- Remove single character strings.

Change-Id: Iaf4406e4e04d55d2d8b762f3433269868842a6f9
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
12 years agoExplicitly enable exceptions for QtQml
Lars Knoll [Wed, 9 May 2012 19:38:12 +0000 (21:38 +0200)]
Explicitly enable exceptions for QtQml

QtQml uses a try/catch statement in one place to
safeguard QList resizing. Since this can be called
from the JS side, it needs to be safeguarded.

Long term we should find a different way of handling this
then using exceptions in one place.

Change-Id: I51864d1b7ab468dd190c48e7a47c852ce35d40f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoRemove QtDeclarative compatibility module
Kent Hansen [Thu, 10 May 2012 13:41:29 +0000 (15:41 +0200)]
Remove QtDeclarative compatibility module

When the QtDeclarative module was renamed to QtQml, a compatibility
module was introduced to avoid disrupting downstream projects.
Time has passed, and it's now appropriate to remove this module.

Existing projects that haven't ported can still use the
bin/rename-qtdeclarative-symbols.sh script to ease the porting.

Change-Id: I05a9727013d9e38c2262577f68260a4382bfbeea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Donald Carr <donald.carr@nokia.com>
12 years agoFix invalid qdoc input
Alan Alpert [Mon, 14 May 2012 06:04:11 +0000 (16:04 +1000)]
Fix invalid qdoc input

Change-Id: I0f6143d7b8f816f0d55281c7ba0eec8248ce1cbe
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoRemoved CONFIG+=parallel_test from parallel-unsafe tests
Rohan McGovern [Mon, 14 May 2012 03:28:21 +0000 (13:28 +1000)]
Removed CONFIG+=parallel_test from parallel-unsafe tests

These tests are marked with CONFIG+=parallel_test, but are observed to
fail sometimes if run concurrently with other tests, and pass otherwise.

Change-Id: Id59209ca80c7449bdc0689af522c82ff00c4b588
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoCalculate vertex positions on CPU
Alan Alpert [Fri, 11 May 2012 10:38:26 +0000 (20:38 +1000)]
Calculate vertex positions on CPU

Easier for SG to optimize with, not really gaining anything putting it
on the GPU for these Elements.

Change-Id: I239e70dafce441f5281ded185de63bc1afd7d85a
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
12 years agoPathView was moving view too soon on drag
Martin Jones [Mon, 14 May 2012 02:49:52 +0000 (12:49 +1000)]
PathView was moving view too soon on drag

In order to allow gesture grabbing to work correctly, the view shouldn't
react to a drag until the event after the one that triggered it.

Change-Id: I3b84e501aa0f82da821498fa26abe8bbf66a6252
Reviewed-by: Bea Lam <bea.lam@nokia.com>
12 years agoPrint sprite errors only once
Alan Alpert [Tue, 1 May 2012 06:19:06 +0000 (16:19 +1000)]
Print sprite errors only once

Change-Id: I1dfb829d47cfdb5c5af3f3bc5956483ea6ef6314
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 years agoFlesh out the sprite documentation
Alan Alpert [Fri, 11 May 2012 09:38:49 +0000 (19:38 +1000)]
Flesh out the sprite documentation

Task-number: QTBUG-24770

Change-Id: I40c46aa29ffdcc5899bece46c4b6227ca29695cd
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoAvoid accessing sprites until they finish loading
Alan Alpert [Tue, 1 May 2012 06:08:54 +0000 (16:08 +1000)]
Avoid accessing sprites until they finish loading

Because sprite properties are not valid until image assembly finishes,
some features of the sprite engine cannot work until sprite assembly is
finished. In these circumstances, we shouldn't crash.

Task-number: QTBUG-24797
Change-Id: I2701f9302620c2cfd5b7bc5ce1cb9f31be4d4e19
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
12 years agoReload image on source changed
Alan Alpert [Thu, 10 May 2012 09:53:42 +0000 (19:53 +1000)]
Reload image on source changed

Task-number: QTBUG-25041

Change-Id: Icc02aead76d8b764c9955ac5914e9e026c00461e
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoEnd the deprecation period of SpriteImage
Alan Alpert [Tue, 1 May 2012 07:25:38 +0000 (17:25 +1000)]
End the deprecation period of SpriteImage

Also remove the stale files left around.

Change-Id: I2f275f23ebfb65045cc683ccd542cbc451b767fb
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoFix setting drag properties in mousePress.
Andrew den Exter [Fri, 11 May 2012 01:01:33 +0000 (11:01 +1000)]
Fix setting drag properties in mousePress.

Cache the dragX and dragY properties after the onPressed
signal has been emitted to allow for deferred creation of the drag
object or changes to the axis property in the handler.

Change-Id: If154e661359c82e957fcf0cbc11ccc1f75bee919
Reviewed-by: Martin Jones <martin.jones@nokia.com>
12 years agoHandle Var instructions in instruction dumper
Kent Hansen [Thu, 10 May 2012 07:26:35 +0000 (09:26 +0200)]
Handle Var instructions in instruction dumper

They would show up as "XXX UNKNOWN INSTRUCTION" in instruction dumps.

Change-Id: I3bebfe7519ddfb75c413a067ef05867cc07cd71b
Reviewed-by: Chris Adams <christopher.adams@nokia.com>