platform/upstream/qtdeclarative.git
10 years agoFix performance regression for bindings from QtQuick state changes
Simon Hausmann [Mon, 31 Mar 2014 13:43:33 +0000 (15:43 +0200)]
Fix performance regression for bindings from QtQuick state changes

This is a regression from the compiler change. We can and should try to
use the binding as it was compiled in the loader thread for things like

    PropertyChanges {
        target: foo
        width: someExpresion + to + calculate * width;
    }

It is already ensured that these expressions are compiled without type
optimizations.

Change-Id: Ib855d8a848fcab2524df008727eab436ac98514e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix compilation of script strings
Simon Hausmann [Mon, 31 Mar 2014 13:07:18 +0000 (15:07 +0200)]
Fix compilation of script strings

The right hand side of script string properties can be evaluated in entirely
dynamic scopes, due to QQmlExpressions' public API of allowing construction
from a QQmlScriptString and a variable scope/context. Nevertheless we should
compile these bindings at type compile time, as long as we make sure that the
compiled code doesn't try to do any compile time determined property lookups
and type resolution. This is implemented using a separate compilation pass
that ensures the disableAcceleratedLookups flag is set.

A few minor cleanups come with this patch:

 * Ensure that the property caches array is always symmetric to the list of
   compiled QML objects, as that allows the use of at() instead of value().
 * The code for creating a QML callable function object for a given run-time
   function is now centralized in a static function QmlBindingWrapper, used
   for script strings and bindings from custom parsers.

The provided unit test verifies the successful execution of the same script
string with two different scope objects.

Change-Id: Ica2cea46dd9e47263b4d494d922d3cc9664b08ae
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake example work when QOffscreenSurface == QWindow
Gunnar Sletta [Fri, 28 Mar 2014 09:11:33 +0000 (09:11 +0000)]
Make example work when QOffscreenSurface == QWindow

Change-Id: I7435d91b37a46c0bced301c5c9c82fdf499e0587
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoMaroon example: use multimedia for audio; mute when inactive
Shawn Rutledge [Mon, 24 Mar 2014 15:33:10 +0000 (16:33 +0100)]
Maroon example: use multimedia for audio; mute when inactive

Task-number: QTBUG-37742
Change-Id: If1a6ded9ccdaa4cd6f5e6e405e2d5caa21710d4c
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
10 years agoPinchArea docs: elaborate on confusing aspects
Shawn Rutledge [Tue, 1 Apr 2014 08:06:32 +0000 (10:06 +0200)]
PinchArea docs: elaborate on confusing aspects

The pinch property and the pinch signal parameter are confusing,
especially since limits in the property don't apply to the values
in the signal parameter.

Task-number: QTBUG-37917
Change-Id: Id8fac60f505a1c54cc8debd3a29e013ca9d29773
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
10 years agoGive the QML and the debug server thread an objectname.
Thomas McGuire [Tue, 1 Apr 2014 08:59:39 +0000 (10:59 +0200)]
Give the QML and the debug server thread an objectname.

Now it is easier to identify the threads in e.g. the debugger in
QtCreator.

Change-Id: I032822e869df09cf43dc1d6e01d14610005ce217
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
10 years agoMove inline function Bool Runtime::compareEqual() above usage.
Friedemann Kleint [Tue, 1 Apr 2014 08:06:39 +0000 (10:06 +0200)]
Move inline function Bool Runtime::compareEqual() above usage.

Fix MinGW-warnings:

src/qml/jsruntime/qv4runtime_p.h:496:13: warning:
'static QV4::Bool QV4::Runtime::compareEqual(QV4::ValueRef, QV4::ValueRef)' redeclared without dllimport attribute after being referenced with dll linkage

Change-Id: Ieb212ed6aba2a0deeeddd033126ae7e9737bb38e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMaking the CHUNKSIZE setable via environment variable
Karim Pinter [Tue, 25 Mar 2014 15:34:52 +0000 (17:34 +0200)]
Making the CHUNKSIZE setable via environment variable

With this modification the CHUNKSIZE is setable by QV4_MM_MAX_CHUNK_SIZE
environment variable so the memory usage which is important for embedded
devices can be finetuned.

Change-Id: I3cd75158f2255651edd341873de035c1222e3c92
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix typo
Simon Hausmann [Mon, 31 Mar 2014 12:37:32 +0000 (14:37 +0200)]
Fix typo

creatScriptFunction -> createScriptFunction

Change-Id: Icdb9214b1ae067fa2b8693d50cdac0be9fe6d390
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agoFix compilation on QNX
Sergio Ahumada [Mon, 31 Mar 2014 14:04:05 +0000 (16:04 +0200)]
Fix compilation on QNX

Task-number: QTBUG-37979
Change-Id: Ie877317cded5b9eaf95389344712c66192696552
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
10 years agoDocument the QSG_VISUALIZE environment variable.
Mitch Curtis [Tue, 4 Mar 2014 13:14:16 +0000 (14:14 +0100)]
Document the QSG_VISUALIZE environment variable.

The explanations are taken from 3f8d5d0.

Change-Id: I9901b5f2c42f7bec6573101eb91eb9116089d4e9
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoFix performance regression of parent setting during QML object creation
Simon Hausmann [Mon, 31 Mar 2014 07:58:13 +0000 (09:58 +0200)]
Fix performance regression of parent setting during QML object creation

This showed up in the profiles again: In QML we create a lot of objects
with many children and sending a child event each time is expensive. That's
why the VME didn't do that and hadn't done so in ages. This patch restores
that behavior and aspect of loading performance.

Change-Id: I5078fe330d913dc832b284aaecf031152dc80802
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDon't crash when render node doesn't have a batchroot
Gunnar Sletta [Sat, 29 Mar 2014 06:52:06 +0000 (06:52 +0000)]
Don't crash when render node doesn't have a batchroot

Change-Id: Ib8f70414eb477b4ec45097c8784a5fe1375cf012
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoRemove object index parameter from QQmlCustomParser::compile
Simon Hausmann [Sat, 29 Mar 2014 13:15:54 +0000 (14:15 +0100)]
Remove object index parameter from QQmlCustomParser::compile

There is no need anymore to pass through the object index of the
object being "custom compiled".

Change-Id: I8ef8e578b27523d9e7190503fbf95d1eb863a149
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoEliminate noop translation bindings
Simon Hausmann [Sat, 29 Mar 2014 13:11:38 +0000 (14:11 +0100)]
Eliminate noop translation bindings

We can store them as regular strings. This has the advantage that the
entire special handling from the custom parser of the list model goes away,
we don't need astForBinding in QQmlCustomParser anymore neither and types
with a custom parser can now generally benefit from the expression simplification
pass.

Change-Id: I39d1b76edd1273d8c73b847aed71f7bcce37d877
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove dead code
Simon Hausmann [Sat, 29 Mar 2014 10:30:17 +0000 (11:30 +0100)]
Remove dead code

Remove qquick anchor line comparison hooks, which were intended to be used
inside the old v4 interpreter (but that was incomplete) and are now completely
unused.

Change-Id: I06b0dd684a292adb44efa52d27258242954285ee
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake it possible to supply compilation units from plugins
Simon Hausmann [Sat, 29 Mar 2014 09:05:09 +0000 (10:05 +0100)]
Make it possible to supply compilation units from plugins

This also cleans up the script and type initialization in
the type loader, for example by getting rid of the m_irUnit
member for scripts.

Change-Id: I207afeb21c0bae9091d3c7b4cac2e80e9aae0ea3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoEnable GL context sharing for QtQuick windows by default
Simon Hausmann [Wed, 26 Mar 2014 11:30:34 +0000 (12:30 +0100)]
Enable GL context sharing for QtQuick windows by default

This is required for running QWebEngine inside qmlscene. It can be disabled
with --disable-context-sharing and it remains off in QtQuick. Instead apps have
to use QWebEngine API to enable this, where this patch here is merely
convenience.

Change-Id: I123893a7c8c644c49c66fe2b42d2b7b2e03622d9
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoDestroy render loop when QCoreApplication is cleaned up.
Gunnar Sletta [Fri, 28 Mar 2014 13:52:26 +0000 (13:52 +0000)]
Destroy render loop when QCoreApplication is cleaned up.

Doing it on 'aboutToQuit' meant we would clean it up whenever an
application ran QCoreApp::exec() which could be multiple times
per application run.

Change-Id: I59e06398a551ae7979e3832dff811937037fa106
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
10 years agoFix visual parent ownership with scenes that create windows
Simon Hausmann [Fri, 28 Mar 2014 17:41:26 +0000 (18:41 +0100)]
Fix visual parent ownership with scenes that create windows

Commit 39540124dd0900e0c99dcda8c0ebdf4f3cea8d5e introduced the concept that
a visual parent marks its children, by recursively marking the children of
the root item in a QQuickView. This allowed for the removal of an ugly hack
in QtQuick Controls.

Unfortunately that fix is incomplete in the sense that it makes the incorrect
assumption that a QQuickView is always used. The use-case in the bug report is
to have child items inside a QtQuick.Window (a regular ApplicationWindow in
fact). That window - implemented by QQuickWindowQmlImpl - also needs to mark
its children, so this patch introduces the use of the same GC marking helper
class (which now operates on a QQuickWindow instead of a QQuickViewPrivate).

Task-number: QTBUG-37711
Change-Id: Id788e84dbb041ac8ba6ff23dc4ef56f6fe9e465a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove custom code for converting from QString to QColor
Simon Hausmann [Fri, 28 Mar 2014 12:30:00 +0000 (13:30 +0100)]
Remove custom code for converting from QString to QColor

After commit 9b021a1fbd0b974a452a6e18a8c0b4b97cbf8edb in qtbase we can now
(about a year later ;-) remove the custom code from handling alpha when
converting from string to color and rely on the implementation in qtbase.

Change-Id: Ia8086c99f0f782742d3adf12cb2c3b79dee8d578
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
10 years agoFix crash in conversion from QVariantMap to QJSValue
Simon Hausmann [Fri, 28 Mar 2014 15:02:45 +0000 (16:02 +0100)]
Fix crash in conversion from QVariantMap to QJSValue

When the key is an array index, use arraySet instead of trying to insert
an array index as internal class member.

Task-number: QTBUG-37854
Change-Id: I23f01cc9d6be98b57d3f13ac7ee847298e9632a3
Reviewed-by: Matt Broadstone <mbroadst@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
10 years agoV4 string table cleanups
Simon Hausmann [Thu, 27 Mar 2014 18:18:55 +0000 (19:18 +0100)]
V4 string table cleanups

Move the string table (index and data) to the end of the compilation unit.
That makes it easier to extend the string table later with new strings - for
example when transitioning from JS data to an entire QML unit - because all the
other offsets within the JS data remain the same.

Change-Id: Ib28caf943ee2ec74b7acc19c2980de0853bb8086
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoVarious cleanups
Simon Hausmann [Thu, 27 Mar 2014 16:07:06 +0000 (17:07 +0100)]
Various cleanups

* Encapsulate the string pooling for the V4 data generation into a StringGenerator class.
* Move type reference collection into the IR::Document, where it belongs (as it writes
  into the typeReferences there)
* const fixes
* Remove unused methods and members
* Store unit and qml unit sizes right in the generated data structure. That makes copying
  easier (like we do when generating the QML data based on the JS fields)

Change-Id: I053146ab0b00cc90ac7f72f867415962d1be121b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix crash in sparse array handling
Simon Hausmann [Fri, 28 Mar 2014 13:12:41 +0000 (14:12 +0100)]
Fix crash in sparse array handling

When re-allocating the sparse array data, make sure to initialize the free list
correctly. Previously this was only done for the first allocation.

Test cases uses an object literal, as that's a reliable way to ensure
a sparse array is created.

Task-number: QTBUG-37892
Change-Id: Ib38cfce50104904af0c980f022c9dbb7461ae5f8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix a link in QQuickDragAttached::dragType documentation
Jędrzej Nowacki [Tue, 18 Mar 2014 13:46:26 +0000 (14:46 +0100)]
Fix a link in QQuickDragAttached::dragType documentation

Change-Id: Ia704b3c84215b519e86a0aed884d89538ba7e4f9
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoFix interpreter math routines.
Erik Verbruggen [Fri, 28 Mar 2014 12:08:23 +0000 (13:08 +0100)]
Fix interpreter math routines.

This:
    qint64 result = a + b;
is not equal to:
    qint64 result = static_cast<qint64>(a) + b;

So checking if the former will overflow, and then doing the "double
case", will get thrown out by an optimizing compiler.

While we're in the area, optimize the X86 case a bit too.

Change-Id: Idfb69b16dbaaa0ae9f013a430ff060ca789526ba
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix double deletion
Simon Hausmann [Fri, 28 Mar 2014 12:04:42 +0000 (13:04 +0100)]
Fix double deletion

Small regression from commit 7ae796cb141b73a1b215b2b0fd64b7ffbbd1e510.
Processing the deletables might result in the onDestruction emission, which in
turn may end up in GC allocation and thus GC runs. That in turn may result
in m_deletables processing, which at this point is nested then. For that to
work we need to set m_deletables back to zero _before_ beginning with the
iteration.

Fixes tst_qqmlecmascript with aggressive gc.

Change-Id: Ibb310b30cd496644557f4c1bb23318b18ee8f36c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDoc: Add a module page for Qt Quick Widgets
Topi Reinio [Fri, 21 Mar 2014 13:15:19 +0000 (14:15 +0100)]
Doc: Add a module page for Qt Quick Widgets

Although the documentation is part of Qt Quick, a separate
module page with a \qtvariable command is still needed to
have correct information about which module to link against.

Task-number: QTBUG-37272
Change-Id: Ie00e9418be4feec299cb36c526ca366504c89008
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix QtSharedPointer::ExternalRefCountData object leak in v4 engine
Liang Jian [Fri, 28 Mar 2014 05:23:36 +0000 (13:23 +0800)]
Fix QtSharedPointer::ExternalRefCountData object leak in v4 engine

Always call ~QObjectWrapper() to the wrapper object in
QObjectWrapper::destroy(), otherwise the m_object member of QObjectWrapper
may still hold a QtSharedPointer::ExternalRefCountData object which will
never been deleted.
I don't know why this will not cause leak in the past, but it seems that
the leak was introduced in 7ae796cb141b73a1b215b2b0fd64b7ffbbd1e510

Change-Id: I24b49bb11f95b7e3060c7adba1ab80b615da2942
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDoc: Document signals (not handlers) under \qmlattachedsignal
Sze Howe Koh [Thu, 20 Mar 2014 13:57:03 +0000 (21:57 +0800)]
Doc: Document signals (not handlers) under \qmlattachedsignal

- They're not "attached properties" either.
- Append the handler names to the end of the corresponding signal doc.
- Update descriptions and links

Task-number: QTBUG-35846
Change-Id: I54e93187b3209546ec344a20e0482c98d7f14109
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoBe a bit more conservative with allocating memory
Lars Knoll [Tue, 25 Mar 2014 09:08:01 +0000 (10:08 +0100)]
Be a bit more conservative with allocating memory

Cap the max chunk size at 2MB. This value still still doesn't
affect the v8 benchmark noticably, but should avoid extreme
memory usage in some corner cases

Task-number: QTBUG-37134
Change-Id: If2050374c4a7df7ff74194d64880e2d660ea26fd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix instantiation of QML list models with custom object properties
Simon Hausmann [Tue, 25 Mar 2014 15:24:03 +0000 (16:24 +0100)]
Fix instantiation of QML list models with custom object properties

When doing something like

    property Item blah: Item { ... }

in a list model, we would erroneously pass "blah" to the custom parser of the
list model, which is wrong as the binding to blah is on an existing property
(not custom). For regular properties there's a code path in place to avoid
passing this to the custom parser, but for sub-object bindings we'd
unconditionally register it with the custom parser. This patch corrects that
and also adds a unit test to verify that we don't pass any bindings to existing
properties to the custom parser.

Task-number: QTBUG-37795
Change-Id: I1a3091fb5fad4be08b577cf74a85f24c3ab62ef4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove the scribble option from the memory manager
Lars Knoll [Wed, 26 Mar 2014 14:30:27 +0000 (15:30 +0100)]
Remove the scribble option from the memory manager

This option doesn't make sense anymore, as we memset the object to
0 on destruction anyway.

Change-Id: Ie40563394f9cacda1b35fde114c9a6043f53d460
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoGet rid of collectDeletables
Lars Knoll [Wed, 26 Mar 2014 14:11:48 +0000 (15:11 +0100)]
Get rid of collectDeletables

The method is only required for the QObjectWrapper, but
there we can instead simply register the deletable in the
destroy method.

Change-Id: I944319d327859cce33ac31a174e8d56fc4babfc1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoOptimize ExecutionContext::setProperty
Lars Knoll [Wed, 26 Mar 2014 07:55:45 +0000 (08:55 +0100)]
Optimize ExecutionContext::setProperty

Optimize the code in case the setProperty call tries to
set something in the activation. Avoid resolving the property
index twice.

Change-Id: I60a4535adc014f7118bc3ab6773e10ed688ca0d6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDon't use scopes in the instanceOf operator
Lars Knoll [Wed, 26 Mar 2014 07:55:28 +0000 (08:55 +0100)]
Don't use scopes in the instanceOf operator

There's no need to use scopes here, as instanceof can't
trigger any calls into the memorymanager. This slightly
speeds up the code.

Change-Id: Ie7f5c8f3982df1e24d21cfc4e0841d479a75c664
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoOptimize construct calls
Lars Knoll [Wed, 26 Mar 2014 07:53:59 +0000 (08:53 +0100)]
Optimize construct calls

Optimize construction of the internalClass for the object
being constructed.

Change-Id: Id5fc02c291664ec01c3595ae0acbb6895cc5b147
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoSave another 4/8 bytes per QQmlBoundSignalExpression
Simon Hausmann [Thu, 27 Mar 2014 08:52:39 +0000 (09:52 +0100)]
Save another 4/8 bytes per QQmlBoundSignalExpression

We can move the persistent to hold the scope for a string compiled binding into
the extra data.

Change-Id: I033aa6d080402a1eb19cdae540f9af2c5c3a3fc7
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agoLet render loop be more tolerant wrt when markDirty is called.
Gunnar Sletta [Thu, 20 Mar 2014 12:01:51 +0000 (13:01 +0100)]
Let render loop be more tolerant wrt when markDirty is called.

Change-Id: I95f1d6fe4695a09b1b6ccaf026137dabc22ec82c
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agoFix reading of shader sources in scene graph example
hjk [Tue, 25 Mar 2014 13:17:26 +0000 (14:17 +0100)]
Fix reading of shader sources in scene graph example

Task-number: QTBUG-33080
Change-Id: I9219233ab7c7fbe89c0a9f1453d7c6aeeca498a1
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoCall tzset() from getLocalTZA() so we learn about tz changes
Iain Lane [Thu, 27 Mar 2014 11:53:23 +0000 (11:53 +0000)]
Call tzset() from getLocalTZA() so we learn about tz changes

Per POSIX, localtime_r isn't required to call tzset(). This means that
we don't notice that the timezone has changed when calling
Date.timeZoneUpdated() from JS.

Call this in getLocalTZA() so that it always returns results pertaining
to the selected timezone.

Task-number: QTBUG-37683

Change-Id: Ia9098ef0100b7c909a82b125a5ea4f39fba1f306
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDocument limitations of QQuickWindow::createTextureXxx functions.
Gunnar Sletta [Tue, 25 Mar 2014 16:15:10 +0000 (17:15 +0100)]
Document limitations of QQuickWindow::createTextureXxx functions.

Change-Id: I6813f5109cad3e4ace354337d258db8c120b52c5
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix build on older MinGW
Konstantin Ritt [Wed, 26 Mar 2014 18:29:29 +0000 (20:29 +0200)]
Fix build on older MinGW

The correct declaration of the SHGetPathFromIDList symbol is
being used in mingw-w64 as of r6215, which is a v3 snapshot;
until then, SHGetPathFromIDList was declared to use LPITEMIDLIST.

Change-Id: Icc2f7814bad475c9b825f7d70c0ae4da72f471d9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoUse an offscreen surface in Canvas
Laszlo Agocs [Tue, 25 Mar 2014 10:51:53 +0000 (11:51 +0100)]
Use an offscreen surface in Canvas

Canvas elements using the default Immediate render strategy
and an FBO result in a failing makeCurrent() and subsequent
crashes due to trying to make the Quick window's surface current
on the gui thread while it is current on the scenegraph render thread.

The EGL spec disallows this explicitly and so the makeCurrent fails with
EGL_BAD_ACCESS. Others, like GLX, do not seem to have this issue since
the spec says nothing about this scenario.

To overcome this, a QOffscreenSurface is used instead since what the
canvas does (rendering into an FBO on a thread that is different than
the one on which the rest of the rendering happens) is a primary use
case for offscreen surfaces (pbuffers) anyway.

This makes demos like stocqt functional again.

Task-number: QTBUG-37772
Change-Id: Id89f71545154856415bbbe4fa924176b25b5086f
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoPass the actual window format to the offscreen surface during cleanup
Laszlo Agocs [Tue, 25 Mar 2014 14:01:44 +0000 (15:01 +0100)]
Pass the actual window format to the offscreen surface during cleanup

Using the requested format (we don't have anything else since the platform
window is gone) is wrong on EGL implementations that offer a different set
of configurations for window and pbuffer surfaces, because we may end up
with a pbuffer surface that is incompatible with the context/window due to
having different color buffer sizes.

To be absolutely sure that the surface is compatible, store the actual
surface format so that it is available even after the platform window is
gone.

Change-Id: Id17c25439c463d4c37af95fc90f336d3f67c6427
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix warnings about deprecated construction of QStrings from ASCII.
Friedemann Kleint [Wed, 26 Mar 2014 08:52:04 +0000 (09:52 +0100)]
Fix warnings about deprecated construction of QStrings from ASCII.

items\qquickimagebase.cpp(322) : warning C4996: 'QString::QString': was declared deprecated
items\qquickimagebase.cpp(342) : warning C4996: 'QString::QString': was declared deprecated

Change-Id: I550a13680d54ef2c3734151f56ea56ac8b9f3b9b
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoDon't create prototype objects for bindings
Lars Knoll [Tue, 25 Mar 2014 08:54:20 +0000 (09:54 +0100)]
Don't create prototype objects for bindings

They are neither used not accessible from QML.

Change-Id: I14fa6059b8e64cb2c3b9d025061548009a473f96
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoOptional reporting of GC statistics to stdout
Lars Knoll [Tue, 25 Mar 2014 08:46:43 +0000 (09:46 +0100)]
Optional reporting of GC statistics to stdout

Use QV4_MM_STATS to get some statistics about each GC run
written to stderr.

Change-Id: Idc30c06e1c3ca8353a2f16615cb26df13a8f23ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove unused method
Lars Knoll [Tue, 25 Mar 2014 08:44:52 +0000 (09:44 +0100)]
Remove unused method

Change-Id: Ia7df68e78ac105fe5519cb4f80a64561310d3324
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove code for conservative GC
Lars Knoll [Tue, 25 Mar 2014 08:15:51 +0000 (09:15 +0100)]
Remove code for conservative GC

This was meant as a debugging help after we took the exact
GC into use. Turns out it doesn't help debug any issues,
aggressive garbage collection is much more helpful in
finding GC issues.

Change-Id: Idfff26d3a4a15e570615009c1e57921bca6297ca
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoCorrectly parse unicode escape sequences between 0 and u001f
Lars Knoll [Tue, 25 Mar 2014 07:37:20 +0000 (08:37 +0100)]
Correctly parse unicode escape sequences between 0 and u001f

The old code rejected these escape sequences because of a
slight misreading of the spec.

Task-number: QTBUG-36968
Change-Id: I56a0e76295d1903b4798719de028bd21ad5be719
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoSmall fixes
Lars Knoll [Tue, 18 Mar 2014 10:10:28 +0000 (11:10 +0100)]
Small fixes

Don't cast from ushort to uchar and back, and remove a
condition that's always true. Allocate some more
memory for matching.

Change-Id: I8167b6e4b4989365ca0ea8e17f4bdb15c0d8e27d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix typo in calqlatr example doc.
Mitch Curtis [Mon, 24 Mar 2014 12:24:24 +0000 (13:24 +0100)]
Fix typo in calqlatr example doc.

Change-Id: I2c51ea35af7de4a2152840ebf3bfb64ec2ed8d89
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoFix some documentation errors.
Friedemann Kleint [Mon, 24 Mar 2014 16:34:04 +0000 (17:34 +0100)]
Fix some documentation errors.

Change-Id: I5d4b3e26742202c4b634d0001fd3658c7263c50a
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoFix infinite loop in method overload resolution
Simon Hausmann [Mon, 24 Mar 2014 13:31:05 +0000 (14:31 +0100)]
Fix infinite loop in method overload resolution

When resolving overloaded slots in a situation without property cache, then we
need to detect that we've reached the end of the overload lists and exit from
RelatedMethod with zero.

Task-number: QTBUG-37157
Change-Id: Ifaab8cc1b377725c99c1bb89bb9bb74d5a0af1b8
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agotests: fix tst_qqmllanguage::importIncorrectCase() and errors(incorrectCase)
Liang Qi [Fri, 21 Mar 2014 11:57:17 +0000 (12:57 +0100)]
tests: fix tst_qqmllanguage::importIncorrectCase() and errors(incorrectCase)

It gives different error message based on the case sensitivity of
the file system on Mac.

Task-number: QTBUG-37622
Change-Id: I567eb4a0b9a413f6eb51683b568f6a6284e6458d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
10 years agoDon't crash on Runtime::getQmlImportedScripts
Albert Astals Cid [Thu, 20 Mar 2014 15:28:15 +0000 (16:28 +0100)]
Don't crash on Runtime::getQmlImportedScripts

Task-number: QTBUG-37303

Change-Id: I083ca0cc3223fe0dbf1c768ad43a0d4927579867
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoCleanups
Simon Hausmann [Fri, 21 Mar 2014 00:10:37 +0000 (01:10 +0100)]
Cleanups

* Get rid of members in QQmlCompiledData that were used by the VME
  and are now unused
* Get rid of QQmlVME friend declarations that are not needed anymore

Change-Id: I11b4b6f0b4b0b60edf92a1256be3d0d44d76bbc9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix QQuickView::grabWindow() on retina displays
Morten Johan Sørvig [Thu, 20 Mar 2014 13:33:06 +0000 (14:33 +0100)]
Fix QQuickView::grabWindow() on retina displays

Multiply by window->devicePixelRatio() at all
qt_gl_read_framebuffer() call sites.

Task-number: QTBUG-35962
Change-Id: If58e4f97fc5d931ba2e222f8cb1a0641d52c3257
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoImplement high-dpi "@2x" image handling.
Morten Johan Sørvig [Mon, 19 Aug 2013 11:29:43 +0000 (13:29 +0200)]
Implement high-dpi "@2x" image handling.

Make QQuickBaseImage::load() load "@2x" image files
on high-dpi displays. Reload images on screen change
in order to load the correct version depending on
screen dpi. Modify QQuickImageBase::updatePaintNode()
to work with @2x images.

QQuickBaseImage::load() now looks at the target
window's devicePixelRatio and checks for the presence
of a "@2x" file on disk. If found the @2x version
will be used.

Unlike QPixmap, QQuickPixmap has no special knowledge
of "@2x" files. They pixmap system will be asked to
load "@2x" files and will cache them and report the
(device) pixel size, like any other pixmap.

Add auto-test and manual test.

Task-number: QTBUG-32862, QTBUG-33069
Change-Id: I1f57a10075e499f6eee61df5421e1986521c6ab0
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
10 years agoClearly point out the distinction between GUI and Render threads.
Gunnar Sletta [Thu, 20 Mar 2014 10:43:21 +0000 (11:43 +0100)]
Clearly point out the distinction between GUI and Render threads.

This is something it is easy to get wrong, so try to make it as
visible as possible.

Change-Id: I2253ae63214cef0fb91c8b9423d7918ffc20e888
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFinish QML test cases after waiting for deletion
Ulf Hermann [Wed, 19 Mar 2014 11:15:06 +0000 (12:15 +0100)]
Finish QML test cases after waiting for deletion

Otherwise messages triggered by the waiting (and the event loop that's
run in QTest::qWait()) won't be correctly attributed to the test
function being run.

Task-number: QTBUG-37609
Change-Id: Iccc13d8caa021fc26fbf76da0056cb0dd870ec0e
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
10 years agoBehavior fix when creating QML windows
Fabian Bumberger [Sat, 18 Jan 2014 15:45:33 +0000 (16:45 +0100)]
Behavior fix when creating QML windows

When a QML window is created it is set visible after the QQuickWindowQmlImpl component is complete.
This works fine for a single window, but because componentCompleted is called first for the last
created windows, the behavior is not as the user might expect (and different compared to
version 2.0 of the QML Window API). One of the results is e.g. that a  window which is created
as a child object in QML will have a lower z-Order than the parent. On some platforms (e.g. BlackBerry)
an even bigger problem arises because the first created window acts as a container for
the whole application and is always shown fullscreen. On other platforms (Linux) the initial window
position and the window focus ares not set correctly.

This patch postpones showing windows until the "transientParent" is visible.

[Changelog][QtQuick] Making a QtQuick Window visible is postponed till its transient parent is visible

Task-number: QTBUG-37440

Change-Id: I09a94ff038c066a5d3298c6c103dafde50bef1fa
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
10 years agoCleanup: Remove last traces of QQmlScript
Simon Hausmann [Tue, 18 Mar 2014 22:39:02 +0000 (23:39 +0100)]
Cleanup: Remove last traces of QQmlScript

What remains is the code for removing .pragma from script source code (and
replacing it with white-space to preserve line/column numbers).  The previous
code even returned the value of the pragmas, but for the remaining caller sites
that value isn't used, so we can just return void.

Change-Id: I16db15da236970660b817d6c4493005365a7a1af
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoQQuickWidget: Fix SizeViewToRootObject
Paul Olav Tvete [Wed, 19 Mar 2014 08:30:05 +0000 (09:30 +0100)]
QQuickWidget: Fix SizeViewToRootObject

There were two problems: 1) QWidget does not have a default size of (0,0)
or (1,1), but uses WA_Resized. 2) event() would eat timer events without
checking the timerId.

Change-Id: I355acbb10d3d5073e117c29de18bb94857881141
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoInvalidate all batches potentially affected by a change.
Gunnar Sletta [Wed, 19 Mar 2014 10:58:04 +0000 (11:58 +0100)]
Invalidate all batches potentially affected by a change.

When two separate changes have occurred, we need to not
only invalidate the batches directly overlapping those, but
also any batch which has render orders between the two. So,
keep track of the range of invalidated render orders and
invalidate everything in between.

Task-number: QTBUG-37422
Change-Id: Ie5a289d5c569b84917ec9ac52671173c566e69b3
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoSet correct FBO size for devicePixelRatio != 1
Morten Johan Sørvig [Wed, 19 Mar 2014 09:41:44 +0000 (10:41 +0100)]
Set correct FBO size for devicePixelRatio != 1

Change-Id: I3cc584e8ff980cd4328639a5e98241713a13cb04
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
10 years agoCompilation fix
aavit [Mon, 17 Mar 2014 15:30:40 +0000 (16:30 +0100)]
Compilation fix

gcc 4.6 chokes on this construct.
Replace with a shorter and more readable one :)

Change-Id: I02ff7a2c5300de656e61ee5ca8effabdd74991bb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoClear the chain of incubated objects in QQmlIncubatorPrivate::clear
Albert Astals Cid [Thu, 13 Mar 2014 16:09:39 +0000 (17:09 +0100)]
Clear the chain of incubated objects in QQmlIncubatorPrivate::clear

Change-Id: I432310c0e6006d567fd59b4b1021a9e1538ef78f
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoCleanup: Get rid of QQmlScript::TypeReference
Simon Hausmann [Tue, 18 Mar 2014 22:06:41 +0000 (23:06 +0100)]
Cleanup: Get rid of QQmlScript::TypeReference

Change-Id: I5f8b203ac71f0667947087bd2b1e7ce6d91d843d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoCleanup: Remove dead code
Simon Hausmann [Tue, 18 Mar 2014 22:03:02 +0000 (23:03 +0100)]
Cleanup: Remove dead code

Change-Id: I073a8c61d666a08b5e88edcbf4cefa71d7f5b7c3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoCleanup
Simon Hausmann [Tue, 18 Mar 2014 21:59:36 +0000 (22:59 +0100)]
Cleanup

Get rid of QQmlScript::Import in favor of operating on QV4::CompiledData::Import
structures throughout the type loader.

Change-Id: I29de369373a3dc4fd8e7f30517b804edcce93e7a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoClean up script imports
Simon Hausmann [Tue, 18 Mar 2014 17:21:18 +0000 (18:21 +0100)]
Clean up script imports

Move the .pragma and .import script extraction out of qqmlscript and
into qqmlirbuilder, where it can populate a QQmlIR::Document. Changed
the script part of the type loader to use that, which also allowed
eliminating the m_source member and m_metaData.

Change-Id: Icc64d219fff5666679a02e6afda73f7edfca132b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoClean, part 3
Simon Hausmann [Tue, 18 Mar 2014 07:46:33 +0000 (08:46 +0100)]
Clean, part 3

* Get rid of QQmlScript::Pragma
* Allow retrieving the QML unit size after generation
* Add flag equivalent of .pragma library to QV4::CompiledData
* Remove unused method

Change-Id: I2f95b83f919004013741bc539c82960cc878f3a4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoUse Q_ASSERT instead of assert
Lars Knoll [Tue, 18 Mar 2014 08:20:45 +0000 (09:20 +0100)]
Use Q_ASSERT instead of assert

Change-Id: I6185b59a7dfd6977ce82581ab4385e07d78f13f6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoEnable constant propagation for all types
Lars Knoll [Fri, 14 Mar 2014 09:17:27 +0000 (10:17 +0100)]
Enable constant propagation for all types

So far constant propagation was only enabled for
numbers and booleans. Enable it for all types now
and make sure the propagation does the right thing.

Change-Id: I202b0073f463d8a42e34931a736544207284b6dc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFixes to for...in statement
Lars Knoll [Tue, 18 Mar 2014 08:12:42 +0000 (09:12 +0100)]
Fixes to for...in statement

Properly convert the argument to an object if
it's not null or undefined as mandated by the
standard.

Add a similar test case for the with statement.

Change-Id: Idd8e245e8dae4803eb0e2010e3d43bb912670444
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoOptimize construction of SimpleArrayData
Lars Knoll [Tue, 18 Mar 2014 07:28:25 +0000 (08:28 +0100)]
Optimize construction of SimpleArrayData

Change-Id: I7f8a0ac8a368af23534378e8c31d820b3b9f1f4c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDynamic GL in Quick
Laszlo Agocs [Mon, 3 Feb 2014 16:36:55 +0000 (17:36 +0100)]
Dynamic GL in Quick

The counterpart to I716fdebb. Implements the dynamic path
in scenegraph.

Task-number: QTBUG-36483
Change-Id: I2dc613ba84560b7b8e36d3cd1da61c050ab08db0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
10 years agoAdd surface format to QQuickWidget.
Laszlo Agocs [Mon, 17 Mar 2014 14:30:49 +0000 (15:30 +0100)]
Add surface format to QQuickWidget.

Change-Id: Id72a042588e37832a0d3757bad935c531ef8275a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
10 years agoRelease the mouse grab from PinchArea when it's not needed anymore
Ulf Hermann [Wed, 5 Mar 2014 15:30:37 +0000 (16:30 +0100)]
Release the mouse grab from PinchArea when it's not needed anymore

If we keep the mouse grabbed no other items will receive mouse events
until the next click.

Task-number: QTBUG-37485
Change-Id: Id3936fbe09b262ddbefc68334ef8fe7e161fbcd4
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
10 years agoDoc: Fix broken \qmlsignal links
Sze Howe Koh [Sun, 16 Mar 2014 04:20:26 +0000 (12:20 +0800)]
Doc: Fix broken \qmlsignal links

Fix the breaks caused by the re-categorizing of \qmlsignal pages

Task-number: QTBUG-35846
Change-Id: I528ae16ec522fc902133e22d8f53c87a7f0d56ad
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoDoc: Document signals (not handlers) under \qmlsignal
Sze Howe Koh [Fri, 14 Mar 2014 15:41:01 +0000 (23:41 +0800)]
Doc: Document signals (not handlers) under \qmlsignal

Append the handler names to the end of the corresponding signal doc.

Task-number: QTBUG-35846
Change-Id: I3d627ba7ed5be94e5c402ab092b4d582536499e8
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoSave painting events in Qt5 style with thread ID from qmlprofiler
Ulf Hermann [Mon, 17 Mar 2014 13:52:01 +0000 (14:52 +0100)]
Save painting events in Qt5 style with thread ID from qmlprofiler

This is necessary to support https://codereview.qt-project.org/80391
and to make the trace files consistent with Qt Creator's.

Change-Id: I45490c33ae9bd8fbbb6bace08bdc2f44c76bf966
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoRegister animation profiler callback also from render thread
Ulf Hermann [Fri, 7 Mar 2014 15:20:23 +0000 (16:20 +0100)]
Register animation profiler callback also from render thread

The QUnifiedTimer in the GUI thread doesn't cover the render thread
animations. We need a separate registration for those. We also need
to keep track of which animation events are coming from which
threads.

Task-number: QTCREATORBUG-11659
Change-Id: I1fdd80a5630cc6a33e527b99be7347f3bd63510f
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoDoc: Reintroduce missing sample XML file for XMLRole documentation
Topi Reinio [Mon, 17 Mar 2014 08:37:31 +0000 (09:37 +0100)]
Doc: Reintroduce missing sample XML file for XMLRole documentation

XMLRole documentation talks about sample XML content, but
erraenously quoted a QML file instead.

This change brings back the sample file from Qt 4.8, and
updates it to cover the use of boolean role.

Change-Id: Id71550fab15c761320551f6583a138cd7cc88376
Reviewed-by: Bea Lam <bea.lam@jollamobile.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoPinchArea: zooming requires pinch distance to exceed the threshold
Shawn Rutledge [Wed, 12 Mar 2014 15:54:24 +0000 (16:54 +0100)]
PinchArea: zooming requires pinch distance to exceed the threshold

If you use a PinchArea and a Flickable together on OSX, you will be
able to use two fingers on the trackpad to flick the Flickable because
the OS will send scroll events which Qt turns into QWheelEvents; and
at the same time you will have two touch points, which the PinchArea
will grab and use.  That's nice, but it means we need to be more
selective about gesture recognition, so that when you mean to flick
you can do it without simultaneously pinch-zooming.
Therefore, iff pinch.dragAxis is Pinch.NoDrag, the startDragDistance
(threshold) is treated as a pinch distance threshold rather than
allowing any direction of movement to begin the pinch gesture.

[Changelog][QtQuick][PinchArea] do not begin zooming until the
change in distance between two touch points exceeds startDragDistance

Task-number: QTBUG-37294
Change-Id: I01026364970428aae9a4c5436517db719387f8e8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
10 years agoFolderListModel: pessimize change signals when the filter changes
Shawn Rutledge [Tue, 4 Mar 2014 15:05:50 +0000 (16:05 +0100)]
FolderListModel: pessimize change signals when the filter changes

FileInfoThread doesn't have separate signals for insertions, deletions
and updates, so QQuickFolderListModel shouldn't make an assumption
that if the list got bigger, an insertion was the only thing that
happened.

Task-number: QTBUG-36576
Change-Id: Ibb02d64e1645dd6df231d28a93e424aaad0effff
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoSmall optimization to RegExp
Lars Knoll [Mon, 17 Mar 2014 11:45:41 +0000 (12:45 +0100)]
Small optimization to RegExp

Also add markObjects() calls to all the identifiers we keep
around in the engine. It's probably pure luck this hasn't caused
any issues until now.

Change-Id: Ie31d19793efa53867e4e240ba548070dcde32ec1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAdd some specialized lookups for two internal classes
Lars Knoll [Thu, 13 Mar 2014 20:28:30 +0000 (21:28 +0100)]
Add some specialized lookups for two internal classes

Some methods are being called with two different types of objects,
alternating between them. This adds a specialized lookup for that
case. Speeds up the splay test by ~20%.

Also create a clean path to a fallback lookup instead of going back
to the generic lookup and then alternating.

Change-Id: I3082d70d27155ef5f2cf2b680d227c6dd389956d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMinor optimization: Avoid some QString constructors
Lars Knoll [Fri, 14 Mar 2014 09:15:56 +0000 (10:15 +0100)]
Minor optimization: Avoid some QString constructors

Change-Id: I51af67e9ba4076216142e05b5de5b2e8f8c526bc
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoItem views: improve initial Z-value handling
J-P Nurmi [Mon, 10 Mar 2014 14:58:10 +0000 (15:58 +0100)]
Item views: improve initial Z-value handling

Respect the initial Z-values of item, highlight, header, footer and
section delegate instances. Mention also the default values in docs.

Change-Id: I2ce4bb537898a0f5fdfa776b79d5747b1c080a7b
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
10 years agoCleanup, part 2
Simon Hausmann [Mon, 17 Mar 2014 20:26:04 +0000 (21:26 +0100)]
Cleanup, part 2

* QQmlCodeGenerator -> QQmlIR::IRBuilder (it doesn't generate code, it
generates the Object/Property/Signal/etc. IR of the .qml file, that's
going to get transformed to QV4::CompiledData::*)

* ParsedQML -> QQmlIR::Document

Change-Id: I329e858487b66e1ae528d44316761f5dd34b79f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoUse QUrl::toLocalFile() when decoding a string URL
Andrew Knight [Mon, 17 Mar 2014 22:08:49 +0000 (00:08 +0200)]
Use QUrl::toLocalFile() when decoding a string URL

Some percent-decoded characters may still be present in the string URL,
so it is best to use QUrl::toLocalFile() to process the string properly.
This also makes some drive handling "magic" obselete as QUrl already
handles this.

This fixes an issue whereby QML apps residing in local paths requiring
percent-encoded characters (or which import local file URLs with
percent-encoded characters) would fail to load, as the path was passed
to the file system engine without fully decoding the URL.

Change-Id: I8ec2b06f0661e0ac7cc9df79d35ec5cee211f672
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoNamespace cleanup
Simon Hausmann [Mon, 17 Mar 2014 16:11:20 +0000 (17:11 +0100)]
Namespace cleanup

Move the QML IR types into the QmlIR namespace and clean them up.

Change-Id: I2125449e5a519034e23670651efa620f405730b4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoStabilize tst_qquickwindow and tst_scenegraph.
Gunnar Sletta [Mon, 17 Mar 2014 14:54:44 +0000 (15:54 +0100)]
Stabilize tst_qquickwindow and tst_scenegraph.

Change-Id: I6f1b6c0ed86869149658e3ce07545217ce9797a7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix crash with lazy binding initialization and compile time calculated dependencies
Simon Hausmann [Mon, 17 Mar 2014 13:42:05 +0000 (14:42 +0100)]
Fix crash with lazy binding initialization and compile time calculated dependencies

During lazy binding initialization we may execute bindings where we calculated
dependencies to the context object at compile time. In order to register those
dependencies, the contet object needs to be set in the QQmlContextData.

This patch makes sure to set it before setting up the bindings.

Change-Id: Iacd360140cd9c389487bda82f6a7e6cc3a44c154
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix potential crash during shutdown for QQuickWindows
Gunnar Sletta [Fri, 14 Mar 2014 14:15:26 +0000 (15:15 +0100)]
Fix potential crash during shutdown for QQuickWindows

The cleanup() function would deregister the render loop from all
windows the render loop had seen, but the render loop doesn't see
windows until the window gets a showEvent and for some implementations
it was removed as a result of hideEvent. So add explicit tracking to
QSGRenderLoop which is managed by QQuickWindow's constructor and
destructor. With this, we no longer need the lists from the
subclasses, so these functions are removed again.

Change-Id: I05e5507ad57e23c80bacd99752654cc7d0890dc1
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
10 years agoFix AnimatedSprite interpolation when looping and/or reversing.
Michael Brasser [Tue, 21 Jan 2014 15:19:50 +0000 (09:19 -0600)]
Fix AnimatedSprite interpolation when looping and/or reversing.

Ensure we interpolate in the correct direction, and that interpolation
occurs between loops.

Task-number: QTBUG-36339
Task-number: QTBUG-36340
Change-Id: Iccb097e6a9af9fa6697e2ba9ee852be9eb516edc
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>