platform/upstream/qtdeclarative.git
10 years agoMerge remote-tracking branch 'origin/release' into stable
Frederik Gladhorn [Tue, 3 Dec 2013 17:15:53 +0000 (18:15 +0100)]
Merge remote-tracking branch 'origin/release' into stable

Change-Id: I894ad7b4888744833f487b481950c087fa960a5c

10 years agoDrop the "missing provider" warning from ShaderEffect.
Gunnar Sletta [Mon, 2 Dec 2013 08:13:04 +0000 (09:13 +0100)]
Drop the "missing provider" warning from ShaderEffect.

Task-number: QTBUG-34676
Change-Id: I5f1c2f9ebe6048da5d5c1d1ea5e4799eacea3e8b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix typo in debug define
Gunnar Sletta [Tue, 3 Dec 2013 09:24:29 +0000 (10:24 +0100)]
Fix typo in debug define

Change-Id: I4d024aeb4618228cad3000ddfda32e5c8aba5742
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoFix style animations to stop when the item is hidden
J-P Nurmi [Mon, 2 Dec 2013 21:44:21 +0000 (22:44 +0100)]
Fix style animations to stop when the item is hidden

QStyleAnimation automatically stopped for hidden QWidgets, but didn't
know anything about QQuickItems and kept animating regardless of their
visibility. QStyleAnimation was changed so that it will keep animating
only as long as the animation target accepts animation updates. This
change ensures that the style animation updates are accepted only when
the item is visible.

Task-number: QTBUG-35319
Change-Id: I3c93a653316b8abbbc32940cd7499b660828eff8
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
10 years agoFix build in release mode with forced asserts
Konstantin Ritt [Thu, 28 Nov 2013 18:31:04 +0000 (20:31 +0200)]
Fix build in release mode with forced asserts

Change-Id: I0e35533af7f65200a8bc3c4024c29344fa6f4b7a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 IR: remove common toInt32 casts.
Erik Verbruggen [Mon, 2 Dec 2013 15:57:32 +0000 (16:57 +0100)]
V4 IR: remove common toInt32 casts.

E.g.:
a | 0
b & 0xffffffff

These operations force the operands to be converted to int32 without
changing their value. At this point we already added convert calls to
the IR, so we can safely get rid of these operations.

Change-Id: Ic4d3b989e13439eccd2c878fa7bf5030acae7630
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 IR: change the worklist to a QSet for block scheduling.
Erik Verbruggen [Mon, 2 Dec 2013 15:35:17 +0000 (16:35 +0100)]
V4 IR: change the worklist to a QSet for block scheduling.

Fixes a crash in octane.

Change-Id: Ib72ac0b7a2941230a87543f30fcf7e55d7094886
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4: remove invalid assert.
Erik Verbruggen [Mon, 2 Dec 2013 15:33:58 +0000 (16:33 +0100)]
V4: remove invalid assert.

Both the base and the index of a subscript can (and are allowed to) be
other things than temporaries.

Change-Id: If073e262712bab488f18eac5ebe097be99c40359
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoSafely abort when we don't succeed in creating a GL context.
Gunnar Sletta [Tue, 12 Nov 2013 15:53:47 +0000 (16:53 +0100)]
Safely abort when we don't succeed in creating a GL context.

Task-number: QTBUG-33363
(cherry-picked from commit 12eab9162781)

Change-Id: Ia2b0c329157786cb4ec703989f12d2fdb1ce6bc8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoAdd a namespace for a global variable in a public header
Thiago Macieira [Fri, 29 Nov 2013 05:28:38 +0000 (21:28 -0800)]
Add a namespace for a global variable in a public header

The "Qml" prefix should suffice.

This was found by ICC 14.0 in a bogus warning:
qqml.h(470): error #2415: variable "CurrentSingletonTypeRegistrationVersion" of static storage duration was declared but never referenced

Change-Id: I604cd712529b1c4553457c1ea0904182ac4a9e80
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
10 years agoFix change-of-sign warning in the new QML compiler
Thiago Macieira [Fri, 29 Nov 2013 05:38:42 +0000 (21:38 -0800)]
Fix change-of-sign warning in the new QML compiler

The m_line and m_column members are of type quint16, so -1 is not
valid. BTW, aren't 65535 possible lines too few?

qqmlboundsignal.cpp(92): error #68: integer conversion resulted in a change of sign

Change-Id: I2f73c276c5fc9b6988b5fa4274f7fa3f6bb85c4b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAllow QtQml to compile with ICC 14.0 with -Werror
Thiago Macieira [Fri, 29 Nov 2013 05:35:33 +0000 (21:35 -0800)]
Allow QtQml to compile with ICC 14.0 with -Werror

Third-party source contains a static variable that is only used in
debugging code (an ASSERT).

cached-powers.cc(134): warning #2415: variable "double_conversion::kCachedPowersLength" of static storage duration was declared but never referenced
  static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);

Change-Id: I97ea9ada8f03d9fd45149fbc4bfdf61877498339
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
10 years agoFix QQuickTextInput not overriding shortcuts (del/home...)
Frederik Gladhorn [Mon, 25 Nov 2013 19:36:26 +0000 (20:36 +0100)]
Fix QQuickTextInput not overriding shortcuts (del/home...)

[ChangeLog][QtQuick] QQuickTextInput would not accept
delete/home/backspace/left/right keys when the key was used in a
shortcut.

Task-number: QTBUG-34517

Change-Id: I553af8247191ecdadcb4677e9fc85848270a95d3
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
10 years agoUpdate changelog for 5.2.0
Alan Alpert [Mon, 25 Nov 2013 20:57:49 +0000 (12:57 -0800)]
Update changelog for 5.2.0

Includes taking entries for 5.1.2, which is no longer a general bugfix
release.

Change-Id: I33b4c06aa83d6344a2f14b4147eaf7056c3bacb9
Reviewed-by: Sergio Ahumada <sahumada@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDoc: Change the order of QQuickText function definitions
Topi Reinio [Tue, 26 Nov 2013 10:15:05 +0000 (11:15 +0100)]
Doc: Change the order of QQuickText function definitions

For Text QML type, some property and method documentation
is missing from the output because in the source file,
they appear before the '\qmltype Text' command.

This change reorders the functions so that qdoc will see
all documentation for Text QML type.

Task-number: QTBUG-35018
Change-Id: Icd995f66679d5105912ee12a7aeffd510921a54d
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
10 years agoDoc: Update examples used in Writing QML Extensions tutorial
Topi Reinio [Mon, 25 Nov 2013 12:27:42 +0000 (13:27 +0100)]
Doc: Update examples used in Writing QML Extensions tutorial

Update the examples to use Qt's resource file system to
store the qml files in, enabling them to run unmodified
in any platform/build configuration.

Also,
    - Chapter 6: Move the plugin code to a subproject
      and create a C++ application to use the plugin
    - Update documentation related to above chapter
    - Add thumbnails for the examples so they will
      appear in Qt Creators example list.

Task-number: QTBUG-35001
Change-Id: I29122af11bb11c7e5e17993438e5fc18c7f96f89
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
10 years agoHandle boundingboxes with NaN in them.
Gunnar Sletta [Thu, 28 Nov 2013 10:44:39 +0000 (11:44 +0100)]
Handle boundingboxes with NaN in them.

NaN does not compare well with other floats. The result is that the
bounding box is left at its initial values, FLT_MAX for top-left and
FLT_MIN for bottom-right. If so, treat geometry as invalid, aka
infinite.

Task-number: QTBUG-35192
Change-Id: I1df6987d56a0ce1f500b0eba344a5dcbc55f80a4
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agodisable qml import scan for qmljs
Oswald Buddenhagen [Wed, 27 Nov 2013 13:43:06 +0000 (14:43 +0100)]
disable qml import scan for qmljs

there is nothing to scan here.

Task-number: QTBUG-35160
Change-Id: I47223a295eafe67f0f2dd85a12444260f88d0623
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoEnsure that QML Windows respect the default platform window state
Tor Arne Vestbø [Wed, 27 Nov 2013 16:57:25 +0000 (17:57 +0100)]
Ensure that QML Windows respect the default platform window state

The 'visible' property of a Window would be set on the baseclass QWindow
like any other property during QML component creation, which would cause
create() to be called and the platform window would be created.

This left the 'visibility' of the QML window as Windowed, not respecting
the platform defaults for how windows should be shown. The user would
have to explicitly set "visibility: Window.AutomaticVisibility" for
this default to apply, which doesn't make sense -- it should be the
default.

We solve this by deferring setVisible and setVisibility on the window
until the component is complete and we have a full picture of its state.
We then ask the platform for the default state based on the window flags
(ensuring that eg "flags: Qt.Popup" will not result in maximized
windows on iOS and Android), and apply the deferred visibility.

The deferred visibility may still be 'false', but setting the window
state makes sense anyways, so that a later "visible = true" will
apply the default window state.

Deferring platform window creation until the geometry has been
potentially set from user code also has the benefit that the
platform window can check the geometry and apply a default
geometry if it's null. This was not possible when the 'visible'
property was a regular property, as you could not know if the
user's geometry changes would come after platform window creation.

Task-number: QTBUG-35174
Change-Id: Icf3236187992048a85b2196c059f9b54699041a4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoSet all attached section properties before emitting change signals.
Martin Jones [Fri, 29 Nov 2013 01:56:49 +0000 (11:56 +1000)]
Set all attached section properties before emitting change signals.

If we have bindings to the section properties, e.g. implementing manual
section header creation, we want previousSection, section and
nextSection to be set before emitting the change signals to prevent
different results each time the binding is run.

Change-Id: Id3a0b4a53419681f35102c9e7c620b5c6112ebb0
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
10 years agoWhen the MouseArea loses grab, an active drag should be cancelled.
Robin Burchell [Mon, 25 Nov 2013 22:55:22 +0000 (23:55 +0100)]
When the MouseArea loses grab, an active drag should be cancelled.

Change-Id: Icc784dd3265c211d9b077b692464591a41976354
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoAdd support pre-compiled bindings for QML custom parsers
Simon Hausmann [Wed, 27 Nov 2013 12:46:58 +0000 (13:46 +0100)]
Add support pre-compiled bindings for QML custom parsers

For example the x property in

    PropertyChanges {
        target: foo
        x: someItem.x - other.width / 2
    }

was compiled at run-time dynamically, which produces slower code (no type
information available) and slows down the type instantiation, because the
compilation happens every time at instantiation time (or later).

With this change, when the custom parser behind PropertyChanges requests a
binding ID for "x", the right hand side will be added to the bindings to
compile, then compiled and later at run-time the QQmlBinding constructor that
takes a QQmlBinding::Identifier can retrieve the correct compiled function from
the QV4::CompiledData::CompilationUnit.

Change-Id: I857fb2d39e82714b225bc9394b9904b795c6662b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoAdapt tests to new events from qqmlprofilerservice
Ulf Hermann [Fri, 29 Nov 2013 09:15:41 +0000 (10:15 +0100)]
Adapt tests to new events from qqmlprofilerservice

Change-Id: I59baa1f9aa0751d4bffc6eff0332318efc6fe9a8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoSome documentation for the VME profiler
Ulf Hermann [Thu, 28 Nov 2013 11:48:23 +0000 (12:48 +0100)]
Some documentation for the VME profiler

Change-Id: Ifa36166e803e81484c6a96c732b72f0ee2412c28
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoUse the new object creation profiler in qqmlvme
Ulf Hermann [Wed, 27 Nov 2013 16:21:27 +0000 (17:21 +0100)]
Use the new object creation profiler in qqmlvme

There are 3 ways to create objects: "Simple", "Cpp" and "Qml". This
patch starts a new profiler whenever a new object is created.
It's assumed that everything the interpreter main loop does between
two creation instructions is related to the object just created.
The componentComplete calls are profiled by restoring saved states
of the profilers used during the creation of the respective objects.

Task-number: QTCREATORBUG-10631

Change-Id: I2645eab7ba32dfb8749cb51ec888d0f0e8fef188
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAdd a stack-based object creation profiler
Ulf Hermann [Wed, 27 Nov 2013 11:58:13 +0000 (12:58 +0100)]
Add a stack-based object creation profiler

The simple instantiate-in-context way of profiling object
creation doesn't work anymore because the VME's contexts don't
necessarily map to C++ contexts anymore. The new profiler
introduces two stacks of contexts, one for currently running
ranges (such as components) and one for ranges that will be
revived later to profile componentComplete() and similar things.

Task-number: QTCREATORBUG-10631

Change-Id: Idf19b2adf062bc9c185b3bb5ff5229381f577645
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove old qml object creation profiling
Ulf Hermann [Tue, 26 Nov 2013 14:54:43 +0000 (15:54 +0100)]
Remove old qml object creation profiling

The old way the object creation profiler works is unsuitable for
detailed profiling as it only tracks top level components.

Task-number: QTCREATORBUG-10631

Change-Id: I502d0e144f2965f5e09af8461b50b56c61de5b4b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoEnable broken IBO fallback for Hisilicon Immersion 16 GPU
Eskil Abrahamsen Blomfeldt [Thu, 28 Nov 2013 14:47:12 +0000 (15:47 +0100)]
Enable broken IBO fallback for Hisilicon Immersion 16 GPU

This GPU is on the Huawei Ascend D1 and exhibits crashes
in glDrawElements() when rendering scenegraph when the workaround
is not turned on.

Change-Id: Ic601d34c01e34faaa091a631cfed74c3601c9c43
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoFix accelerated property lookup on id addressed objects
Simon Hausmann [Sun, 17 Nov 2013 17:17:28 +0000 (18:17 +0100)]
Fix accelerated property lookup on id addressed objects

For properties on id referenced objects, we can ignore the lack of the FINAL
keyword on properties, as we want the same "lexical" lookup rules like for
properties on the scope or context objects. In addition we need to initialize
the resolver on the returned temp, to ensure a successful type determination in
the use of the id object afterwards.

Change-Id: I496c942ade55aa331e6972f06b21c2c86d4b00a4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix JavaScript signal connect on alias without other handlers
Simon Hausmann [Thu, 28 Nov 2013 15:57:41 +0000 (16:57 +0100)]
Fix JavaScript signal connect on alias without other handlers

The changed handlers for aliases are connected lazily in the engine.
QQmlPropertyPrivate::flushSignal is responsible for that and called in other
places, for example when installing a onSomeAliasPropertyChanged handler.
However we were missing a call to flushSignal when doing
onSomeAliasPropertyChanged.connect(...), i.e. using the JavaScript connect API.

Task-number: QTBUG-30493
Change-Id: Ia3f008626fd7af3f2cfbdd30d13fb83158bed4d5
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix warnings: initialize Instruction variables created on the stack
Thiago Macieira [Wed, 27 Nov 2013 07:05:57 +0000 (23:05 -0800)]
Fix warnings: initialize Instruction variables created on the stack

GCC 4.7-4.9 are right that the "code" member is used uninitialized. In
fact, GCC 4.9 was quite assertive about it:

qqmlinstruction_p.h:538:102: error: ‘def.QQmlInstructionData<8>::<anonymous>.QQmlInstruction::instr_common::code’ is used uninitialized in this function [-Werror=uninitialized]
         static void setData(QQmlInstruction &instr, const DataType &v) { memcpy(&instr.FMT, &v, Size); } \
                                                                                                      ^

(It says "is used uninitialized" for this particular case; the "may be
used uninitialized" appears in other places)

The analysis is as follows:
 - variable declared on qqmlcompiler.cpp:1467:
     Instruction::SetDefault def;
 - type is POD, so no initialization is performed (def contains garbage)
 - on qqmlcompiler.cpp:1468 we use the variable:
    output->addInstruction(def);
 - QQmlCompiledData::addInstruction is inlined and does:
        QQmlInstructionMeta<Instr>::setData(genericInstr, data);
 - which is the call above, doing a memcpy with a source (&v) equal to
   the uninitialized "def" variable
 - result: memcpy is copying uninitialized bytes

Valgrind doesn't report this because it doesn't care about copying
uninitialized data. It will only complain if a decision is made based
on it, which we don't since the first thing we do after the memcpy is
initialize the member.

The solution is simple to not copy the common part of the
instructions. This way, we save 8 bytes of unnecessary copying and we
still keep the warning if a member of an extended instruction isn't
set.

Change-Id: I940b40ea9aa61c7386e5cced4a7865be7bfddb5d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoSet sampler precision in shifted distance field text shader
Eskil Abrahamsen Blomfeldt [Tue, 26 Nov 2013 11:23:03 +0000 (12:23 +0100)]
Set sampler precision in shifted distance field text shader

The precision would default to lowp and we would attempt to
call smoothstep(mediump, mediump, lowp) which was a
non-existent overload on some drivers, thus causing a compiler
failure. We can use mediump for the sampler, like in the
regular distance field shader.

Task-number: QTBUG-35122
Change-Id: Ib50325d48fe7e0d25559da97e7f53e5170f705a1
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoSlightly accelerate access to value type properties
Simon Hausmann [Sun, 17 Nov 2013 17:07:06 +0000 (18:07 +0100)]
Slightly accelerate access to value type properties

We can't do a fast property index based access on them, due to the inability to
read individual fields from the original object (i.e.  the logic in
QQmlValueTypeWrapper). However what we can determine and propagate is the type
information of the individual properties, i.e. that the x and y properties of a
QPointF are always doubles.

Change-Id: Iee71ece2117294b7bc0b93deb0a77d7c51148b11
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoAdd a QML debug config option QML_LOOKUP_HINTS to find non-final properties
Simon Hausmann [Sun, 17 Nov 2013 04:10:23 +0000 (05:10 +0100)]
Add a QML debug config option QML_LOOKUP_HINTS to find non-final properties

This helps to optimize property access, especially for attached properties.

Change-Id: Id47a9c5f184f84ce5ab813d3b01d1a6c6031233e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoAdd support for accelerated property access to QML types and namespace support
Simon Hausmann [Thu, 14 Nov 2013 23:06:18 +0000 (00:06 +0100)]
Add support for accelerated property access to QML types and namespace support

* Resolve lookups in namespaces at compile time and instruct the SSA optimizer
  to eliminate reads from the namespace (QQmlTypeWrapper) if possible. For example
  access to attached properties of types (i.e. MyNameSpace.ListView.isCurrentItem)
  requires neither reading the namespace nor the type.
* Add support for accelerated lookup of attached properties

Change-Id: Ib0b66404ed7e70e1d4a46a1ac8218743a4cc8608
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agotests: update tst_qquicktextinput
Liang Qi [Thu, 21 Nov 2013 10:06:24 +0000 (11:06 +0100)]
tests: update tst_qquicktextinput

* add signal_accepted() with validator
* update signal_editingfinished() with validator
* cleanup many qWait() and etc

Change-Id: Ic0a8f1cdc4f1f811501c06513efff9b6217fc749
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoRevert 99480d5420c0beea6771be582c039b550a4461f5
Gunnar Sletta [Wed, 27 Nov 2013 10:19:09 +0000 (11:19 +0100)]
Revert 99480d5420c0beea6771be582c039b550a4461f5

The Mac OS X platform plugin has been fixed so that this
hack is no longer needed. Not to mention that it breaks on XCB.

We keep the warning about bad exposes from the plugin in debug
mode. These are still useful for tracking down future bugs.

Task-number: QTBUG-35143
Change-Id: I5125f7ae2b7fd77c55e9a29b10aa5434598a9ea9
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
10 years agoTextInput: call fixup() when appropriate
J-P Nurmi [Tue, 26 Nov 2013 15:56:00 +0000 (16:56 +0100)]
TextInput: call fixup() when appropriate

[ChangeLog][QtQuick] Fixed TextInput to call fixup() on its validator
when being accepted or losing focus, and the validator reports that the
input is in "intermediate" state ie. the input should be fixed up.

Task-number: QTBUG-35128
Change-Id: I4b15406c584a9647bcf892badfaf6d845868fbf1
Reviewed-by: Liang Qi <liang.qi@digia.com>
10 years agoDelay renderWindow with a timer
Robin Burchell [Tue, 26 Nov 2013 13:59:19 +0000 (14:59 +0100)]
Delay renderWindow with a timer

Add an exhaust delay to QSGGuiThreadRenderLoop. Some updates
may be done with posted events, and maybeUpdate event competed
with those, leading to partial updates and frames drawn twice.

Change-Id: I532bff692c597eeba5bbd6def89ae68c80fdd69b
Done-with: Mikko Harju <mikko.harju@jollamobile.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoProspective fix for crashes when sorting JS arrays on Windows
Simon Hausmann [Tue, 26 Nov 2013 11:22:36 +0000 (12:22 +0100)]
Prospective fix for crashes when sorting JS arrays on Windows

std::sort doesn't seem to like sorting empty arrays, so check the
size before sorting.

Task-number: QTBUG-33658

Change-Id: I841259939ea3bf850d23c129744c322ed46a95fe
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
10 years agoFix build with QT_NO_ACCESSIBILITY
Thomas McGuire [Tue, 26 Nov 2013 08:48:42 +0000 (09:48 +0100)]
Fix build with QT_NO_ACCESSIBILITY

"q" was an unused variable, which triggered a warning/error.

Change-Id: I83bdc63a7caa12a5cd48331729492c0f36ed6fa0
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
10 years agoMerge "Merge branch 'release' of ssh://codereview.qt-project.org/qt/qtdeclarative...
Lars Knoll [Tue, 26 Nov 2013 09:04:58 +0000 (10:04 +0100)]
Merge "Merge branch 'release' of ssh://codereview.qt-project.org/qt/qtdeclarative into stable" into refs/staging/stable

10 years agoMerge branch 'release' of ssh://codereview.qt-project.org/qt/qtdeclarative into stable
Simon Hausmann [Tue, 26 Nov 2013 09:01:56 +0000 (10:01 +0100)]
Merge branch 'release' of ssh://codereview.qt-project.org/qt/qtdeclarative into stable

Change-Id: I0bf06be69927d5961f1bdb4948c3572ef6111923

10 years agoFix MSVC-64-warnings about truncation of integers.
Friedemann Kleint [Mon, 25 Nov 2013 13:08:19 +0000 (15:08 +0200)]
Fix MSVC-64-warnings about truncation of integers.

Change-Id: Ib92ce4b7e42061bb1892957f04cbfc1fcfe43615
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
10 years agoFix MSVC-64-warning about shift word size.
Friedemann Kleint [Mon, 25 Nov 2013 13:01:12 +0000 (15:01 +0200)]
Fix MSVC-64-warning about shift word size.

jsruntime\qv4mm.cpp(301) : warning C4334: '<<' : result of 32-bit shift
implicitly converted to 64 bits (was 64-bit shift intended?).

Change-Id: I6a4ca024d43776e16a323fdb8c35a339b74e6c09
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
10 years agoAlso update viewport size when header/footer size changes
Robin Burchell [Mon, 25 Nov 2013 22:54:47 +0000 (23:54 +0100)]
Also update viewport size when header/footer size changes

Task-number: QTBUG-24292
Change-Id: I8e7f5abe077b6e8d2ce6625dcf43a34a7260934e
Done-with: Martin Jones <martin.jones@jollamobile.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoQSmoothedAnimation: Don't set property if animation isn't running
Robin Burchell [Wed, 20 Nov 2013 21:36:30 +0000 (22:36 +0100)]
QSmoothedAnimation: Don't set property if animation isn't running

This could cause things to get "stuck" in the wrong state under some rather hard
to reproduce conditions.

Change-Id: Ied23d2bdfcfd0b197f4b28fed9c82ffd64e52ebf
Done-with: Aaron Kennedy <aaron.kennedy@jollamobile.com>
Done-with: Alan Alpert <416365416c@gmail.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoInitial support for accelerated property access to QML singletons and enums
Simon Hausmann [Sat, 2 Nov 2013 21:46:25 +0000 (22:46 +0100)]
Initial support for accelerated property access to QML singletons and enums

With this patch we determine the meta-object of singletons, propagate it into
the IR and load them separately using a dedicated run-time function. In
addition enums in singletons and QML types are resolved at compile time.

Change-Id: I01ce1288391b476d1c9af669cb2987a44c885703
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoIR Cleanup, resolve ID objects through array subscripts
Simon Hausmann [Sat, 2 Nov 2013 17:48:18 +0000 (18:48 +0100)]
IR Cleanup, resolve ID objects through array subscripts

...instead of a special MEMBER type. This allows removing the
type member from V4IR::Member altogether (and thus unshadow from
V4IR::Expr::type). By not requiring the base of a id lookup
member expression to be a NAME, we can also speed up repeated
id lookups by fetching the id object array wrapper only once
per function.

Change-Id: I3e9b8f498d32ace4a0cc2254f49e02ecc124f79c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoCleanup, get rid of MemberOfQObject V4IR::Member specialization
Simon Hausmann [Sat, 2 Nov 2013 16:40:35 +0000 (17:40 +0100)]
Cleanup, get rid of MemberOfQObject V4IR::Member specialization

It is technically redundant to the Member::property field.

Change-Id: If0ee35b2c94a2c9373784d36a1f8dfe8ad7dcfb3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoSpeed up repeated context, scope and import script lookups
Simon Hausmann [Tue, 29 Oct 2013 12:02:48 +0000 (13:02 +0100)]
Speed up repeated context, scope and import script lookups

Instead of querying for the context, scope or imported scripts object on each
access, do it once at the beginning of the expression in the IR and re-use the
temp. The optimizer will optimize away unused temps.

Change-Id: I703e737469030c4454d23c567873012a2b537d71
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoImprove type interference for QObject properties
Simon Hausmann [Wed, 30 Oct 2013 15:49:32 +0000 (16:49 +0100)]
Improve type interference for QObject properties

Propagate QObject properties in member expressions across temporaries
as part of the type interference SSA pass. This replaces the earlier
attempt to resolving QObject properties in fieldMemberExpression()
in the codegen, but it was incomplete and now things like the following
are fully resolved:

    var tmp = blah.somePropertyThatReturnsAQQuickItem; <-- QQuickItem property return type propagated into tmp
    var width = tmp.width; <-- and picked up here again to resolve the index of width instead of by name

With this patch Temp gets a helper structure with a function pointer,
initialized to aid the resolution of properties in Qt meta objects. This
structure is propagated into the temps until it reaches the next member
expression that uses the temp. Similarly QObjectType is added as IR type, next
to VarType.

The resolution inside the SSA type interference pass also requires passing
through the QQmlEngine from the upper caller levels, in order to resolve the
property type to a potential QMetaObject property.

Change-Id: I14c98fa455db57603da46613ce49c174d0944291
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix crash on QQmlEngine destruction.
Robin Burchell [Mon, 25 Nov 2013 15:15:58 +0000 (16:15 +0100)]
Fix crash on QQmlEngine destruction.

QQmlTypeLoader references QQmlImportDatabase in a thread, so change the
declaration order so QQmlTypeLoader is destroyed and its thread stopped
before QQmlImportDatabase is destroyed.

Change-Id: If1f8ef0a5ce56103a417ecfb6897d2c3b9c8d364
Done-with: Andrew den Exter <andrew.den.exter@jollamobile.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix out of bounds array access when index is integer and negative
Simon Hausmann [Mon, 25 Nov 2013 08:21:27 +0000 (09:21 +0100)]
Fix out of bounds array access when index is integer and negative

When the index is a double, the branchTruncateDoubleToUInt takes care of
branching when the index is negative, but when it's an integer we need
to perform that check ourselves.

Without the patch it's rather easy to cause the application to crash.

Change-Id: If908923ddc2077b3fb3dd42350f038ff0072e8e1
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoUse QFontDatabase to check if a font is scalable.
Yoann Lopes [Fri, 22 Nov 2013 17:52:22 +0000 (18:52 +0100)]
Use QFontDatabase to check if a font is scalable.

The flag set in QFontEngine was not always correctly set, use
QFontDatabase instead which is slower but should always be correct.
We fallback to native font rendering when the font is not scalable.

Change-Id: Ie9a2397abd42890d0fb05bc2f9c46a60040296f2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoStop render thread regardless when the window is being destroyed
Gunnar Sletta [Mon, 25 Nov 2013 10:40:12 +0000 (11:40 +0100)]
Stop render thread regardless when the window is being destroyed

When a window is shown and quickly hidden again we can get to
a state, on a asynchronous windowing system API, where the
isExposed=true event has been pushed to the event queue but
not yet processed at the time the user calls hide().
As hide() immediately sets isVisible() to false, we end up with
isExposed=true and isVisible=false which prevent the WM_Obscure
event to be sent to render loop which means the render thread
thought the window was still on screen when we reched the
shutdown in WM_TryRelease.

Changed WM_TryRelease handling to disregard window state when
the window is being deleted. This forces SG and GL cleanup
and stops the thread.

Task-number: QTBUG-35055
Change-Id: Ibac5aa27354d6450f30a61450214cb785ab855bf
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix rendering of Flipable content.
Gunnar Sletta [Mon, 25 Nov 2013 09:06:36 +0000 (10:06 +0100)]
Fix rendering of Flipable content.

When a batch is merged in the renderer, we use the z component to
stack the item front to back. This works because each item is
guaranteed to have a z-range of 0->1. However, when a projective
matrix is used, we need to compensate for the implicit [x,y,z]/w,
which GL applies to gl_Position after the vertex stage completes,
so that this guarantee still holds.

Task-number: QTBUG-35020
Change-Id: I254a3d4dc9ad22f53717160ec6ad8f3a27b43d1c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoNo assert when the focus changes and a window has no active focus item.
Frederik Gladhorn [Fri, 22 Nov 2013 18:13:20 +0000 (19:13 +0100)]
No assert when the focus changes and a window has no active focus item.

[ChangeLog][QtQuick] Fix crash when showing and hiding a window that has
no active focus item.
QtQuickControls hit the situation where a popup window was shown without
ever having an active focus item. When then closing the popup,
clearFocusInScope would assume it had to always modify the old focus,
but in this case the focus would be on the window itself, so there is
nothing to update.

Task-number: QTBUG-35057

Change-Id: Ifbde4689d39f98b13e6f90573cb22e28bb86f2c4
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
10 years agoFix memory corruption in QML expression compilation
Simon Hausmann [Mon, 25 Nov 2013 14:58:36 +0000 (15:58 +0100)]
Fix memory corruption in QML expression compilation

We store QQmlPropertyData pointers in our IR for Qt meta-object property
resolution at compile time. As it turns out however, it is possible that these
pointers change after retrieval from the QQmlPropertyCache, as the cache may
change later in the compilation process. Therefore we must do what also
QQmlCompiler does by storing a copy of the QQmlPropertyData. For the JS IR we
can do that conveniently through the IR memory pool.

A side-effect of this bug was that QQmlPropertyData pointers were re-used
and so the identity check in the isel later such as

    _function->contextObjectDependencies.contains(m->property)

for dependency tracking failed. In the example given in the bug report it was
determined that the window.contentWidth property wouldn't need a property
capture, and therefore the binding was not re-evaluated as window.contentWidth
later in the binding evaluation phase received its correct value.

This patch also fixes the incorrect debug output names assigned to JS binding
expressions, where the index used to look up the name is per compiled object,
not per QML component.

Task-number: QTBUG-35063
Change-Id: I3e5bbfaac11e5c122a2ed15a3e486a93988e1b6e
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoTests: Enable TestHTTPServer to receive data in chunks.
Friedemann Kleint [Wed, 20 Nov 2013 16:28:14 +0000 (17:28 +0100)]
Tests: Enable TestHTTPServer to receive data in chunks.

Fixes tst_qqmlxmlhttprequest on Windows.

Task-number: QTQAINFRA-573

Change-Id: Ie685cfa90904672246c1c5d8d3cec54c63cc76ba
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
10 years agoAllow for QtQml and QtDeclarative to co-exist at run-time
Simon Hausmann [Mon, 25 Nov 2013 09:11:10 +0000 (10:11 +0100)]
Allow for QtQml and QtDeclarative to co-exist at run-time

This patch changes QQmlData to share the very first bit with QDeclarativeData,
to indicate if the QObject in question is exposed in the QML1 or QML2 run-time.

Task-number: QTBUG-35006

Change-Id: I3aa1d7c99038792011afd9f481ad30d9b981721f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDo not crash when resizing invisible (non-tracked) windows.
Gunnar Sletta [Mon, 25 Nov 2013 07:25:21 +0000 (08:25 +0100)]
Do not crash when resizing invisible (non-tracked) windows.

Change-Id: I776c21a0f675d2dbe831325cef2c1c2a103e03e5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoPerformance note about QQuickWindow::setColor vs top-level Rectangle
Gunnar Sletta [Mon, 25 Nov 2013 09:33:20 +0000 (10:33 +0100)]
Performance note about QQuickWindow::setColor vs top-level Rectangle

Change-Id: I58d271b108734958b6e0cd55ff62417d5b649a63
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoFix crash when assigning a null QObject or derived property as a ListView model
Andrew den Exter [Thu, 21 Nov 2013 01:15:59 +0000 (11:15 +1000)]
Fix crash when assigning a null QObject or derived property as a ListView model

Fall through to the null case handler in the event of a QVariant of QObject or
derived type with a null value, rather than asserting in the instance handler.

Task-number: QTBUG-34999

Change-Id: I5eeffbe29a263c57e6157d516b138ddc8e2e7a95
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoAndroid: Add qmltooling plugins to apk
Daniel Teske [Wed, 20 Nov 2013 15:54:16 +0000 (16:54 +0100)]
Android: Add qmltooling plugins to apk

Task-number: QTCREATORBUG-10560

Change-Id: Ifabe6a74552dbc74b1de3030f8d60efda865f84a
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoBe even more tolerant towards broken platform behavior.
Gunnar Sletta [Thu, 21 Nov 2013 13:13:07 +0000 (14:13 +0100)]
Be even more tolerant towards broken platform behavior.

When the platform (Mac in particular) sends us exposes for windows
which are not renderable, we store it for later and fake expose events
when we get resized.

Task-number: QTCREATORBUG-10814
Change-Id: I909bb5a920550589322afd97ae1834884754cf81
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoQtQuick.Dialogs MessageDialog docs
Shawn Rutledge [Mon, 11 Nov 2013 20:41:47 +0000 (21:41 +0100)]
QtQuick.Dialogs MessageDialog docs

Change-Id: Ic229a26c395be0542409ba3e13739e55b6ffb521
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agoSafeguard the threaded renderloop against incorrectly exposed windows.
Gunnar Sletta [Wed, 20 Nov 2013 12:27:02 +0000 (13:27 +0100)]
Safeguard the threaded renderloop against incorrectly exposed windows.

On Mac we had a situation where we got expose events for windows which
were either 0x24 in size or completely off the screen. These would
result in makeCurrent failing and lead to crashes later on in the
scene graph. Safeguard against invalid dimensions during initialization
and abort after a call to makeCurrent if any of them fail.

Task-number: QTCREATORBUG-10814
Change-Id: I9063ea4d078eea3914666e4c155d141a1502e2ff
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
10 years agoAvoid symbol clashes when linking QtDeclarative and QtScript statically
Simon Hausmann [Fri, 22 Nov 2013 14:37:08 +0000 (15:37 +0100)]
Avoid symbol clashes when linking QtDeclarative and QtScript statically

Re-define the three symbols we actually implement (as stubs).

Task-number: QTBUG-35041
Change-Id: Ie9511207440fa23645e52643881f5993177a4368
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoSaner and simpler way to handle line numbers for JITed code
Lars Knoll [Thu, 14 Nov 2013 14:58:39 +0000 (15:58 +0100)]
Saner and simpler way to handle line numbers for JITed code

Instead of storing the current instruction pointer in the
ExecutionContext, we might as well directly store the current
line number there.

Leads to simpler code, works cross platform and should also
be faster.

Change-Id: Ifb7897cf8dbe8a962505fe876aa3ed43283ebb06
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoTurn execution contexts into Managed objects
Lars Knoll [Thu, 14 Nov 2013 13:53:28 +0000 (14:53 +0100)]
Turn execution contexts into Managed objects

This finally gives proper memory management for ExecutionContexts.
So far they had been garbage collected but where still allocated
using standard malloc/free(). This allows us to collect the
contexts faster and speed up context creation.

Change-Id: I02e642391d55eaa59ab3f4c2720a2ac71259caf4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAdd support for large items to the memory manager
Lars Knoll [Thu, 14 Nov 2013 11:05:42 +0000 (12:05 +0100)]
Add support for large items to the memory manager

This is required, so we can track ExecutionContexts
through the regular memory manager.

Change-Id: I1bd2e2ef275e6e9e1f364a35affbb991f4377b05
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoSpeed up arguments object
Lars Knoll [Thu, 14 Nov 2013 10:08:41 +0000 (11:08 +0100)]
Speed up arguments object

Don't fully create the arguments object unless required.
In the 95% use case, we can avoid creating any array based
data structures for the arguments object and directly
manipulate the functions arguments. only create the full
data structure for the other 5%.

Speeds up the raytrace test by 50%, gives around 10% overall
on v8-bench.

Change-Id: If727d28b96585e83314f544031a6c3ca1817ea19
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoUse lookups for create_property (ie. new foo.bar)
Lars Knoll [Wed, 13 Nov 2013 10:45:51 +0000 (11:45 +0100)]
Use lookups for create_property (ie. new foo.bar)

This is not used that often, but it removes one more place
where we do lookups by name.

Change-Id: I9f798b8b4a64be3fdf3e53090e4288724c9d2b22
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDon't store the QSGNode pointer
Alan Alpert [Wed, 20 Nov 2013 21:34:19 +0000 (13:34 -0800)]
Don't store the QSGNode pointer

The QSGNode subtree may be cleared at any time. Get the subtree via the
node pointer passed in updatePaintNode, to ensure that the subtree is
still valid each update.

Some references are still being stored but invalidated when a new
subtree is created. QTBUG-34994 has been created to track fixing that.

Task-number: QTBUG-33553
Change-Id: I2115aff931d42b613d207553c636be7d80c405bb
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoTextInput: add editingFinished signal
Liang Qi [Thu, 21 Nov 2013 10:06:24 +0000 (11:06 +0100)]
TextInput: add editingFinished signal

Autotest is included.

Task-number: QTBUG-34780

[ChangeLog][QtDeclarative][TextInput] add editingFinished signal

Change-Id: Ib633daee67cd4e5f15739a6004adbe882ab3d3fc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoFix assert after giving focus to a disabled item.
Andrew den Exter [Thu, 21 Nov 2013 01:10:10 +0000 (11:10 +1000)]
Fix assert after giving focus to a disabled item.

If an item has focus stolen by another item remove activeFocus from it even
if the item that gains focus doesn't gain activeFocus.  Otherwise the focus
tree will enter a state where an item that is not the subFocusItem of its
focus scope has activeFocus which is invalid and will trigger an assert
in QQuickWindowPrivate::clearFocusInScope().

Task-number: QTBUG-34779

Change-Id: I72408ec0e4fd9b05ef595147ef1ef95b6aed1c16
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agotst_qqmlxmlhttprequest: Use QScopedPointer.
Friedemann Kleint [Thu, 21 Nov 2013 08:09:56 +0000 (09:09 +0100)]
tst_qqmlxmlhttprequest: Use QScopedPointer.

Ensure resources are cleaned up in case of failing tests.

Change-Id: Ie27800da37beac09fec34111af276ed029dcde20
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoAlways check for dragging changed, not just when movement starts
Robin Burchell [Wed, 20 Nov 2013 21:29:54 +0000 (22:29 +0100)]
Always check for dragging changed, not just when movement starts

Otherwise, if you flick and then start a new drag before the flick
completes, dragging remains false.

Change-Id: I9bbe20107317a6edf765c87d2e0afe3e9e2618e9
Done-with: Aaron Kennedy <aaron.kennedy@jollamobile.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoV4 Use getrlimit on Darwin to get the stack size for the main thread
Andy Nichols [Wed, 20 Nov 2013 16:17:01 +0000 (17:17 +0100)]
V4 Use getrlimit on Darwin to get the stack size for the main thread

Turns out pthread_get_size does not return the correct size when it is
called from the main thread, so to workaround you call getrlimit instead
Without this change, most QML applications are broken on iOS.

Change-Id: I9a61494de26caa3d7be7e46a991e6d6d0514ce17
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoqml tool on OSX: wait for a timeout before exiting
Shawn Rutledge [Mon, 18 Nov 2013 14:57:08 +0000 (15:57 +0100)]
qml tool on OSX: wait for a timeout before exiting

Double-clicking to open a QML file was not working because it would
exit if no files are given on the command line.  It needs to wait
a while for the QFileOpenEvent.

Task-number: QTBUG-34926
Change-Id: Icb585a777b0438db85120c62e7717f0f6eafffb1
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
10 years agoEnforce window rendering in sequence on llvmpipe.
Gunnar Sletta [Wed, 20 Nov 2013 11:05:49 +0000 (12:05 +0100)]
Enforce window rendering in sequence on llvmpipe.

When rendering multiple windows in parallel on llvmpipe we end up with
crashes deep inside llvmpipe as multiple threads seem to access
unprotected resources. Work around this bug by enforcing that scene
graph rendering happens on one window at a time.

Task-number: QTCREATORBUG-10666
Change-Id: I2f734e8f653b2a9b4108eb189280ab922581e2c0
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
10 years agoUse the sharing context when grabbing a hidden QQuickWindow.
Jocelyn Turcotte [Mon, 18 Nov 2013 13:59:33 +0000 (14:59 +0100)]
Use the sharing context when grabbing a hidden QQuickWindow.

This allows QtWebEngine auto tests to grab the window's contents
without having to show it.

Change-Id: I5989a9815d0f69a7eff655f322c99d6051fc4d25
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoMerge remote-tracking branch 'origin/release' into stable
Frederik Gladhorn [Wed, 20 Nov 2013 12:36:33 +0000 (13:36 +0100)]
Merge remote-tracking branch 'origin/release' into stable

Change-Id: Id732233d56e8d1706f62ef7a153d4a471406c551

10 years agoFix bad refcounting for Context2D.drawImage with an image item source.
Gunnar Sletta [Wed, 20 Nov 2013 08:53:38 +0000 (09:53 +0100)]
Fix bad refcounting for Context2D.drawImage with an image item source.

The pixmap we get from createPixmap is cached internally in the
QQuickCanvasItem's cache so we need to refcount it properly. Using
take would result in the refcount going to zero in this function
which would cause a crash.

Task-number: QTBUG-34714
Change-Id: I5f0e75a7117c53e4b89ac133ba7d161bc7b9053d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoStabilize tst_qpauseanimationjob
Frederik Gladhorn [Tue, 19 Nov 2013 18:04:48 +0000 (19:04 +0100)]
Stabilize tst_qpauseanimationjob

This test is highly timer dependent and contains so many windows special
cases that indicate problems (when timers are not accurate or the
machine is busy).

Change-Id: Ie057d560d39300252ffb6c19b4d1446179c0e56a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
10 years agoCheck that the pathlist is not empty before calling sort() on it
Lars Knoll [Wed, 20 Nov 2013 08:55:54 +0000 (09:55 +0100)]
Check that the pathlist is not empty before calling sort() on it

Try to fix QTBUG-34834, where the app crashes because we replaced
qSort with std::sort(). Apparently std::sort always dereferences
begin(), even if it is the same as end().

Task-number: QTBUG-34834
Change-Id: I6207a27f61f21265dd964d7f4a6b78d059c615c8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoV4: fix Array.indexOf() for QStringList
Liang Qi [Thu, 3 Oct 2013 08:30:53 +0000 (10:30 +0200)]
V4: fix Array.indexOf() for QStringList

Autotest is included.

Task-number: QTBUG-33542
Change-Id: I46c3a81006019c6613a3d35aa018217f85a15d0b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
10 years agoBump MODULE_VERSION to 5.2.1
Sergio Ahumada [Tue, 19 Nov 2013 11:05:39 +0000 (12:05 +0100)]
Bump MODULE_VERSION to 5.2.1

Change-Id: I211610ee4153fa1e24de085d64bd735ce3746ae0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
10 years agoiOS: Fix Build error in QSGTexture
Andy Nichols [Tue, 19 Nov 2013 13:05:57 +0000 (14:05 +0100)]
iOS: Fix Build error in QSGTexture

We don't do build tests for qtdeclarative, and so this guy slipped
through the cracks.

Change-Id: I2ac29c6b7ec70f4dc4ca4bc682203bbca06f0e2a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
10 years agoFix build on iOS
Tor Arne Vestbø [Tue, 19 Nov 2013 16:28:34 +0000 (17:28 +0100)]
Fix build on iOS

Icccd542b8122c7bfa0e83 and Ia6e9f06dbb850 clashed.

Change-Id: Iaea844c9955eb29104ee32660499a67cb7224cbf
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
10 years agoGreatly reduce memory consumed by QQmlEngine instances
Lars Knoll [Tue, 19 Nov 2013 11:46:34 +0000 (12:46 +0100)]
Greatly reduce memory consumed by QQmlEngine instances

Due to a inefficiency in our InternalClass implementation,
we were not sharing the string and attribute table between
internal class instances.

This was extremely inefficient with the Qt object, as it created around
1000 internal classes with large string and property tables. With the
patch these tables are now shared.

Reduces memory consumption of a QQmlEngine instance from around 6.5M
to a couple of 100k.

Change-Id: Ib763f31deca0808c000ac2c30aa0b05e806bda40
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
10 years agoFileDialog example: remove setGeometry button
Shawn Rutledge [Mon, 18 Nov 2013 16:15:23 +0000 (17:15 +0100)]
FileDialog example: remove setGeometry button

This was more of a manual test than an example: it should be possible
to set the geometry of widget-based and qml-based dialogs.  Since it
doesn't work for native dialogs let's not invite bug reports about it.

Change-Id: I43cb97bff0af932268ae541e3f812fc17a1f76ae
Reviewed-by: Liang Qi <liang.qi@digia.com>
10 years agoFix compilation on QNX
Fabian Bumberger [Tue, 19 Nov 2013 10:29:34 +0000 (11:29 +0100)]
Fix compilation on QNX

pthread_getattr_np is not available there, so we use the default implementation (1MB stack limit) for now.

Change-Id: Ia1f3cbbcd846998b688541c0b576ef42f22ac8b6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4: remove failing assert and fix code.
Erik Verbruggen [Mon, 18 Nov 2013 14:33:19 +0000 (15:33 +0100)]
V4: remove failing assert and fix code.

Assert failed for cases where the node’s ancestor with lowest
semi-dominator number was not the same as the parent. The test case
exemplifies this.

Task-number: QTBUG-34792
Change-Id: Ie6847b22a27211801bff7479bfcbfaf329c6005a
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
10 years agoSafely abort when we don't succeed in creating a GL context.
Gunnar Sletta [Tue, 12 Nov 2013 15:53:47 +0000 (16:53 +0100)]
Safely abort when we don't succeed in creating a GL context.

Task-number: QTBUG-33363

Change-Id: Ia2b0c329157786cb4ec703989f12d2fdb1ce6bc8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix failing assertion when trying to assign to an id referenced QML object
Simon Hausmann [Mon, 18 Nov 2013 23:31:04 +0000 (00:31 +0100)]
Fix failing assertion when trying to assign to an id referenced QML object

References to id addressed QML objects are member expressions, which are unlike
other member expressions by not being lvalues. Handle this correctly.

Task-Number: QTBUG-34890

Change-Id: Ied6230edbc561128ad36bf0d1a1918185204deec
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 SSA: speed up dominator calculations.
Erik Verbruggen [Tue, 15 Oct 2013 14:13:01 +0000 (16:13 +0200)]
V4 SSA: speed up dominator calculations.

Changed three recursive routines to worklist-based iterative ones. This
not only speeds up the dominator frontier calculation, but also prevents
the algorithm to run out of stack space.

This is a partial fix for QTBUG-34047.

Change-Id: Ife8dc35724d50408ad356e1621884bdb82db9626
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix compiler warnings with mingw64.
Erik Verbruggen [Mon, 18 Nov 2013 16:57:32 +0000 (17:57 +0100)]
Fix compiler warnings with mingw64.

Task-number: QTBUG-34152

Change-Id: Ibb93d1cac8c343a7ca34ce7d010f24fc56ba89df
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake sure we clean up GL resources before we delete the GL context.
Gunnar Sletta [Mon, 18 Nov 2013 14:27:20 +0000 (15:27 +0100)]
Make sure we clean up GL resources before we delete the GL context.

Task-number: QTBUG-34806
Change-Id: I5013baaff0ca86357292474976944c1a3056f219
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>