platform/upstream/qtdeclarative.git
9 years agoRevert "Fix pixel bleed in BorderImage"
Eskil Abrahamsen Blomfeldt [Mon, 10 Nov 2014 13:22:05 +0000 (14:22 +0100)]
Revert "Fix pixel bleed in BorderImage"

This reverts commit a9238292145e05d36be7c35bdd50829c6400a3de.

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

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

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

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

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

Change-Id: I2c69deb3bc69da1a06485aaf72fb298b08756734

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

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

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

We can use the new application attribute for this now.

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

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

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

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

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

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

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

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

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

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

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

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

There is no reason to wait for the window to activate

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Change-Id: I3e493950bc4a588059fec6c7441b010c2780dffd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
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 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 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 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 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 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 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>
9 years agoReturn the content position rounded on the right side
Giulio Camuffo [Tue, 9 Sep 2014 12:06:36 +0000 (15:06 +0300)]
Return the content position rounded on the right side

QQuickFlickable::contentX/Y() returns the negative of the value
stored in the QQuickTimeLineValue used by QQuickFlickable.
So we must be careful when using things like qRound, and call it
with the negative of the value ine the QQuickTimeLineValue, else
code like this would fail:

QQuickFlickable *f = ...
f->setPixelAligned(true)
f->setContentY(-10.5)
assert(f->contentY() == qRound(-10.5)) // fail

The assert expression indeed turns into -11 == -10, which is false
but which is not what the user would expect.

Change-Id: Ib92ee2fa613b751462237349d9e4e2f2b4652f82
Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
9 years agoExport QQuickKeyNavigationAttached as a part of the private API
Oleg Shparber [Fri, 3 Oct 2014 06:10:53 +0000 (23:10 -0700)]
Export QQuickKeyNavigationAttached as a part of the private API

This change fixes linking problems when QQuickKeyNavigationAttached
is used through private headers.

Change-Id: I176a9551718d9ba25c160a3b1caa8872c88d39f3
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoMake QQuickKeyNavigationAttached respect user set values
Oleg Shparber [Sat, 4 Oct 2014 21:28:22 +0000 (14:28 -0700)]
Make QQuickKeyNavigationAttached respect user set values

Before this change, when user tried to set KeyNavigation property
to the value which was previously automatically assigned, user set
flag wasn't raised. Such behavior led to situations, when explicitly
set values later were not respected by automatic mutual changes.

Change-Id: Id5ba5061c03a61f4d7835a638dc746b1485b9a56
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoDoc: Updated the QML State Machine docs
Venu [Wed, 24 Sep 2014 15:11:11 +0000 (17:11 +0200)]
Doc: Updated the QML State Machine docs

- Excluded the src/imports/statemachine directory from
qtquick.qdocconf to avoid unnecessary qdoc warnings.
- corrected a broken link to an external source
- changed the group name to avoid collision
- added a \qmlmodule page for QtQml.StateMachine
- Reduced the amount of duplication between the
C++ and QML state machine overviews.

Task-number: QTBUG-41561
Change-Id: I87c815fada7006f0609331e315bb338f062bb4db
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoDoc: Updated the \brief and detailed description
Venu [Tue, 7 Oct 2014 15:39:30 +0000 (17:39 +0200)]
Doc: Updated the \brief and detailed description

Just to give a hint to the reader about what the
example does.

Task-number: QTBUG-37203
Change-Id: Ibb377e4adfb25ed4e4da0a41280e4157fae638ba
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
9 years agoFix memory leak and crash with transform animators.
Gunnar Sletta [Mon, 6 Oct 2014 19:13:18 +0000 (21:13 +0200)]
Fix memory leak and crash with transform animators.

Every time initialize() was called, we would increment the ref on
an item. However, initialize is called every time the job is started,
so the ref would increase and only decrease once, leading to a leaked
helper. Change it to only increment the first time.

A different problem was that when an item was destroyed, we could run
the risk of the QQuickTransformAnimatorJob destructor being called
with the helper's item being null. This would lead to the helper not
being removed from the cache and a dangling helper would remain in the
transforms cache. Now change it so that when a target is destroyed, we
explicitly destroy the helper as well (as no animation can happen then
anyway) and reset all pointers in the job.

Change-Id: I1ce76db134bbc1871d32f1224ba5b68a4a4eeafa
Reviewed-by: Michael Brasser <michael.brasser@live.com>
9 years agoRemove alpha channel from images that doesn't actually have alpha.
Gunnar Sletta [Fri, 3 Oct 2014 14:12:56 +0000 (16:12 +0200)]
Remove alpha channel from images that doesn't actually have alpha.

We did this for QPixmap since forever, and it has a huge impact
on rendering performance, so there is no reason why we shouldn't
spend that extra bit of time.

Change-Id: Ibd2e6d585525a5b5a975b8d7498c21dec00647c5
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoCompare doesn't work for colors, so compare the channels explcitily.
Gunnar Sletta [Thu, 2 Oct 2014 10:05:14 +0000 (12:05 +0200)]
Compare doesn't work for colors, so compare the channels explcitily.

Change-Id: I7a21328700c85b5b79dbb4342817e28833dece70
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoRelax ShaderEffectSource's sourceItem vs window handling.
Gunnar Sletta [Thu, 2 Oct 2014 10:03:27 +0000 (12:03 +0200)]
Relax ShaderEffectSource's sourceItem vs window handling.

For dynamically loaded items, the window may not be set
on either the source or the item, so we need to be a bit
more relaxed in our checking.

This fixes a regression for dynamically loaded GaussianBlur.

Change-Id: I3e888405a95058ca79ecd2dff42c0ed4c8fff065
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoFix missing glyphs in selection
Eskil Abrahamsen Blomfeldt [Wed, 8 Oct 2014 10:30:27 +0000 (12:30 +0200)]
Fix missing glyphs in selection

Change 198009db79a85d3cab7fe3a6432635d36123a2d6 revealed a bug in the
new selection algorithm which would occur sometimes
when a given run of text spanned several script items. Since we
are checking the glyph runs for overlaps in the actual text, we
need to report the exact characters spanned by the glyph run. We
use the new enabler for this in QGlyphRunPrivate.

Added a new test case which is an error case we did not yet cover,
which is when there is only a single script item, but several
font engines are used to produce it (fallback fonts).

Change-Id: Ie4c3e79ad98a033d5c75fd67ada4ae83df33435b
Task-number: QTBUG-41808
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoTemporarily skip tst_qquickframebufferobject when using ANGLE.
Friedemann Kleint [Tue, 7 Oct 2014 12:28:49 +0000 (14:28 +0200)]
Temporarily skip tst_qquickframebufferobject when using ANGLE.

Task-number: QTBUG-41815
Change-Id: I5c6ec36a4f8830d95e1d4904d1be41d752757339
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>