platform/upstream/qtdeclarative.git
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 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 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 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 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 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 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 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 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 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 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 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 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>
10 years agoFix small bug in array sorting
Lars Knoll [Mon, 18 Nov 2013 14:58:30 +0000 (15:58 +0100)]
Fix small bug in array sorting

Task-number: QTBUG-34321

Change-Id: I33089499f730bce16a9dfdda04cc8402602bc5fa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMake comparison of singletons and qobjects work
Albert Astals Cid [Wed, 13 Nov 2013 12:31:46 +0000 (13:31 +0100)]
Make comparison of singletons and qobjects work

Otherwise you can end up with some weird situation in which you have
two objects, you print them and then you print the comparison and get
a Foo(0x858480) b Foo(0x858480) a == b false

Task-number: QTBUG-34651

Change-Id: Id2444d919f039be085eb5ed9112345db691540a5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDoc: Fixed list of animation types.
Jerome Pasion [Mon, 18 Nov 2013 12:21:29 +0000 (13:21 +0100)]
Doc: Fixed list of animation types.

-manually created list duplicates the generated list.
-\generatelist{related} doesn't do anything for a regular \page.

Task-number: QTBUG-33360
Change-Id: I0bf870c71d3985e232fa8c0d5ef7ad572f596e99
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake use of GL_APPLE_texture_format_BGRA8888.
Gunnar Sletta [Thu, 14 Nov 2013 10:43:02 +0000 (11:43 +0100)]
Make use of GL_APPLE_texture_format_BGRA8888.

Texture uploads on iOS is extremly slow without it.

Change-Id: Icccd542b8122c7bfa0e839c25e988d107bc17d2a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
10 years agoFix interaction between head room and appending in arrays
Lars Knoll [Mon, 18 Nov 2013 12:54:33 +0000 (13:54 +0100)]
Fix interaction between head room and appending in arrays

We reserve space on both ends of the JS array for appending
and prepending. Make sure they interact well with each other
and don't cause any memory corruption.

Task-number: QTBUG-34853
Change-Id: I184280178690e3cb12ab9b199a8436b32383af38
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDon't assert in QQuickItem::update
Lars Knoll [Mon, 18 Nov 2013 13:23:36 +0000 (14:23 +0100)]
Don't assert in QQuickItem::update

The method can actually be called from QML, so we can not
have an assert in that method. Instead simply return if the
item has no contents

Task-number: QTBUG-34060
Change-Id: Ib28ffa5c6c63fbec956abe25020010ed73a9cfa9
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoLimit the amount of memory we allocate on the stack
Lars Knoll [Mon, 11 Nov 2013 10:22:24 +0000 (11:22 +0100)]
Limit the amount of memory we allocate on the stack

Setup limits for both the C and the JS stack, and check
them before entering functions. If we run out of space,
throw a RangeError exception.

Be careful and recheck the stack bounds when things go
outside. This catches the case where the engine got
moved to another thread changing the stack boundaries.

Windows currently uses an unsafe fallback implementation,
this needs to be fixed later on.

Task-number: QTBUG-34568

Change-Id: I22fbcbec57b28f9cc8a49e12f1cc6e53e4f07888
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoDon't call receivers from disconnectNotify
Alan Alpert [Sat, 16 Nov 2013 20:45:15 +0000 (12:45 -0800)]
Don't call receivers from disconnectNotify

A pending documentation update is going to explain that you can't call
into QObject functions from disconnectNotify, or it may deadlock
on the signalSlot mutex.

Task-number: QTBUG-34829
Change-Id: I57e7b4e457d813d4255c8cdbe36228b2e0f45aaa
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove '-enable-debugger' argument from qml executable
Kai Koehne [Thu, 14 Nov 2013 11:38:25 +0000 (12:38 +0100)]
Remove '-enable-debugger' argument from qml executable

Task-number: QTBUG-34836
Change-Id: I3ab2a16036a1086c0ac1f50880a402caf9f54f2d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoFix lockup in creator.
Gunnar Sletta [Fri, 15 Nov 2013 14:28:33 +0000 (15:28 +0100)]
Fix lockup in creator.

My previous fix to force expose when the render thread is inactive
was not enough. We now lock down access to 'QSGRenderThread::window'
so that it will always be set when the thread is in the "exposed"
state and 0 when the thread is in the "obscured" state.

This introduces another sync point in handleObscurity to protect
the writing of window in the render thread.

Task-number: QTCREATORBUG-10793
Change-Id: I1e1153189b3a3562705892b42625f88ef6329188
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
10 years agoDo not crash when one of group animation's children is null
Jacek Całusiński [Thu, 14 Nov 2013 16:53:58 +0000 (17:53 +0100)]
Do not crash when one of group animation's children is null

Check if pointer to QQuickAbstractAnimation for which we are setting
group is valid.

Task-number: QTBUG-34851
Change-Id: Iecb549f080804fd9489f884911fa51892def05a5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove version definition from custom particle shaders for OpenGL ES.
Maciej Kujalowicz [Thu, 14 Nov 2013 21:45:18 +0000 (22:45 +0100)]
Remove version definition from custom particle shaders for OpenGL ES.

Since OpenGL ES 2.0 does not support GLSL 1.2, #version 120 must
be removed from embedded shaders for a custom particle.

Task-number: QTBUG-34854
Change-Id: I8d3e51ff87acc099a53c4e312cd33d02e6a1cb4e
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
10 years agoDeprecate logicalPixelDensity
Alan Alpert [Tue, 12 Nov 2013 10:12:04 +0000 (02:12 -0800)]
Deprecate logicalPixelDensity

It's just not working out in practice, and we don't want to confuse
users with having to pick their flavor of pixel density.

Task-number: QTBUG-34798
Change-Id: I552e479515a6f5249685844143601cb7449ccccc
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
10 years agoexamples/quick/window example: fullscreen is possible on OSX
Shawn Rutledge [Fri, 15 Nov 2013 14:17:57 +0000 (15:17 +0100)]
examples/quick/window example: fullscreen is possible on OSX

It's normally disallowed without the WindowFullscreenButtonHint.
But if we're going to declare a value for flags, then we have to
put back the Window type which would otherwise be there by default.

Task-number: QTBUG-33607
Change-Id: Ibbd593b2648b98d37c7f70a0b9f96787b0a40f22
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
10 years agoFix === operator for value types
Lars Knoll [Tue, 12 Nov 2013 08:50:29 +0000 (09:50 +0100)]
Fix === operator for value types

Fix === comparison for urls and other QML value types.

Task-number: QTBUG-33546

Change-Id: I4a7066e6bbc7de7c599fe2c7b2fdfb75e0ff5196
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDoc: Fixed QtQuick.Window documentation
Jerome Pasion [Thu, 14 Nov 2013 16:27:38 +0000 (17:27 +0100)]
Doc: Fixed QtQuick.Window documentation

-fixed import statement in \qmlmodule and \inqmlmodule command.
-Removed extra identifier in property documentation.

Task-number: QTBUG-33360
Change-Id: I1e7ca5f418c327d42247ab4f4a11733c63d8c273
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix stacking order bug in the renderer
Gunnar Sletta [Fri, 15 Nov 2013 06:23:04 +0000 (07:23 +0100)]
Fix stacking order bug in the renderer

Since we are sorting batches based on the zorder of the first element
it is crucial that we don't continue adding to batches once an overlap
with a compatible element is found.

Task-number: QTBUG-34864
Change-Id: Ic2194c5c17bba0bc9874a14e8a69c81bff75bd1c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
10 years agoDon't crash when trying to assign to null.prop
Lars Knoll [Tue, 12 Nov 2013 10:01:06 +0000 (11:01 +0100)]
Don't crash when trying to assign to null.prop

Fixes a regression introduced during the exception handling
refactoring.

Task-number: QTBUG-34544

Change-Id: Ib751274d759030db3e5d3b1380b30dc07ec85f83
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMake tst_qqmlprofilerservice more robust
Kai Koehne [Fri, 15 Nov 2013 12:02:13 +0000 (13:02 +0100)]
Make tst_qqmlprofilerservice more robust

Don't expect only application output to be printed. E.g. a stray
qDebug somewhere in Qt could break this test so far ...

Change-Id: Ibdc31fba3bd8d822c264bd44515d16e648db9a8e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDon't dereference a null animationTemplate
Lars Knoll [Wed, 13 Nov 2013 07:32:12 +0000 (08:32 +0100)]
Don't dereference a null animationTemplate

If the SpringAnimation gets used inside a Transition, the
animationTemplate might get cleared, but updateCurrentTime()
still gets called on the SpringAnimation after that.

Task-number: QTBUG-34539
Change-Id: I1f27fdbfc594e6ff9a4343e45f7f4001964bb012
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
10 years agoAvoid deadlock in Qt Creator
Gunnar Sletta [Thu, 14 Nov 2013 14:41:29 +0000 (15:41 +0100)]
Avoid deadlock in Qt Creator

Task-number: QTCREATORBUG-10699
Change-Id: Ia88df5ec4ea74fda6a0449aa739a9c6976fedb02
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
10 years agoImprove internal debug statements.
Gunnar Sletta [Thu, 14 Nov 2013 14:01:36 +0000 (15:01 +0100)]
Improve internal debug statements.

Now that we have one thread per window it is useful to know which
thread and window prints out the messages.

Change-Id: I699eae180575fd3355551ebe0bfe6fd6ac8837c9
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
10 years agoV4 debugging: fix step-over and step-out.
Erik Verbruggen [Thu, 14 Nov 2013 13:16:50 +0000 (14:16 +0100)]
V4 debugging: fix step-over and step-out.

- step-out: only stop if we’re leaving the context for the function we
  previously stopped at, so intermediate calls between the current
  position and the end do not stop the engine
- step-over: set breakpoints on all lines in current function and
  continue to run. When hitting a breakpoint, see if we are in the same
  context, because recursive calls might happen. Breakpoints on all
  lines are needed, because the (pure) next line might be jumped over
  (like when doing step-over a single-line then clause, where the next
  line might be in the else clause).

Change-Id: Idf35dc740ca64fae5079162162906490a96af2a7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
10 years agoV4 debugging: Fix instable test.
Erik Verbruggen [Thu, 14 Nov 2013 11:04:59 +0000 (12:04 +0100)]
V4 debugging: Fix instable test.

Request the scripts after hitting a breakpoint. The reason this test
could fail before, is that the engine might be calling into the debugger
even before any script was loaded.

Change-Id: Iba49f445ab97afaf2bb168b04063432ca2f9dddd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoAllow passing qmlRegisterSingletonType QObjects to C++ as QObject*
Albert Astals Cid [Wed, 13 Nov 2013 10:03:52 +0000 (11:03 +0100)]
Allow passing qmlRegisterSingletonType QObjects to C++ as QObject*

At the moment you can pass them as their FinalType* or
as one of their ParentType* but not as QObject* which
does not make much sense to me

Task-number: QTBUG-34617
Task-number: QTBUG-30730

Change-Id: Id5cfb7bbb123456ef43f44f33b450f8966a7641a
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAdapt Qt Quick 2 renderer to work with OpenGL Core Profile
Sean Harmer [Wed, 6 Nov 2013 13:07:58 +0000 (13:07 +0000)]
Adapt Qt Quick 2 renderer to work with OpenGL Core Profile

The basic approach is to have the batched renderer create and bind a
vertex array object if it detects we are using an OpenGL Core profile
context. The VAO is bound for the duration of the QQ2 renderer's
work cycle and unbound at the end so as to not interfere with any
other VAO's a user may wish to use.

All shaders have been copied and ported to be compliant with the
GLSL 150 core specification which is the minimum for a Core profile
context (OpenGL 3.2 Core). We are not using any newer features as
yet so this will work anywhere we can get a Core profile context.

The QSGShaderSourceBuilder class has been extended to resolve any
requests for shaders to the same basefilename with "_core"
appended prior to any file extension. This could be extended in
the future to allow version, or GPU or platform specific shaders.

The QSGShaderSourceBuilder has also been extended to allow it to
insert #define definitions in the prologue of a shader. Any such
definition is inserted:

* After the last #extension directive (if any are found)
* Otherwise after the #version directive (if found)
* Otherwise at the start of the shader source

This is required by the custom particle shaders which make
extensive use of such #defines.

In addition the mechanism used by the distance field glyph cache to
extend the cache with new glyphs has been modified to work (and
work more efficiently) when using a Core profile context.

Rather than using a shader program and a buffer filling quad to
blit the old texture into the new cache texture, we instead use
the technique of framebuffer blitting. The existing fallback
implementation using glTexSubImage2D() is still available if
needed.

The DECLARATIVE_EXAMPLE_MAIN macro has been extended to allow easy
testing of any of the QtDeclarative examples with a core profile
context. Just run the example with

QT_QUICK_CORE_PROFILE=1 ./text

for e.g. The only ones that may not work out of the box are those
that provide GLSL shader source e.g. the customparticles or
shader effect examples. These work fine if the shader source is
adapted to GLSL 150 core.

In the future it may be a good idea to expose some context property
to QML that the user can use to determine what shader source
variation to provide to Qt Quick. Along these lines it would also
be very nice to allow the provision of shader source to
ShaderEffect or CustomParticle from a separate source file just as
we now do within Qt Quick.

Task-number: QTBUG-32050
Change-Id: Ia6e9f06dbb8508af9ae03c6b60fb418b4cc9e41f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDoc: Adding FontDialog type to group "dialogs".
Jerome Pasion [Tue, 12 Nov 2013 10:58:23 +0000 (11:58 +0100)]
Doc: Adding FontDialog type to group "dialogs".

-needed for FontDialog to show up in the landing page.

Task-number: QTBUG-33360
Change-Id: Ic3ea5722e963045704e81a673ebd85770c0253a3
Reviewed-by: Matti Paaso <matti.paaso@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake tst_nodes use QSGRenderLoop to behave more like QQuickWindow
Gunnar Sletta [Tue, 12 Nov 2013 12:49:51 +0000 (13:49 +0100)]
Make tst_nodes use QSGRenderLoop to behave more like QQuickWindow

Change-Id: I284164a45cabdb9f1fdbc2050db0cb00810ce946
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
10 years agoFix native compilation on linux/arm with gcc 4.7.2
Erik Verbruggen [Tue, 12 Nov 2013 15:30:14 +0000 (16:30 +0100)]
Fix native compilation on linux/arm with gcc 4.7.2

/disk/qt5-dev/qtdeclarative/src/qml/jsruntime/qv4function.cpp: In instantiation of ‘int QV4::LineNumberMappingHelper<field, SearchType>::lowerBound(int, int, SearchType) [with int field = 0; SearchType = int]’:
/disk/qt5-dev/qtdeclarative/src/qml/jsruntime/qv4function.cpp:142:49:   required from here
/disk/qt5-dev/qtdeclarative/src/qml/jsruntime/qv4function.cpp:106:13: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
cc1plus: all warnings being treated as errors

Change-Id: Ic97d6a2a9acd392d565e9c66f30159552473e092
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRevert ffaf39e9a7f11d4e2800b3b37160a2a952795614
Alan Alpert [Tue, 12 Nov 2013 09:56:35 +0000 (01:56 -0800)]
Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614

Making it public right now seems a little premature, given all the work
happening on the engine now (and for 5.3). We'll be in a better position
to commit to it or not next release.

Change-Id: Ib7b14afeb9205fb8a87ed16a6d38b1f468b2bbbb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoPolish up QQmlFileSelector
Alan Alpert [Tue, 12 Nov 2013 08:11:43 +0000 (00:11 -0800)]
Polish up QQmlFileSelector

Incorporate beta feedback, and hide QQmlAbstractUrlInterceptor as the
implementation (instead of making that "the API").

Change-Id: Ib7b14afeb9205fb8a87ed16a6d38b1f468b2aaaa
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix warnings about deprecated string conversions in V4-debugservice.
Friedemann Kleint [Wed, 13 Nov 2013 07:51:37 +0000 (08:51 +0100)]
Fix warnings about deprecated string conversions in V4-debugservice.

Change-Id: I1b45876d2016fdcf1117c4f77b33c75f7d712657
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix boundingbox calculation of rotated items.
Gunnar Sletta [Tue, 12 Nov 2013 11:13:11 +0000 (12:13 +0100)]
Fix boundingbox calculation of rotated items.

Task-number: QTBUG-34328

Change-Id: If0202a67d95500333a0fb6f4ca3eb19ecb027770
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix property dependency generation for accelerated QML QObject properties
Simon Hausmann [Sat, 2 Nov 2013 19:35:33 +0000 (20:35 +0100)]
Fix property dependency generation for accelerated QML QObject properties

The previous approach of collecting the dependencies through an IR visitor
doesn't work, because it relies on a fixed structure - for example MEMBER(NAME,
prop) - which we can't guarantee (it's usually MEMBER(TEMP, prop)). But it
turns out that we can only pre-calculate dependencies for context, scope or id
properties, so we can do that right away in the QML specific JS codegen, store
that information in the IR function and use it from there in the data structure
generator as well as in the isel as a parameter to getQObjectProperty to tell
the run-time whether capture is required or not.

Change-Id: I33711c3420d6534c653c2a6a4284f0fc12e941cf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix out of bounds array index in the generated JIT code
Lars Knoll [Mon, 11 Nov 2013 14:08:41 +0000 (15:08 +0100)]
Fix out of bounds array index in the generated JIT code

When converting a double to int, make sure we check for >= 0
before using it, otherwise we get out of bounds accesses.

Task-number: QTBUG-34635
Change-Id: If72e116c08fe1dff03cd88ce510cf8b96d249b92
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
10 years agoV4 IR: change basic-block cleanup to remove unreachable cycles too.
Erik Verbruggen [Tue, 12 Nov 2013 13:55:14 +0000 (14:55 +0100)]
V4 IR: change basic-block cleanup to remove unreachable cycles too.

The previous version left unreachable cycles untouched. For example in:

function f() {
  if (false)
    while (true) { doSomething(); }
  anotherThing();
}

The edge to the then-part would be removed, but the loop itself would
not be removed. This resulted in the basic-block scheduler choking when
hitting the block with the anotherThing() call, because it wants to have
all blocks from incoming edges resolved first.

Task-number: QTBUG-34776
Change-Id: I5b3a79140e6058c4ade4ec7687c1a795f1a74f97
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
10 years agoUpdate .qmltypes files for 5.2
Alan Alpert [Mon, 11 Nov 2013 08:35:08 +0000 (00:35 -0800)]
Update .qmltypes files for 5.2

Task-number: QTBUG-34601
Change-Id: Icf5bdc2ea66b9a13186de957d5ae9c8701b481c7
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoQtQuick.Dialogs: hide internal functions and properties
Shawn Rutledge [Tue, 12 Nov 2013 07:57:35 +0000 (08:57 +0100)]
QtQuick.Dialogs: hide internal functions and properties

with double-underscores

Change-Id: If397bfaf50e0878516296eb4237bcf012eb8dae4
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
10 years agoFix Object::getArrayHeadRoom()
Lars Knoll [Tue, 12 Nov 2013 11:17:14 +0000 (12:17 +0100)]
Fix Object::getArrayHeadRoom()

The method didn't adjust the size of the allocated array
properly, leading to crashes when being called repeatedly.

Task-number: QTBUG-34723
Change-Id: Ib58e7dcab6d0f5f46f3cf342eb541c1cc6b6cdc6
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
10 years agoFix Canvas2d.createConicalGradient
Lars Knoll [Tue, 12 Nov 2013 12:41:53 +0000 (13:41 +0100)]
Fix Canvas2d.createConicalGradient

The method requires 3 arguments, not 6

Task-number: QTBUG-34718
Change-Id: Ib6c117ba18844acecea3707720c0c88449b50fb6
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoRemove unused _info on non-debug builds
Shawn Rutledge [Tue, 12 Nov 2013 12:35:21 +0000 (13:35 +0100)]
Remove unused _info on non-debug builds

Otherwise clang generates a warning which is fatal because of
treating warnings as errors.

Change-Id: I47c280edf6b0f8efa5ce24f9e92551304aed15fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoV4 JIT: fix invalid sanity assert.
Erik Verbruggen [Tue, 12 Nov 2013 10:29:17 +0000 (11:29 +0100)]
V4 JIT: fix invalid sanity assert.

If there are multiple incoming edges to a block, and there are one or
more phi nodes at the start, then only check the temp uses for the edge
we are resolving.

Task-number: QTBUG-34770

Change-Id: Ibb5c7c323d6be8bc1ed492b08ed098de2f2726cc
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
10 years agoV4 IR: scan arguments when entering function scope in QML.
Erik Verbruggen [Mon, 11 Nov 2013 15:13:00 +0000 (16:13 +0100)]
V4 IR: scan arguments when entering function scope in QML.

When doing IR generation for a function declaration in a QML object,
call through the helper methods to check for forbidden names, and most
importantly, also checks if the function has parameters. If the latter
is the case, they need to be added as a member for the current scope
in order to get IR generation correct.

Task-number: QTBUG-34493

Change-Id: I0ade15ee19e1b1ac8ee2f2d3fa186d1551800199
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4: fix loop block marking for initializer blocks.
Erik Verbruggen [Mon, 11 Nov 2013 13:23:50 +0000 (14:23 +0100)]
V4: fix loop block marking for initializer blocks.

Any new blocks generated as part of the initializer were incorrectly
marked as belonging to a loop. For example, if a LocalForStatement
would contain a ternary expression, the generated then and else blocks
would be marked. This would confuse the block scheduling, because all
blocks are postponed unil the condition block (“group start”) is
scheduled.

Task-number: QTBUG-33754

Change-Id: I45919ebeac356f015bb91fe0210472b3df0b56d8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 interpreter: remove stack-slot allocator.
Erik Verbruggen [Mon, 11 Nov 2013 12:21:07 +0000 (13:21 +0100)]
V4 interpreter: remove stack-slot allocator.

The life-ranges are only valid when the IR is in SSA form. So the use
of them in the interpreter after converting out of SSA form introduced
bugs. Instead, allocate a stack-slot for each unique temporary, and
re-use the code for this from the JIT.

Change-Id: I294f1116064f0b85996cf96a0b408b41a3c785e2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoImprove qmlimportscanner.
Morten Johan Sørvig [Fri, 18 Oct 2013 09:11:28 +0000 (11:11 +0200)]
Improve qmlimportscanner.

Fix several qmlimportscanner defects:

- Expand qml file search to include subdirectories.
This applies to search paths specified with "-rootPath"

- Add "-qmlFiles" for specifying the file list directly

- Parse files with UTF8 BOMs correctly

- Don't set properties where the value is the empty string

Change-Id: I81a538d73487b49fb635c18ef4fe479748ba0bfc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
10 years agoAdd a verbose mode to qml
Alan Alpert [Wed, 23 Oct 2013 22:37:16 +0000 (15:37 -0700)]
Add a verbose mode to qml

The extra output is primarily useful for debugging, and on windows it
will actually make an ugly command prompt window appear.

Change-Id: I552e479515a6f5249685844143601cb7449a10b5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
10 years agoIntercept qmldir files with the url interceptor
Alan Alpert [Thu, 18 Jul 2013 13:02:37 +0000 (06:02 -0700)]
Intercept qmldir files with the url interceptor

There's another code path which loads qmldir files directly, and it did
not use the interceptor when available.

Note that this, like other interceptors, does not affect baseUrl and so
any other qmldir file still must have paths relative from the initial URL.

Change-Id: I620943c36d488d22fbaf1793514075d31ab76e3e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoImplement missing compare() function for Raised/Sunken text
Gunnar Sletta [Mon, 11 Nov 2013 07:30:43 +0000 (08:30 +0100)]
Implement missing compare() function for Raised/Sunken text

Task-number: QTBUG-34715

Change-Id: Ifdac2511b7f642b1ea4bd06847c840b5a951a753
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
10 years agoAnimate when only one out of several windows is exposed.
Gunnar Sletta [Fri, 8 Nov 2013 06:34:55 +0000 (07:34 +0100)]
Animate when only one out of several windows is exposed.

Change-Id: I7f76ed722f91076ee308a47c699984d371a220f0
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
11 years agoDebugging with V4
Erik Verbruggen [Wed, 16 Oct 2013 10:29:47 +0000 (12:29 +0200)]
Debugging with V4

Currently missing, but coming in subsequent patches:
- evaluating expressions
- evaluating breakpoint conditions

Change-Id: Ib43f2a3aaa252741ea7ce857a274480feb8741aa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
11 years agomoveOffset in QQuickPathView::modelUpdated uninitialized
Marco Bubke [Wed, 6 Nov 2013 12:00:12 +0000 (13:00 +0100)]
moveOffset in QQuickPathView::modelUpdated uninitialized

Get a error for compiling with gcc 2.8.1.

Change-Id: If93ed69695fb523eff05cae2960e3743dc496310
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
11 years agoFix assert with native text rendering.
Gunnar Sletta [Wed, 6 Nov 2013 11:08:42 +0000 (12:08 +0100)]
Fix assert with native text rendering.

The renderer only passed the very first node's material to
updateState() as "new", yet pass the following node's materials to
updateState() as "old". This triggered an assert in the
QSGTextMaskMaterial's updateState as the native text nodes are invalid
until they get called with their own material as "new". This goes
against how the scene graph is supposed to be used, but update the
code in the renderer regardless as this used to work and the fix
there is not wrong.

Every node in a batch has identical material, so pass the same
instance for both "new" and "old" except for the first node
in the batch which gets old==0.

Change-Id: Ie8ae6fcd63adde08d80e9083e910836ede6694ee
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
11 years agoAvoid using huge floating point values in the renderer.
Gunnar Sletta [Wed, 6 Nov 2013 09:06:27 +0000 (10:06 +0100)]
Avoid using huge floating point values in the renderer.

We pretransform vertices relative to their batch root and upload these
using single-precision floats. If the offsets are huge then the
floating point numbers start to get unstable and we get rendering
artifacts as a result. This typically happens for lists/tables with
huge models.

Task-number: QTBUG-34312
Change-Id: I2516f2b4fa93f44a1288659d05458fb1af0df943
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
11 years agoAdd a new variant of qmlRegisterSingletonType for QML singletons.
Antti Piira [Mon, 28 Oct 2013 23:17:36 +0000 (16:17 -0700)]
Add a new variant of qmlRegisterSingletonType for QML singletons.

Adds a new public API to register a QML based singleton type from
C++. This is the equivalent of the the qmlRegisterType, but for
singletons. qmldir file is not needed for types registered through
this function, but the type still needs to include the following
pragma statement among the import statements:

pragma Singleton

Change-Id: Icb35b665fe2a8605667fe8ac575347be2a60490c
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
11 years agoFallback to native font rendering for bitmap fonts.
Yoann Lopes [Wed, 30 Oct 2013 17:03:23 +0000 (18:03 +0100)]
Fallback to native font rendering for bitmap fonts.

Distance field rendering requires glyph outlines, which are not
available for bitmap fonts.

Task-number: QTBUG-32737
Change-Id: I64569e4e6b2285ca998b5f80ec31ab04cf1f3d09
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
11 years agoFor x86 builds, try to detect SSE2 availability early and bail out
Simon Hausmann [Fri, 8 Nov 2013 14:27:51 +0000 (15:27 +0100)]
For x86 builds, try to detect SSE2 availability early and bail out

...instead of potentially just crashing. This is for the rare case
of somebody trying to run a QML2 based application on a Pentium 3
from before 2001 or older.

Change-Id: Ia5606fe28ef5579654ec939c86830af70dbb84d7
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
11 years agoRemove stray warn_off in pri file
Lars Knoll [Sun, 3 Nov 2013 14:26:34 +0000 (15:26 +0100)]
Remove stray warn_off in pri file

Change-Id: I9abf1180aecbd2e87fa7f52b51ad1c59665723fc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
11 years agoFix a few more compiler warnings in release builds
Lars Knoll [Sat, 2 Nov 2013 10:18:08 +0000 (11:18 +0100)]
Fix a few more compiler warnings in release builds

Change-Id: I826226b7ddd4a74037b5bbe9a4a7322d404f53a9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
11 years agoWorkaround for glyph upload bug with the Mali-400 GPU.
Yoann Lopes [Fri, 8 Nov 2013 14:55:15 +0000 (15:55 +0100)]
Workaround for glyph upload bug with the Mali-400 GPU.

Uploading unaligned and alpha-only data seems to be broken with that
GPU, uploading line by line does the trick.

Task-number: QTBUG-33951
Change-Id: I2790990ca1d3a3016ec3d9fefaea7002b92faeb7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>