platform/upstream/qtdeclarative.git
9 years agoRemove most calls to Value::managed()
Lars Knoll [Thu, 24 Jul 2014 09:53:59 +0000 (11:53 +0200)]
Remove most calls to Value::managed()

Change-Id: Id5b1cca542421d749711eff68520a4138ec95531
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoChanged Value to store Managed::Data pointers directly
Simon Hausmann [Wed, 23 Jul 2014 11:56:43 +0000 (13:56 +0200)]
Changed Value to store Managed::Data pointers directly

This is a step towards storing direct heap object pointers for the values
on the JS stack, to avoid the costly indirection for data access.

Change-Id: Ibb57ed6cf52a7088bbc95ee04ae3a4cb25b8c045
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoCleanup: Get rid of String and Object pointers in Value
Simon Hausmann [Wed, 23 Jul 2014 10:37:17 +0000 (12:37 +0200)]
Cleanup: Get rid of String and Object pointers in Value

Change-Id: I4f007d0437c9a5cc79fe35d960d40557366d46fe
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoCleanup: Remove duplicated code
Simon Hausmann [Mon, 3 Nov 2014 02:23:29 +0000 (18:23 -0800)]
Cleanup: Remove duplicated code

arrayFromStringList is identical to ExecutionEngine's newArrayObject
overload that takes a QStringList

Change-Id: I17fed4703d0d6647d6ca44a0069834ce0da8d22c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoRemove unused file
Simon Hausmann [Sun, 2 Nov 2014 11:24:44 +0000 (03:24 -0800)]
Remove unused file

Change-Id: I16ae59257040594ce9921d29ddb13e2cefaf1075
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoUse an allocator for QSGBatchRenderer::Node and Element instances.
Gunnar Sletta [Wed, 22 Oct 2014 11:32:27 +0000 (13:32 +0200)]
Use an allocator for QSGBatchRenderer::Node and Element instances.

Cuts down quite a bit on the time spent on the render thread during
the sync phase.

Change-Id: Ide8c4348141c84ed8abd9a869607a022652c2828
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoQQuickTextEdit: don't ifdef out properties
J-P Nurmi [Tue, 9 Sep 2014 15:35:38 +0000 (17:35 +0200)]
QQuickTextEdit: don't ifdef out properties

Take out the implementation body instead. These conditional properties
are causing trouble for controls (invalid alias location).

Change-Id: I509c6a156b8f6c6fa12488bfc5e301f60346f8a5
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
9 years agoQQuickTextInput: don't ifdef out properties
J-P Nurmi [Tue, 9 Sep 2014 15:35:33 +0000 (17:35 +0200)]
QQuickTextInput: don't ifdef out properties

Take out the implementation body instead. These conditional properties
are causing trouble for controls (invalid alias location).

Change-Id: I055e149a4fe2d4d5d0c62d21e5f5368e9973c512
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
9 years agoFix typo in Q_ASSERT_X warning.
Gunnar Sletta [Sat, 1 Nov 2014 09:33:24 +0000 (10:33 +0100)]
Fix typo in Q_ASSERT_X warning.

Change-Id: I1415de93af35177fd643c21bcae2492a79187e50
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoFix beforePaint node calculation further.
Gunnar Sletta [Sat, 1 Nov 2014 09:24:28 +0000 (10:24 +0100)]
Fix beforePaint node calculation further.

Aborting when the extra wasn't allocated was just wrong. In addition
we didn't check for visibility/effectRefs which brought this
implementation out of sync with the children we added/removed in
the ChildUpdateMask block up above.

Change-Id: Ie174a683bb3712e392fece1636844e30574a1406
Task-number: QTBUG-42207
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoMerge remote-tracking branch 'origin/5.4' into dev
Simon Hausmann [Fri, 31 Oct 2014 19:20:43 +0000 (20:20 +0100)]
Merge remote-tracking branch 'origin/5.4' into dev

Change-Id: I30f9c925631991ceb22339d1333936faecffbaf4

9 years agoGet rid of !this and similar constructs
Lars Knoll [Thu, 30 Oct 2014 21:30:01 +0000 (22:30 +0100)]
Get rid of !this and similar constructs

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

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

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

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

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

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

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

Change-Id: I089007db4c4d0701eff32ce0b1c2fff1f65d5c48
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoComment parameters to PageAllocation::allocate()
Ulf Hermann [Wed, 22 Oct 2014 10:34:47 +0000 (12:34 +0200)]
Comment parameters to PageAllocation::allocate()

Change-Id: I8966fbc5f89ce470a0a16fe29086fa6e13ef408e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove guard pages option from uncommitted page reservations
Ulf Hermann [Tue, 21 Oct 2014 15:21:56 +0000 (17:21 +0200)]
Remove guard pages option from uncommitted page reservations

It's only implemented for non-linux unix-like systems and it's quite
challenging to get it right everywhere else. So, instead of giving the
user the illusion that guard pages might be available we just drop
them.

Change-Id: I7ec74c84f6215f22bd10758728b18bbecc0adf59
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoImplement guard pages for windows page allocator
Ulf Hermann [Tue, 21 Oct 2014 14:51:56 +0000 (16:51 +0200)]
Implement guard pages for windows page allocator

Change-Id: Ia54a259bbf05cca7dc1ed868a75931efa95851b3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAdd guard pages around JavaScript stack
Ulf Hermann [Tue, 21 Oct 2014 14:50:59 +0000 (16:50 +0200)]
Add guard pages around JavaScript stack

Like this we avoid writing to random memory if the stack overflows.

Change-Id: I0e0962daae69904a9ce21b047f3d8c0811c1d09f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAllow page allocations to include guard pages
Ulf Hermann [Tue, 21 Oct 2014 14:47:53 +0000 (16:47 +0200)]
Allow page allocations to include guard pages

The PageAllocator is in principle capable of using guard pages. We can
expose that functionality to its clients.

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

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

"any ..."

Also fixed some small issues here and there.

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

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

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

Change-Id: Ice51b9a1bd33f331183e3acec61b7d9c0f5163cd
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
9 years agoMerge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev
Lars Knoll [Thu, 30 Oct 2014 08:13:04 +0000 (09:13 +0100)]
Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev

9 years agoMove from a count of cursors, to storing whether or not a subtree has a cursor.
Robin Burchell [Wed, 15 Oct 2014 12:13:53 +0000 (14:13 +0200)]
Move from a count of cursors, to storing whether or not a subtree has a cursor.

Calculation of this is going to be slower (of course) as we have to recurse the
children, but this only happens when unsetting a cursor or removing a child item
from a tree that had a cursor.

On the other hand, wasting 4 bytes per ExtraData plus padding is quite a large
concern, and it was also forcing allocation of ExtraData for an entire tree that
had a cursor set.

This also reduces the size of ExtraData from 152 down to 144 bytes through
reordering of members on x86_64.

Change-Id: Iab14ee71c762285bf4448fc86399070263eb118d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoRepeater & itemviews: fix setModel() JS array handling
J-P Nurmi [Wed, 29 Oct 2014 12:59:46 +0000 (13:59 +0100)]
Repeater & itemviews: fix setModel() JS array handling

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

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

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

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

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

Change-Id: I24114f18be564553a4a768243bb20379affe7a8f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
9 years agoQQuickWindow: Add some more stuff under DBG_TOUCH.
Robin Burchell [Wed, 29 Oct 2014 17:59:27 +0000 (10:59 -0700)]
QQuickWindow: Add some more stuff under DBG_TOUCH.

This is useful for understanding when touch is actually delivered, and what it
goes to, which is useful for figuring out when something is incorrectly
filtering mouse events in the scene (for instance).

Change-Id: I9323629a42457b2b71e22ad489d8f1dc2d7b6fc5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoDon't constantly clear child node list on ChildrenUpdateMask
Robin Burchell [Fri, 17 Oct 2014 21:21:50 +0000 (23:21 +0200)]
Don't constantly clear child node list on ChildrenUpdateMask

This is pretty inefficient. We can do a better job with some effort,
incrementally. This should help cases like list panning quite a bit.

To accomplish this, we split the child update into two phases. First, we build a
list of desired nodes (this step is necessary for clarity's sake, thanks to the
need to insert an arbitrary painter node).

Second, we make sure that the current reality matches the desired state by
adding & removing nodes as necessary: no more full rebuild each time.

On extremetable, with logging on the ChildrenUpdateMask handling if time taken
was > 0ms, the time taken for me (on a recent rMBP) went from regularly hitting
7-10ms per frame to _occasionally_ (~5 times in a few seconds of panning)
spiking above 0, usually only hitting 1ms, and twice hitting 3 and 4ms.

Task-number: QTBUG-34255
Change-Id: I9fb4fb4cf39ffff3b8035f0d6de3bd7da6fcc51c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Wed, 29 Oct 2014 09:48:54 +0000 (10:48 +0100)]
Merge remote-tracking branch 'origin/5.4' into dev

Conflicts:
src/quick/items/qquickaccessibleattached_p.h
src/quick/items/qquickwindow.cpp
src/quick/scenegraph/qsgthreadedrenderloop.cpp

Change-Id: I8bf07487a75f9d1b0d6efa5914dd06875fc9654d

9 years agoBasic support for typed arrays
Lars Knoll [Thu, 11 Sep 2014 13:37:31 +0000 (15:37 +0200)]
Basic support for typed arrays

This implements most of the spec required for the
Khronos typed array specification.

It tries to follow ECMAScript 6 as closely as possible,
but currently only implements a subset of the ECMAScript
6 specification.

Addes a test script in tests/manual/v4 to test our
implementation.

Change-Id: I8ec63869500358e088b73240e1f37120ae3cf59a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoImplement DataView
Lars Knoll [Wed, 10 Sep 2014 14:39:23 +0000 (16:39 +0200)]
Implement DataView

The second class that is required for typed
array support.

Change-Id: Idc2dcec7c1eee541f76dc5ab1aea6057ba03cb93
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoImplement ArrayBuffer
Lars Knoll [Wed, 10 Sep 2014 12:50:28 +0000 (14:50 +0200)]
Implement ArrayBuffer

This is the first class required to support typed
arrays in our JS engine.

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

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

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

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

This started crashing because of 8f6436f125faae91eb472ddddbbae06dba5da671

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

With this change, instead of writing:

    function accessiblePressAction() { submit() }

You should write:

    Accessible.onPressAction: { submit() }

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

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

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

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

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

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

org.qt-project.org is redundant

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

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

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

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

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

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

The grammar did not allow for the declaration of

    readonly property QtObject foo: QtObject { ... }

and it required a workaround through an alias:

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

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

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

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

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

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

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

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

Change-Id: I083bb62c0cb3041a053d43e3085c3d0d10423db6
Task-number: QTBUG-41712
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
9 years agoAndroid: Keyboard doesn't hide from done button
Samuel Nevala [Wed, 22 Oct 2014 12:03:51 +0000 (15:03 +0300)]
Android: Keyboard doesn't hide from done button

QLineEdit closes input method on enter key press, TextInput
should also do the same. Commit and hide input method on enter
key. When Qt::ImhMultiLine input method hint set only commit.

Task-number: QTBUG-37850
Change-Id: I5a06e3eb777d7f794dd1493b307f0b05a2caf281
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoStop waiting in QTcpServerConnection if waitForBytesWritten fails
Ulf Hermann [Thu, 23 Oct 2014 14:01:06 +0000 (16:01 +0200)]
Stop waiting in QTcpServerConnection if waitForBytesWritten fails

There is no point in waiting any further for the remaining bytes to be
written as it will never succeed. We might get luckier by creating a
local event loop and repeatedly calling processEvents(), but as that is
considerably worse style and because you shouldn't rely on the
connection to send on exit anyway we don't do that.

Task-number: QTBUG-42158, see also QTBUG-24451
Change-Id: I79ffd5f5a4a7c41ff8dc0c4f6f1ca7e091844c9d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix build with QT_NO_DEBUG_OUTPUT defined
Samuel Gaist [Wed, 22 Oct 2014 22:34:09 +0000 (00:34 +0200)]
Fix build with QT_NO_DEBUG_OUTPUT defined

The use of the qDebug() macro to construct a QDebug object fails when
QT_NO_DEBUG_OUTPUT is defined when building Qt.
This patch aims to fix this.

[ChangeLog][General][Build] Can now build with QT_NO_DEBUG_OUTPUT
defined

Change-Id: If807ee3439db2a98b4d146f75860a98f40c247ec
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQmlEngine: Use separate mutex for network access manager
Kai Koehne [Thu, 23 Oct 2014 14:51:41 +0000 (16:51 +0200)]
QmlEngine: Use separate mutex for network access manager

Creating the network access manager can involve blocking calls to DBus,
which apparently can take quite long in pathological cases. Using the
same mutex in this case like for instance registering objects can
therefore result in a freezing UI.

Mitigate this by introducing a separate mutex.

Task-number: QTBUG-41183
Change-Id: I55bd8453d8e4bbc0bda1591eb3fd48b50ca921c1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix pixelgrid snapping of native text on retina displays.
Gunnar Sletta [Thu, 23 Oct 2014 09:28:22 +0000 (11:28 +0200)]
Fix pixelgrid snapping of native text on retina displays.

Change 63e6c9ada82dc8f16e705cef5f89292784b7ace4 introduced snapping to
the pixel grid in the vertex shader for native text, but this code was
broken on retina displays because it assumed integer only positions.
Fix it by including the retina scale factor into the rounding.

Task-number: QTBUG-38702
Change-Id: I84492b02d64f263c9fe030790e04cf79b0dc4e2f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoRelayout rich text when width increases
Eskil Abrahamsen Blomfeldt [Wed, 22 Oct 2014 14:16:56 +0000 (16:16 +0200)]
Relayout rich text when width increases

In updateSize() we were trying to force relayouts for RichText
when the width changes by always setting widthExceeded to true.
But further down in the same function, we overwrote this
with textWidth() < idealWidth(), which doesn't work, because
both properties are the wrapped width of the document and
should only differ if the text cannot be wrapped properly.

The result was that when increasing the width of a Text element,
we would hit the optimization and skip the relayout.

[ChangeLog][Text] Fixed Text with the RichText format to
correctly update wrapping when the width of the element grows.

Change-Id: I5fd87052a5ba7e8ee2549be0cfac4adc8ddf8290
Task-number: QTBUG-33020
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove unnecessary doneCurrent in QQuickWidget
Laszlo Agocs [Mon, 20 Oct 2014 11:54:26 +0000 (13:54 +0200)]
Remove unnecessary doneCurrent in QQuickWidget

Excessive makeCurrent - doneCurrent pairs should be avoided. We already
do this in QOpenGLWidget and the QPlatformBackingStore composition code.
Remove the doneCurrent from QQuickWidget too.

Change-Id: I6f998d381c33880c470f34d7c8462b6ed8cd8ae9
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoDoc: Fixed an error in the QML snippet
Venu [Tue, 7 Oct 2014 14:16:13 +0000 (16:16 +0200)]
Doc: Fixed an error in the QML snippet

Also updated the C++ snippet to look like a
gui app that shows the QML example, instead of
a console app that just provides the context data
to the QML example.

Change-Id: I17aca9f03521cfcadba1a965a4924e87cbf14c62
Task-number: QTBUG-41699
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix assignment to QObject pointer properties
Simon Hausmann [Wed, 22 Oct 2014 14:47:01 +0000 (16:47 +0200)]
Fix assignment to QObject pointer properties

This commit ammends 59ed8c355b99df0b949003a438ab850274261aa0 to always query
the Qt meta-type registry to retrieve the QMetaObject for a QObject pointer
type.

Change-Id: I70d876a5acfa23967fd1a57c96fcd5ac853eaf49
Task-number: QTBUG-39614
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
9 years agoScreen attached property: expose devicePixelRatio property
Shawn Rutledge [Fri, 17 Oct 2014 12:24:07 +0000 (14:24 +0200)]
Screen attached property: expose devicePixelRatio property

Change-Id: I08b22766b3e389b7d27ca4c56729f550b0647a08
Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
9 years agoFix non-compiling QtQml code snippet
Alex Blasche [Mon, 20 Oct 2014 13:46:58 +0000 (15:46 +0200)]
Fix non-compiling QtQml code snippet

Task-number: QTBUG-42006
Change-Id: I3c59b0ba27518750cba667f414f58edaa136d250
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
9 years agoAdd high dpi support to QQuickFramebufferObject
Laszlo Agocs [Wed, 22 Oct 2014 09:59:02 +0000 (11:59 +0200)]
Add high dpi support to QQuickFramebufferObject

Change-Id: I58aa163bd17fae7190161641d94f51887d8f88a6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoReduce memory pressure on the JS stack during garbage collection
Simon Hausmann [Tue, 21 Oct 2014 09:05:00 +0000 (11:05 +0200)]
Reduce memory pressure on the JS stack during garbage collection

As the example in QTBUG-42051 demonstrates, QML may produce a lot of binding
objects and each of them produce a QV4::Persistent. During the mark phase we
may run out of JS stack space. One fix (for the future) is to reduce the number
of QV4::Persistent objects, but in the meantime we can also reduce the pressure
on the stack by draining it earlier.

Task-number: QTBUG-42051
Change-Id: Iea73f8a869048ea0bf3f4a64dbd24b6fb8c68f6b
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
9 years agoFix line ending for test file
Kai Koehne [Wed, 22 Oct 2014 12:57:51 +0000 (14:57 +0200)]
Fix line ending for test file

Task-number: QTBUG-40574
Change-Id: If1fcc4cb00c8e477b3afff92eb4a3099424fcfa6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoAdd note to QQuickItem docs about directly setting properties in C++.
Mitch Curtis [Thu, 16 Oct 2014 09:06:32 +0000 (11:06 +0200)]
Add note to QQuickItem docs about directly setting properties in C++.

It's not obvious that calling setPosition() directly, for example,
won't trigger animations defined in behaviors that react to that
item's x and y properties changing, because a quick glance at the
code shows that they have almost identical code paths and both
emit geometryChanged().

Change-Id: Ic7f7019b1bbba24732569c0de777ee02d79c1d3b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFix a PIDLIST_ABSOLUTE leak in QQmlEngine on Windows
Jocelyn Turcotte [Tue, 21 Oct 2014 15:12:30 +0000 (17:12 +0200)]
Fix a PIDLIST_ABSOLUTE leak in QQmlEngine on Windows

The documentation of SHParseDisplayName doesn't mention that you need
to free the ppidl parameter, but the documentation of the ITEMIDLIST
does mention that you need to ILFree any ITEMIDLIST passed as
PIDLIST_ABSOLUTE.

Reproduced the leak by repeatedly showing and closing the window on
the task's example.

Task-number: QTBUG-41588
Change-Id: I91d08728fc907c59e56ae344a2d12f0865031120
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix disfunctional QQuickRenderControl with multiple screens
Laszlo Agocs [Wed, 22 Oct 2014 08:27:46 +0000 (10:27 +0200)]
Fix disfunctional QQuickRenderControl with multiple screens

Having a retina and non-retina screen connected resulted in getting
no output from QQuickRenderControl and QQuickWidget on the
non-retina screen.

This is caused by the fact that Quick is blindly calling
QWindow::devicePixelRatio(). This approach is wrong when using
QQuickRenderControl since the QQuickWindow does not have an actual
native window and so devicePixelRatio() merely returns some default value
which will definitely be wrong for one of the screens.

The patch fixes the problem by introducing
QQuickWindow::effectiveDevicePixelRatio(), which, via
QQuickRenderControl::renderWindowFor, supports the redirected case too.

Task-number: QTBUG-42114
Change-Id: I057e01f0a00758dde438fc9b10af3a435b06bb0b
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
9 years agoAdd \since 5.4 to FontMetrics and TextMetrics.
Mitch Curtis [Tue, 21 Oct 2014 17:50:54 +0000 (19:50 +0200)]
Add \since 5.4 to FontMetrics and TextMetrics.

Change-Id: I5fa93d559cdfde5e6b84ab0f3f35fd600e6bec4f
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoSupport Accessible.ignored on non-leaf items
Jan Arve Saether [Thu, 25 Sep 2014 09:41:44 +0000 (11:41 +0200)]
Support Accessible.ignored on non-leaf items

Ignoring items with children will make the children appear as children of
the parent of the ignored item.
Since setAccessibleFlagAndListener now only sets the flag we also rename
the function to just setAccessible

Change-Id: I79fc311509a3e454b4698274c63ad0e879fb93e3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
9 years agoCheck list property before component when validating bindings
Ulf Hermann [Tue, 21 Oct 2014 11:53:43 +0000 (13:53 +0200)]
Check list property before component when validating bindings

There are lists that won't accept a component as element. For example
QQuickItem's children will only accept QQuickItems.

Task-number: QTBUG-41848
Change-Id: I0fc7b0d1a4770d596caf681be92dff216f48d32b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix a bug in implementation of Accessible.ignored
Jan Arve Saether [Fri, 22 Aug 2014 11:12:46 +0000 (13:12 +0200)]
Fix a bug in implementation of Accessible.ignored

m_ignored is not really used.

(cherry-picked from dev branch: 2c42d6af19f57ae013da0a4c45b6e1de8fb99e99)
Change-Id: Ic2926fbdf22a6a5bc82fe9f4475b7b8058eacae5
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
9 years agoQQuickCustomParticle: Check for current OpenGL Context before use
Andy Nichols [Tue, 14 Oct 2014 13:31:05 +0000 (15:31 +0200)]
QQuickCustomParticle: Check for current OpenGL Context before use

QQuickCustomParticle::buildCustomNodes() assumes there is a valid OpenGL
context, but when there is not it will simply crash.  Instead we check
for a valid current OpenGL context first, and return 0 if it is not
availalbe.  This needed for the Qt Quick 2d Renderer.

Change-Id: I6bfcfc8fa9581bfd27015f719fc527c36492eade
Reviewed-by: aavit <eirik.aavitsland@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQuickSpriteEngine do not use OpenGL without checking for GLContext
Andy Nichols [Tue, 14 Oct 2014 13:14:13 +0000 (15:14 +0200)]
QQuickSpriteEngine do not use OpenGL without checking for GLContext

In the case that QQuickSpriteEngine::assembledImage() is called when
there is no current OpenGL context, return a null QImage instead of
crashing.  This is needed for the Qt Quick 2d Renderer case.

Change-Id: I75b9b1f31f05cc0800293435d660e498fecc4d20
Reviewed-by: aavit <eirik.aavitsland@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoDon't assume there is only one toplevel item.
Jan Arve Saether [Thu, 25 Sep 2014 09:40:21 +0000 (11:40 +0200)]
Don't assume there is only one toplevel item.

With the upcoming introduction of unignoredChildren, there can
exist many top level items (if the root item is ignored).

Change-Id: If7aaea08fdd4d1f5a0a5109e1239c53e0af9b61e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
9 years agoImprove hit testing so that it works better with ignored items
Jan Arve Saether [Wed, 10 Sep 2014 11:10:19 +0000 (13:10 +0200)]
Improve hit testing so that it works better with ignored items

The hit testing won't work very well with the upcoming patch that
changes which items that can be ignored.
(basically it doesn't consider the isAccessible flag,
so childAt_helper might return a node that was supposed to be ignored)

Earlier this was a sensible optimization in order to avoid too many heap
allocations and deallocations of interfaces, but these are cheap now, so
we can do it the do it the 'proper way' (i.e. before this patch we
didn't respect the a11y hierarchy as given by QAccessibleInterface
child() and parent(). This also uses the QAccessibleInterface::rect()
directly now instead of using the itemScreenRect() function, which
was shared between QAccessibleQuickWindow and QAccessibleQuickItem.

Since this changes the order of child interfaces to paint order (i.e.
second child interface is on top of first child interface), we need to
ensure that we hit test child interfaces in the correct order.
They should now always be processed with the last interface first, and
then return as soon as something is hit.

Change-Id: Ie951fc3b48b7affd9f7e98687a1cbbe008857d2a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
9 years agoFix subscript and superscript for QQuickText
Joni Poikelin [Wed, 8 Oct 2014 05:07:09 +0000 (08:07 +0300)]
Fix subscript and superscript for QQuickText

Task-number: QTBUG-32948
Change-Id: I4920015b2604afbd9e2050f0225de98d5188d589
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoFix failing makeCurrent in basic renderloop when closing windows
Laszlo Agocs [Mon, 20 Oct 2014 11:46:13 +0000 (13:46 +0200)]
Fix failing makeCurrent in basic renderloop when closing windows

The makeCurrent() call can fail if there is no underlying platform
window present anymore (due to close()).

Just continuing with the cleanup is wrong: There may be another context
current (from the application or from some other component of Qt) and
there are GL calls issued which would mess up the state in that context.
Therefore we ensure there's a context/surface by using a temporary
QOffscreenSurface.

Task-number: QTBUG-41942
Change-Id: I79f35a1f5bbe7a8a14943e8603764575ed119f93
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoqmlstatemachine: Rename StateBase to State
Kevin Funk [Thu, 9 Oct 2014 14:05:33 +0000 (16:05 +0200)]
qmlstatemachine: Rename StateBase to State

As discussed with Brett Stottlmyer and Alan Alpert.

Add a section about the implications when importing both
QtQml.StateMachine
and QtQuick in one single QML file.

Change-Id: I8755f4b578e2a6ff4c2377c7a8a0b996ba9b7129
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoTweak new animation driver.
Gunnar Sletta [Mon, 20 Oct 2014 11:58:33 +0000 (13:58 +0200)]
Tweak new animation driver.

We're removing the bad/reallyBad concept for the benefit of an
accumulated lag. When the lag passes over a certain threshold, we
switch to time based. The logic for switching back remains unchanged.

We also fixed the switching so that elapsed() does not jump from the
predicted time to the animation system's wall time, but rather
continues from the predicted time with a walltime offset (this is how
it was always intended to be).

Task-number: QTBUG-42020
Change-Id: I7ee9181aca46cbc18a74fae5e8d513365906c017
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoMake test more robust against ignored children.
Jan Arve Saether [Tue, 23 Sep 2014 09:24:58 +0000 (11:24 +0200)]
Make test more robust against ignored children.

With the upcoming change that changes the semantics of
Accessible.ignored, some assumptions in the test does not hold anymore.

Change-Id: I9b34f1ecc61fc0d4e8abe5a5505a5bcff44501d4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
9 years agoFix tst_qquickpositioners on OS X
Frederik Gladhorn [Mon, 20 Oct 2014 13:00:39 +0000 (15:00 +0200)]
Fix tst_qquickpositioners on OS X

Done-with: Jan Arve Sæther
Change-Id: Iff66f62167a5977354319aac311d2cb81d9f3842
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
9 years agoQQuickParticleSystem: Use QVector instead of QList.
Robin Burchell [Fri, 17 Oct 2014 23:37:24 +0000 (01:37 +0200)]
QQuickParticleSystem: Use QVector instead of QList.

This is more efficient, for the use we're seeing. In addition, reserve the size
in advance, to avoid reallocations.

Change-Id: I987ee7cea1aa32c4b1aad1246b6e22b87efd9cc6
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQuickParticleSystem: Micro-optimize m_emitters' handling of null pointers.
Robin Burchell [Fri, 17 Oct 2014 23:32:05 +0000 (01:32 +0200)]
QQuickParticleSystem: Micro-optimize m_emitters' handling of null pointers.

This shaves off around 35ms from samegame setup of a large game.

Change-Id: I91cb7e8d8db5da672e0dcf30a3c0bb0fa855c93f
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQuickParticleSystem: Optimize hash manipulation.
Robin Burchell [Fri, 17 Oct 2014 23:26:53 +0000 (01:26 +0200)]
QQuickParticleSystem: Optimize hash manipulation.

Before even checking the hash, perform the fast (empty string) check.

If it's not empty, then do a single hash lookup, not two of them. There's no
point doing a second lookup, since if it doesn't exist, we insert anyway.

This takes hash manipulation on samegame on a large screen from ~142ms to ~70ms,
which is expected.

Change-Id: I4e2a099e996f2f5fb95a5b066d7756373a1dbacd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFix newly added qquickitem_before_paintNode() implementation.
Gunnar Sletta [Mon, 20 Oct 2014 07:23:28 +0000 (09:23 +0200)]
Fix newly added qquickitem_before_paintNode() implementation.

Bug spotted after the fact with lancelot.

Change-Id: Id9b2d2577658f772f3083b1396f61710a950f83b
Reviewed-by: aavit <eirik.aavitsland@digia.com>
9 years agoRemove the "groupNode"
Gunnar Sletta [Thu, 16 Oct 2014 08:02:11 +0000 (10:02 +0200)]
Remove the "groupNode"

We originally had the groupnode to simplify adding and removing clip /
effect / opacity nodes to the item tree at a time when the renderer
was a bit more trivial and only did a single pass over the tree during
rendering. The runtime cost at the time was negligible. The
QSGBatchRenderer has a bit more logic, so the extra node now costs a
bit more. In addition to extra memory, we need to allocate shadow
nodes for it and put those into the renderer's internal shadownode
hash.

This removal increases the performance of adding / removal of simple
items by ~10% in addition to reducing the number of nodes in the
scene graph by up to 1/3.

Change-Id: I8cd64984f868d75820e25d33dfdbebd4d20651fe
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoIntroduced QQuickCustomRenderStage.
Gunnar Sletta [Tue, 30 Sep 2014 09:26:45 +0000 (11:26 +0200)]
Introduced QQuickCustomRenderStage.

The purpose of this concept is to make it possible to plug in an
external rendering stage, like replacing the GL rendering with a
composition step performed by a hardware compositor in QtCompositor.

Change-Id: I994b93af443f68a77ca73cf310b5910c49e014c3
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoOnly delete all child nodes twice if effectRefEffectivelyChanged is set.
Robin Burchell [Tue, 14 Oct 2014 10:17:28 +0000 (12:17 +0200)]
Only delete all child nodes twice if effectRefEffectivelyChanged is set.

We already handle ChildrenUpdateMask again in the general case below, so this
second clear doesn't make sense, *but* for the fact that we are modifying
groupNode here when effectRefEffectivelyChanged is set. So keep doing it for
that case.

As a nice side-effect, this means that groupNode is not always allocated.

Also, don't fetch groupNode redundantly if we are clearing nodes.

Task-number: QTBUG-34255
Change-Id: Icc01b942d3c09c17300e19d61e9a65f220004796
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoUse QWindow::requestUpdate in threaded renderloop.
Gunnar Sletta [Tue, 30 Sep 2014 19:32:17 +0000 (21:32 +0200)]
Use QWindow::requestUpdate in threaded renderloop.

The default implementation is the same as what we do with the exhaust
delay, but it is now possible for platforms to line it up with vsync
so the GUI thread doesn't spend so much time being blocked.

Change-Id: Ie126f00a1be978608bf2a1db33d80d7f0458590d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoResolve QQuickItemPrivate::beforePaintNode dynamically.
Gunnar Sletta [Wed, 15 Oct 2014 06:40:20 +0000 (08:40 +0200)]
Resolve QQuickItemPrivate::beforePaintNode dynamically.

It will be the 0 unless the item has a direct child with negative z,
which occurs very rarely.  Its presence complicates the algorithm used
to solve QTBUG-34255 and it wastes 8 bytes per visual item.

No difference could be noted in a benchmark animating 6000+ sprites.

Task-number: QTBUG-34255
Change-Id: Id0a78a246f0d621a51c8caad23da02b55d59b9bb
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoMerge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4
Simon Hausmann [Tue, 14 Oct 2014 16:29:13 +0000 (18:29 +0200)]
Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4

9 years agoMerge remote-tracking branch 'origin/5.3' into 5.4
Frederik Gladhorn [Tue, 14 Oct 2014 12:04:48 +0000 (14:04 +0200)]
Merge remote-tracking branch 'origin/5.3' into 5.4

Conflicts:
src/qml/jsruntime/qv4objectiterator.cpp
src/qml/jsruntime/qv4objectiterator_p.h
src/quick/scenegraph/qsgthreadedrenderloop.cpp

Change-Id: Ia54a9acd96530aa6683c228597af0ca25eadec4f

9 years agoexamples/quick/positioners: Colors changed and layout obeys screen resolution
Kari Hautamäki [Wed, 24 Sep 2014 07:05:02 +0000 (10:05 +0300)]
examples/quick/positioners: Colors changed and layout obeys screen resolution

Change-Id: I61b6358d6d5dff4cc9a14f8774b1c3597e83b550
Reviewed-by: Martin Smith <martin.smith@digia.com>
9 years agoCorrect KeyEvent::key documentation.
Mitch Curtis [Sun, 12 Oct 2014 09:59:13 +0000 (11:59 +0200)]
Correct KeyEvent::key documentation.

"text" is a property, not a function.

Change-Id: I02158d550ff174076396810dca007df1d734bda5
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoImprove performance of animators.
Gunnar Sletta [Tue, 7 Oct 2014 10:22:26 +0000 (12:22 +0200)]
Improve performance of animators.

The use of one QCoreApp::postEvent() per completed animation added up
to a very large overhead when 1000+ animators were used at the same
time. This is very relevant for sprite games and similar and deserves
to work at least as good as normal animations.

Instead, store the animations to stop and stop then on the gui thread
later as a result of frameSwapped. For the benchmark in question this
allows for roughly double the amount of animators being started and
stopped.

Change-Id: Iae3d1ec1502ee1908fdbba708fa9f976aa230064
Reviewed-by: Michael Brasser <michael.brasser@live.com>
9 years agoFix issues with Keyboard Focus documentation.
Mitch Curtis [Wed, 1 Oct 2014 10:40:47 +0000 (12:40 +0200)]
Fix issues with Keyboard Focus documentation.

Change-Id: I0dcc364456404a761a555da065452a59d1249a2f
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoStabilize and fix comparisons in animator tests.
Gunnar Sletta [Wed, 8 Oct 2014 16:14:43 +0000 (18:14 +0200)]
Stabilize and fix comparisons in animator tests.

compare() will compare properties of objects and neither Qt.rgba nor
image.pixel created objects has enumeratable properties so compare
is pretty much useless. Use verify + == which will rely on toString()
which is ok.

A few of the tests relied on execution order of signals emitted on
animation.running being changed and would occasionally fail.

Change-Id: I531c7f21b58a922a6be9ca2b6de120a68209a6d6
Reviewed-by: Michael Brasser <michael.brasser@live.com>
9 years agoPathView: Fix QML engine thinking currentItem is null when it's not
Sérgio Martins [Tue, 30 Sep 2014 12:23:56 +0000 (13:23 +0100)]
PathView: Fix QML engine thinking currentItem is null when it's not

QML didn't re-evaluate any bindings using currentItem because a
notification was missing.

Change-Id: Icdaa3022e0b01644a060e577d87f011b4ea9fabb
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Thu, 9 Oct 2014 16:13:54 +0000 (18:13 +0200)]
Merge remote-tracking branch 'origin/5.4' into dev

Conflicts:
src/quick/items/context2d/qquickcanvasitem.cpp
src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
src/quick/scenegraph/coreapi/qsgrenderer.cpp
src/quick/scenegraph/qsgadaptationlayer.cpp
src/quick/scenegraph/qsgrenderloop.cpp
src/quick/scenegraph/qsgthreadedrenderloop.cpp
src/quick/scenegraph/qsgwindowsrenderloop.cpp
src/quick/scenegraph/util/qsgatlastexture.cpp
src/quick/scenegraph/util/qsgtexture.cpp
src/quick/util/qquickprofiler_p.h

Change-Id: Ie274c3baf72a8a0711c87d67238d68e2b2887429

9 years agoFix QQmlExpression/QQmlScriptString/QQmlBinding crashes
Simon Hausmann [Sat, 4 Oct 2014 15:18:15 +0000 (17:18 +0200)]
Fix QQmlExpression/QQmlScriptString/QQmlBinding crashes

In the QQmlScriptString we store the binding id and it is an index into the
runtimeFunctions array of the compilation unit. However we don't store the
compilation unit and instead in QQmlBinding and QQmlExpression try to retrieve
it from the cache via the context url (we have the context after all). That
turns out to be not a reliable way, as sometimes the URL might slightly differ
from the originally compiled cache (qrc:/// turning to qrc:/ maybe).
Consequently the type is (unnecessarily) compiled again and unfortunately not
_linked_, therefore the runtime functions array is empty. Another option is
that when the component was created from a QByteArray, then no entry exists in
the cache in the first place.

This patch addresses the problem by storing a reference to the compilation unit
in the QQmlContextData. That we can safely retrieve and it'll make sure the
compilation unit also stays alive.

In the process of that the manual reference counting was switched over to
QQmlRefCount and QQmlRefPointer for QV4::CompilationUnit.

Task-number: QTBUG-41193
Change-Id: I9111f9a3b65618e453954abcd789c039e65a94f7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>