platform/upstream/qtdeclarative.git
9 years agoBump version
Oswald Buddenhagen [Tue, 24 Feb 2015 15:22:42 +0000 (16:22 +0100)]
Bump version

Change-Id: I5b5e234edb901e7f38cdd21ac1148867b6f307f9

9 years agoOnly heap allocate binding bits storage if needed.
Aaron Kennedy [Thu, 29 Jan 2015 13:56:00 +0000 (14:56 +0100)]
Only heap allocate binding bits storage if needed.

For samegame, this has the following change on the total bytes allocated:

Startup (main page):
    Before: 1636
     After: 1072
Difference: 564 bytes (-34%)

Actual game (single player):
    Before: 14120
     After: 10432
Difference: 3688 bytes (-26%)

Done-with: Robin Burchell <robin.burchell@viroteck.net>
Change-Id: I29b7a79400090180f405693093f266c151260fcc
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoQQuickView/QQuickWidget: Improve diagnostics message for non-QQuickItem root fallback...
Robin Burchell [Sun, 8 Feb 2015 14:21:55 +0000 (15:21 +0100)]
QQuickView/QQuickWidget: Improve diagnostics message for non-QQuickItem root fallback case.

We don't want to recommend qmlscene, and QtQuick1 is being deprecated, so
there's no need to spell it out anymore either.

Change-Id: Ia4b87d1a4b3afdae9ea9c13a89ac5cb78c85f06d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoQQuickView/QQuickWidget: Improve diagnostics for using a QWindow as a base item in...
Robin Burchell [Mon, 2 Feb 2015 21:24:12 +0000 (22:24 +0100)]
QQuickView/QQuickWidget: Improve diagnostics for using a QWindow as a base item in a scene.

The current message is rather confusing, as it was aimed at users porting from
QtQuick 1 -- but it is perfectly possible to get a non-QQuickItem root in a
QQuickView scene right now with QtQuick 2 only.

Change-Id: Ibd800f8a817c874af5eaa1746567ee289988fd01
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoQQuickView/QQuickWidget: Report an error if rootObject ends up null.
Robin Burchell [Mon, 2 Feb 2015 21:17:41 +0000 (22:17 +0100)]
QQuickView/QQuickWidget: Report an error if rootObject ends up null.

This can happen when trying to use a non-QQuickItem item as the root item in a
QQuickView, for instance, a Window or ApplicationWindow item.

This generates a warning (correctly), but does not set an error state on the
view, so automated tooling and the like does not know that the scene was not
successfully loaded.

Change-Id: I1dc4191ef07187e9b1929995aedb01c155b0957c
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoAccount for leading when drawing text decoration
Eskil Abrahamsen Blomfeldt [Wed, 18 Feb 2015 09:35:00 +0000 (10:35 +0100)]
Account for leading when drawing text decoration

When the text line is offset by the leading distance, the
text decoration needs to be offset by the same value, otherwise
it will be drawn in the wrong location.

[ChangeLog][TextEdit] Fixed positioning of text decoration with some
fonts.

Change-Id: Ic15134326b878255a9b424c14762c3817dfd3123
Task-number: QTBUG-44492
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Andrew Knight <qt@panimo.net>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoCleanup math function includes and usage
Allan Sandfeld Jensen [Fri, 13 Feb 2015 11:02:19 +0000 (12:02 +0100)]
Cleanup math function includes and usage

Use std::math on floats and doubles, and qMath on qreals, and only
include the math headers actually needed.

Change-Id: I1d511d7b1bac0050eaa947c7baee760b736858bf
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
9 years agoAdd Qt.hsva() function
Sean Harmer [Sun, 15 Feb 2015 10:51:51 +0000 (10:51 +0000)]
Add Qt.hsva() function

This is more convenient than the alternative hsla() function in many
cases as color pickers in other applications default to the HSV color
space e.g. GIMP, kcolorchooser.

[ChangeLog][QtQml] Added Qt.hsva() function

Change-Id: Id5c1a78173757bf9842b164d90b31682e9a41749
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
9 years agoNamedNodeMap: Remove logically dead code
Holger Hans Peter Freyther [Sun, 8 Feb 2015 08:03:08 +0000 (09:03 +0100)]
NamedNodeMap: Remove logically dead code

The code has been changed by Lars in the git commit
47fbcb47771a36ab9fd0a4d5ede7b7504ab1410d. Now "r->engine()"
is called before the "if (!r)" check is being executed.

We can assume that "m->as<NamedNodeMap>()" will always
return a non nullptr and this allows us to remove the
extra null check.

Fixes CID: 86703

Change-Id: Ib4f1103e38c7e1e8e5175d91e795d2621e3a79c4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoFixed license headers
Jani Heikkinen [Fri, 13 Feb 2015 11:35:35 +0000 (13:35 +0200)]
Fixed license headers

Change-Id: I4d5640ff95e1361ec7e65fb3e87d7726d8185ff5
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
9 years agoFlickable: use wheel event pixel deltas when available
Shawn Rutledge [Tue, 27 Jan 2015 11:58:42 +0000 (12:58 +0100)]
Flickable: use wheel event pixel deltas when available

Flickable can now handle wheel events which come from touchpads,
providing pixel deltas instead of angle deltas.  It will interpret
them as distance to flick, rather than using an average-velocity
physics model as it does when handling events from a physical mouse
wheel. This enables much finer control and limits the tendency
to "zing" way out of bounds accidentally.  It is achieved by
refactoring the direct-drag code which is needed for mouse dragging
and for touchpad gesture dragging (and eventually touchscreen dragging)
into a new internal drag() method.

[ChangeLog][QtQuick][Flickable] Flickable handles pixel deltas from
trackpad gestures as drags, for a more native feel

Task-number: QTBUG-22407
Change-Id: Ia613ddb25f46d452603f7cb567b74e80c95a346c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoHigh-dpi SVG and QQuickImageProvider Images
Morten Johan Sørvig [Thu, 15 Jan 2015 12:38:40 +0000 (13:38 +0100)]
High-dpi SVG and QQuickImageProvider Images

Scale sourceSize by the target devicePixelRatio before
passing it to the providers.

Task-number: QTBUG-38127
Task-number: QTBUG-38991
Change-Id: I1746e0859b4e63eb0d28d1a1c8aac610b68a9eb9
Reviewed-by: Jocelyn Turcotte <jturcotte@woboq.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoPinchArea: handle smart zoom gesture
Shawn Rutledge [Tue, 9 Dec 2014 09:28:25 +0000 (10:28 +0100)]
PinchArea: handle smart zoom gesture

This is the double-finger double-tap trackpad gesture on OS X.

Change-Id: Ie79dc533adf382170867318bc9b61b367f819e9b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoFix 590 inconsistent override warnings [-Winconsistent-missing-override]
Sérgio Martins [Wed, 4 Feb 2015 23:10:21 +0000 (23:10 +0000)]
Fix 590 inconsistent override warnings [-Winconsistent-missing-override]

Classes should either use or not use override, otherwise it hurts
code readability.

Change-Id: Ieb899a3475b0c36ab20285740b2cec2cd1677a54
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoDoc: Bump QtQuick import version to 2.5
Shawn Rutledge [Thu, 12 Feb 2015 13:18:59 +0000 (14:18 +0100)]
Doc: Bump QtQuick import version to 2.5

Change-Id: I9b41d6c755f804aeb47564f10d7131df528ba61d
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
9 years agoUse TabFocusBehavior in QStyleHints in QtQuick
Liang Qi [Wed, 4 Feb 2015 09:10:12 +0000 (10:10 +0100)]
Use TabFocusBehavior in QStyleHints in QtQuick

* QQuickItemPrivate::qt_tab_all_widgets was removed.
* qt_tab_all_widgets in test was updated.

Change-Id: I418d7a3edae0a4782a91289f6c0494ff5874d071
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoQQuickText: Move baseUrl to ExtraData.
Robin Burchell [Sat, 7 Feb 2015 21:44:19 +0000 (22:44 +0100)]
QQuickText: Move baseUrl to ExtraData.

It's only used for external resource loading, which is not the common case.

Note that the case of an unset baseUrl may become a little more pessimised now,
as it has to be looked up from the context which involves a loop to find the
outermost parent context, but again, this is not a common case, so I'd consider
that acceptable.

QQuickTextPrivate now goes from 496 bytes to 488 bytes. ExtraData increases from
72 bytes to 80 on x86_64.

Change-Id: I7e346eeb3b3cefe81912aac2b115e106ec519d1e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQuickText: Decrease the size of QQuickTextPrivate by moving image tags to ExtraData.
Robin Burchell [Sat, 7 Feb 2015 20:19:15 +0000 (21:19 +0100)]
QQuickText: Decrease the size of QQuickTextPrivate by moving image tags to ExtraData.

Given that other data about images is already stored there (e.g.
nbActiveDownloads), it seems curious to not store it all there.

On x86_64, this drops the size of QQuickTextPrivate by 16 bytes (512 -> 496),
and increases the size of ExtraData from 56 bytes to 72 bytes.

Change-Id: Ib0a98199a74f757cf439d4ba276c7704504055b2
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQuickParticleData: Reorganise fields to drop size from 208 to 200 bytes on x86_64.
Robin Burchell [Sat, 17 Jan 2015 01:00:26 +0000 (02:00 +0100)]
QQuickParticleData: Reorganise fields to drop size from 208 to 200 bytes on x86_64.

Change-Id: Ide7a70baecf6d1ff3ec8160a2cb47f0bd9955e45
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoQML Models: Register ItemSelectionModel
Gabriel de Dietrich [Fri, 6 Feb 2015 14:58:33 +0000 (15:58 +0100)]
QML Models: Register ItemSelectionModel

Change-Id: I7f5c9e05c2e779d33e1bc92d698c75d97d397339
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
9 years agoQuickTestResult: Try a bit harder when stringifying a value
Gabriel de Dietrich [Thu, 5 Feb 2015 15:10:03 +0000 (16:10 +0100)]
QuickTestResult: Try a bit harder when stringifying a value

Q_GADGETs are not always QVariant::toString()-convertible
but they probably have their own toString() function that
we always try to call. This may still lead to false posi-
tives, but in a much smaller proportion.

Change-Id: I80547a9e773e97410fe5d4723efcac6b010046f9
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
9 years agoAdd Q_GADGET wrappers for QModelIndex & Co.
Gabriel de Dietrich [Thu, 15 Jan 2015 18:46:56 +0000 (19:46 +0100)]
Add Q_GADGET wrappers for QModelIndex & Co.

The complete list of types is,
  * QModelIndex
  * QModelIndexList
  * QPersistentModelIndex
  * QItemSelection
  * QItemSelectionRange

These wrapper types follow the QQmlValueType conventions and
allow us to expose the wrapped types without introducing
meta-type changes. They also allow to customize the string
type representation.

We also extend QQmlValueTypeFactory to return the meta-object
for those types.

Finally, we add two-way meta-type conversion between QModelIndex
and QPersistentModelIndex to get the same interoperability as
in C++ when passing an object of one type to a function requir-
ing an object of the other type.

Change-Id: Iaa7089ea576c901f12715ffa21e4d94603d53755
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
9 years agoUpdate copyright headers
Jani Heikkinen [Wed, 28 Jan 2015 11:55:39 +0000 (13:55 +0200)]
Update copyright headers

Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
9 years agoAdd offset test for QV4::Heap::String::text
hjk [Thu, 5 Feb 2015 09:45:42 +0000 (10:45 +0100)]
Add offset test for QV4::Heap::String::text

This is used in Qt Creator's "native mixed" access to runtimeStrings.

Change-Id: I5c94ec8bff0734e5dc032aa739bfbb51af9b9820
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
9 years agoPhotosurface example: flickable surface
Shawn Rutledge [Thu, 4 Dec 2014 14:35:40 +0000 (15:35 +0100)]
Photosurface example: flickable surface

The Flickable provides a way of testing interaction with 2-finger
trackpad gestures: if the cursor is over the background, you can flick
the surface via wheel events (which come from native flick gestures
if you are using a trackpad on OS X); inside the bounds of a photo,
the same 2-finger gesture is for zooming and rotating.

Also, random position and rotation are applied more correctly,
and only at startup.  Position and rotation changes are animated.

Change-Id: Iab49b7f2e99a9686424368fd94f0b7f89807da22
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoRemove unnecessary calls to initializeOpenGLFunctions
Laszlo Agocs [Mon, 9 Feb 2015 07:33:28 +0000 (08:33 +0100)]
Remove unnecessary calls to initializeOpenGLFunctions

We now have a change in QtGui that guarantees that the returned versionfunctions
object is initialized as long as the context is current.

Change-Id: I2e76e91bb4265a95fae657f6cacd92a789d56782
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
9 years agoImplement dnd support in QQuickWidget differently
Laszlo Agocs [Fri, 16 Jan 2015 14:05:19 +0000 (15:05 +0100)]
Implement dnd support in QQuickWidget differently

This way subclasses can reimplement functions like dragEnterEvent().

Task-number: QTBUG-43821
Change-Id: I24bd14de8aab5ab741bc36330b4dcf7c83dedbf6
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoExposed TypedArray private APIs for Canvas3D use.
Pasi Keranen [Tue, 10 Feb 2015 11:52:04 +0000 (13:52 +0200)]
Exposed TypedArray private APIs for Canvas3D use.

Exported QV4::TypedArray, QV4::ArrayBuffer and QV4::Heap::ArrayBuffer
in to the private API set.
Changed ArrayBuffer length in the constructor to size_t instead of int.
Added accessor methods to TypedArray array type and byte length.

Change-Id: I3f89b8e263012bc90cc665aed5744cbc66379204
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoRespect the text's background-color when it is set in the style in HTML
Andy Shaw [Mon, 2 Feb 2015 12:11:09 +0000 (13:11 +0100)]
Respect the text's background-color when it is set in the style in HTML

Task-number: QTBUG-36837
Change-Id: Iea85f4bc7c66124178a318f0ebd776726cf72c96
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agotst_qquickview: Prepare test to handle multiple pieces of data.
Robin Burchell [Mon, 2 Feb 2015 20:41:19 +0000 (21:41 +0100)]
tst_qquickview: Prepare test to handle multiple pieces of data.

Additionally, stack allocate the view. It's shorter, and saves an almost totally
pointless QVERIFY.

Change-Id: Ic90602d24659e1455dd50b706f96ef5ccac14f3a
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoQQuickItemParticle: Only delete owned particles
Alan Alpert [Mon, 26 Jan 2015 19:50:11 +0000 (11:50 -0800)]
QQuickItemParticle: Only delete owned particles

A common pattern for ItemParticle (as shown in the particleview.qml
example) is to use it to manage movement of a model's delegates. In such
a case item management is handled by the user code (which bridges the
needs of the Model and the View) and deleting the items in ItemParticle
quickly leads to crashes.

This change maintains (and improves, due to handling resets) the
deletion of delegates created by the ItemParticles, as shown in
delegates.qml. This example was expanded with a click to reset feature
so as to more clearly see the impact of resets.

Task-number: QTBUG-37486
Change-Id: I9de935034c11a7dd2abdd60e7b3bd42867dede9c
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoInitial shot at native Qml-and-C++ debugging
hjk [Thu, 11 Dec 2014 18:14:30 +0000 (19:14 +0100)]
Initial shot at native Qml-and-C++ debugging

This supports a Qt Creator debugging mode that allows to
extract combined C++/JS stacktraces and JS variable values
by examinining only the stack of the "native" debugger
backend.

Currently, only simple breakpoints and stepping with GDB
is supported, and the setup requires a debug build of
Qt(Declarative).

Change-Id: I9d73041ee541fa45ed4a977f4deef8ebb0493ff9
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoUse correct QOpenGLFunctions object
Berthold Krevert [Wed, 4 Feb 2015 09:18:36 +0000 (10:18 +0100)]
Use correct QOpenGLFunctions object

If core profile is used, QOpenGLContext::versionFunctions returns 0
if a legacy or a non-core profile version is requested.

That means, when using core profile we have to request a
QOpenGLFunctions_3_2_Core object (which is the lowest OpenGL
version that comes with profiles). Otherwise the application would
run into a segfault.

Change-Id: I8119e5fbeafccf14d59680617172c71e60e188ce
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoMove VAO binding to Renderer::render()
Berthold Krevert [Thu, 29 Jan 2015 16:18:49 +0000 (17:18 +0100)]
Move VAO binding to Renderer::render()

Amongst other things, QSGRenderer::preprocess() triggers the rendering of
QQuickShaderEffectSource items into framebuffer objects. The renderers
responsible for these QQuickShaderEffectSource items bind and unbind
their own VAOs, which messes up the VAO state set in QSGRenderer::preprocess().

Scenegraph nodes must not depend on the vao state set by the renderer anyway as
the binding has to be considered as an implementation detail.

Change-Id: Idec34c65397394e12e7f8419a1c9633d5f70a22e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQmlEngineDebugService: Avoid assert when debugging QModelIndex
Gabriel de Dietrich [Mon, 19 Jan 2015 13:14:50 +0000 (14:14 +0100)]
QQmlEngineDebugService: Avoid assert when debugging QModelIndex

QModelIndex is not streamable, so returning the input QVariant in
valueContents() will result in an assert.

We try to detect whether the input QVariant is a know value type
and then call the toString() meta-method on it. Otherwise, we fall
back to thge old behavior. This works since QModelIndex is exposed
to QML wrapped in an internal value type class (at least for the
time being).

Change-Id: I1a4c61b2bd441f823469dd73b31e86a1192f02e6
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoRe-enable ListView auto-test
Gabriel de Dietrich [Mon, 2 Feb 2015 17:27:45 +0000 (18:27 +0100)]
Re-enable ListView auto-test

Change-Id: Ie0117dddc1da95b9463ca67e15fce8b5ac65e1dd
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoRemove meta-type declaration for QPersistentModelIndex
Gabriel de Dietrich [Mon, 2 Feb 2015 15:10:45 +0000 (16:10 +0100)]
Remove meta-type declaration for QPersistentModelIndex

The auto-test will be re-enabled once
https://codereview.qt-project.org/103726 is merged
in qtbase.

Change-Id: I52ff538c3ca09b3e686483c2d0c3c66089acc13c
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
9 years agoFix autotest not to rely on broken operator<<(QDebug, QUrl) behavior
Kai Koehne [Thu, 29 Jan 2015 11:05:28 +0000 (12:05 +0100)]
Fix autotest not to rely on broken operator<<(QDebug, QUrl) behavior

QmlInfo does call nospace() in the constructor. However, the current
streaming operator for QDebug permanently resets this to space(),
which the autotest relies on ...

Move QUrl to the end of the chain so that the broken behavior of
QUrl isn't checked anymore. This allows us to fix it in qtbase ...

Change-Id: I365df3479a2724f69e768c23c0844f10c34b71be
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
9 years agoHandle context lost in the Windows render loop
Laszlo Agocs [Mon, 12 Jan 2015 16:34:42 +0000 (17:34 +0100)]
Handle context lost in the Windows render loop

With ANGLE (which always uses this loop) EGL_CONTEXT_LOST
may happen quite often, depending on various factors.

It is therefore good to handle this by tearing down and
reinitializing the scenegraph.

Task-number: QTBUG-43263
Change-Id: I8e985e001f46865ccd814255f39add58fe2a737a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoIntroduce QSG_TRANSIENT_IMAGES.
Gunnar Sletta [Thu, 29 Jan 2015 18:09:39 +0000 (19:09 +0100)]
Introduce QSG_TRANSIENT_IMAGES.

This feature enables the same feature that we already have in the
'nonpreservedtexture' in the scene graph playground.

This change also cleans up some leftover logic from the early Qt 5.2
days when we had to manually extract the image from the default
texture factory rather than going through
QQuickWindow::createTexture(). This cleanup is required for the logic
to work.

Change-Id: I7cdf15d981ba8af94f8d51781fc01e2b834b77c6
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoRelease atlas texture's image instance once uploaded
Gunnar Sletta [Thu, 29 Jan 2015 12:26:31 +0000 (12:26 +0000)]
Release atlas texture's image instance once uploaded

Sitting on the instance makes it impossible for custom texture
factories to release images to keep down memory.

Also, ditch the extra QRect used to store the nonpadded atlas rect as
this is easily reachable from the padded one.

Change-Id: I4914753cc43a6f3173cfc9b210e02b2770ef33fd
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoKeep PersistentValueStorage page size in sync with system page size
Tor Arne Vestbø [Fri, 30 Jan 2015 14:54:58 +0000 (15:54 +0100)]
Keep PersistentValueStorage page size in sync with system page size

WTF::PageAllocation::allocate() requires the allocated size to be a
multiple of the system page size (available through WTF::pageSize()),
so we can't hard-code the page size in PersistentValueStorage to 4K.

As we control the memory of the page we can use 'Value values[1]' as
a trick to let the compiler set up a head-reference for our list of
Values, which we access by values[0:kEntriesPerPage - 1].

Change-Id: I71fdfffa0424d510fc1073bb67b6675a04ac2d80
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoAdd some tools specific consistency tests
hjk [Mon, 26 Jan 2015 09:19:40 +0000 (10:19 +0100)]
Add some tools specific consistency tests

This upstreams parts of Qt Creator's tst_offset test to serve as
an early warning system by testing private implementation details
that are used in Qt Creator's data structure "pretty printing"
facility and "native mixed" QML-and-C++ debugging.

While the tested implementation details can be changed without
breaking binary or source compatibility, downstream tools like
Qt Creator depend on them.

If this test breaks, you are kindly asked to coordinate with the
downstream stakeholders to avoid tool breakage.

Change-Id: I2286efcec9bef105f80c2163a4f66f5c43f3a218
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoMouseArea: add scrollGestureEnabled property
Shawn Rutledge [Fri, 5 Dec 2014 09:28:20 +0000 (10:28 +0100)]
MouseArea: add scrollGestureEnabled property

If true, scroll gestures coming from the operating system can cause
wheel to be emitted; if false, only an actual mouse wheel will do that.
The photosurface example demostrates the use case.
1) the flick gesture on a trackpad should flick the underlying
Flickable, not zoom an individual image
2) mouse wheel should zoom an individual image if the cursor is
pointing to it
3) dragging an image on a touchscreen should be possible, independently
of flicking the Flickable.  This means multiPointTouchEnabled should be
true, so we cannot interpret multiPointTouchEnabled to mean that
multipoint touch scroll gestures should be disabled.

Change-Id: Ie063556866f07b3fbadc53990b110edeed532710
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoFix ItemParticle Example
Alan Alpert [Fri, 23 Jan 2015 23:40:47 +0000 (15:40 -0800)]
Fix ItemParticle Example

The "press space to inject new items" functionality was broken, it had
missed a couple of API changes somehow.

Change-Id: Idccbf7ef50ecf5fc9d296a472f1dd78669f94206
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoProperly mark all arguments in the call context
Lars Knoll [Mon, 26 Jan 2015 10:04:03 +0000 (11:04 +0100)]
Properly mark all arguments in the call context

This broke in change d24b7fb904771ba078ac52e05984b23327ddff3b,
where argc changed to contain the number of arguments passed into
the function, not the number of arguments it really has.

Change-Id: I2d25f159a9f60922b863c238147564f542d62ba0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAvoid crashes when resetting the same material or geometry.
Gunnar Sletta [Thu, 22 Jan 2015 12:26:24 +0000 (13:26 +0100)]
Avoid crashes when resetting the same material or geometry.

We still need to call markDirty() though, to avoid changing
behavior.

Change-Id: I9df00e8d1cbe95bfae96b9ba9162bd6f226b5bdc
Reviewed-by: Florian Hänel <florian.haenel@basyskom.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoPinchArea: handle native gestures when available
Shawn Rutledge [Thu, 13 Nov 2014 16:54:26 +0000 (17:54 +0100)]
PinchArea: handle native gestures when available

PinchArea is the first Item where we handle a QNativeGestureEvent,
so QQuickWindowPrivate::deliverGestureEvent is added to deliver these
events in the same way as the other deliverXEvent methods.
For now there is not a separate virtual event handler in QQuickItem,
because QNativeGestureEvent is not universally available, so it's
necessary to handle this event type in QQuickPinchArea::event().
updatePinchTarget() contains code factored out from updatePinch()
to do the necessary tranformations on the Item which was set as
pinch.target in QML.

So far the QNativeGestureEvents are generated only on OSX, so
the behavior of the PinchArea on other platforms is unmodified.
On OSX the intention is that we do not need to enable multiple-touch
events in order to use any of the common 2-finger gestures, and the
"feel" will be similar to that of gestures in native applications.

[ChangeLog][QtQuick][PinchArea] Pinch gestures are recognized by
the operating system on OSX

Change-Id: I693526ea120a9144beb7666afeab6256caa73e51
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
9 years agoLet ApplicationWindow inherit QQuickWindowQmlImpl
J-P Nurmi [Fri, 23 Jan 2015 15:21:14 +0000 (16:21 +0100)]
Let ApplicationWindow inherit QQuickWindowQmlImpl

Inheriting QQuickWindow would mean that ApplicationWindow would have
to duplicate all that visibility and root item marker related code.

Change-Id: I3b58631011a88d6a079c091db08215f2eef6df84
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
9 years agoProperly mark all members in QObjectMethod
Lars Knoll [Fri, 23 Jan 2015 15:03:02 +0000 (16:03 +0100)]
Properly mark all members in QObjectMethod

markObjects wasn't calling the parent implementation, so
the members in Object and FunctionObject didn't get
marked properly and thus collected early by the garbage
collector.

Change-Id: Iee036de909b68002db6d363263e739dcf857f024
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove Stmt::d to Phi::d
Robin Burchell [Sun, 11 Jan 2015 20:11:29 +0000 (21:11 +0100)]
Move Stmt::d to Phi::d

Phi is the only thing using it.

Change-Id: I2b6706884d9e41cc26632a6ad72281b391960f4f
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
9 years agoV4: change regalloc hints to be a QVarLengthArray.
Erik Verbruggen [Mon, 12 Jan 2015 13:32:38 +0000 (14:32 +0100)]
V4: change regalloc hints to be a QVarLengthArray.

Change-Id: I0541431dee0ce4575df56d952a3a9a2ab9fca01d
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoTypeloader cleanup
Simon Hausmann [Fri, 23 Jan 2015 10:26:29 +0000 (11:26 +0100)]
Typeloader cleanup

The QQmlDataBlob base class had a typeloader member that was provided with
startLoading() later, just to allow calling the url interceptor. The one
sub-class of QQmlDataBlob - QQmlTypeLoader::Blob - also had a typeloader
pointer, provided at constructor time.

This patch cleans this up by removing the duplicated typeloader pointer in the
sub-class and passing it straight through to the base-class at construction
type. This also allows moving the url interception to the constructor.

Also fixed the findCachedCompilationUnit calls to use the url after applying
the intercept and removed one unnecessary findCachedCompilationUnit call - the
QFile::exists call is sufficient.

Change-Id: If5c49d38a6ec66fea6cd7c21013c046cf75acafd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoDoc: Update QtQuick import version to 2.5
Caroline Chao [Thu, 22 Jan 2015 09:55:01 +0000 (10:55 +0100)]
Doc: Update QtQuick import version to 2.5

Change-Id: I1c2f4c8b2e052d541b4045bd5a739e5cb9e96429
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoBetter align data members in ExecutionContext
Lars Knoll [Mon, 19 Jan 2015 15:36:17 +0000 (16:36 +0100)]
Better align data members in ExecutionContext

Saves another 4-8 bytes per object.

Change-Id: Iaeb013abd20733cd7a5d9a5e0d42b92da8153da9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove the realArgumentsCount member in CallContext
Lars Knoll [Mon, 19 Jan 2015 15:29:48 +0000 (16:29 +0100)]
Remove the realArgumentsCount member in CallContext

The data is easily available through the CallData, only used by
the Arguments object and we save a pointer in Heap::CallData this way.

For this to work, let CallData::argc always return the real number
of arguments passed into the function.

Change-Id: I59c7c41e8c1af160db09fa794977ab7084c9e12d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoStore a double in NumberObject
Lars Knoll [Fri, 16 Jan 2015 11:44:51 +0000 (12:44 +0100)]
Store a double in NumberObject

Makes more sense than storing a Value in there.

Change-Id: I2e6ca71477100c1e1639bb89cced4f4049b5e5c2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoCleanups
Lars Knoll [Thu, 15 Jan 2015 20:54:12 +0000 (21:54 +0100)]
Cleanups

Simplify some code in BooleanObject
Simplify access to call arguments and thisObject

Change-Id: I2f8e844019bc587385608beb02f05b15f827535c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoCleanups
Lars Knoll [Thu, 15 Jan 2015 20:28:01 +0000 (21:28 +0100)]
Cleanups

Remove duplicated methods. Remove some mostly unused methods,
and simplify some others.

Change-Id: I605b249e54417bb32c3dfc8e22f2c8b6b684a1e1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove the definition of Object vtables into qv4object_p.h
Lars Knoll [Thu, 15 Jan 2015 20:02:40 +0000 (21:02 +0100)]
Move the definition of Object vtables into qv4object_p.h

Change-Id: I8dc15999e268d2d78691bf030b36cd09de1c4057
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove all remaining usages of ValueRef
Lars Knoll [Thu, 15 Jan 2015 14:01:06 +0000 (15:01 +0100)]
Remove all remaining usages of ValueRef

Change-Id: Icd76d3d03fac2e57530e55f8ec15b97109dcdcbc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoGet rid of most uses of ValueRef
Lars Knoll [Thu, 15 Jan 2015 10:36:57 +0000 (11:36 +0100)]
Get rid of most uses of ValueRef

Instead pass a const Value & into the functions

With our new inheritance structure, we can get rid of ValueRef
and instead simply pass a pointer to a Value again. Pointers to
Values are safe to use again now, as they are now guaranteed to
be in a place where the GC knows about them.

Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoIntroduce Shortcut
J-P Nurmi [Thu, 1 Jan 2015 18:51:44 +0000 (19:51 +0100)]
Introduce Shortcut

[ChangeLog][QtQuick] Added a Shortcut utility type for catching
keyboard shortcuts

Change-Id: I4af631bfa7987f0d809b1f5af499f1d9688a1e04
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
9 years agoQML: Fix MSVC 2013/64bit warnings.
Friedemann Kleint [Thu, 22 Jan 2015 08:38:22 +0000 (09:38 +0100)]
QML: Fix MSVC 2013/64bit warnings.

compiler\qv4ssa.cpp(687) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
compiler\qv4ssa.cpp(950) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
compiler\qv4ssa.cpp(1117) : warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data
compiler\qv4ssa.cpp(1120) : warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data
compiler\qv4ssa.cpp(1148) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data
compiler\qv4ssa.cpp(1266) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data
compiler\qv4ssa.cpp(1622) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
compiler\qv4ssa.cpp(2246) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data
compiler\qv4ssa.cpp(4289) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
compiler\qv4ssa.cpp(4351) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data
jit\qv4regalloc.cpp(1383) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
jit\qv4regalloc.cpp(1769) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
jit\qv4regalloc.cpp(1814) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
jsruntime\qv4mm.cpp(496) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
jsruntime\qv4mm.cpp(503) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
jsruntime\qv4mm.cpp(506) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
jsruntime\qv4regexp.cpp(60) : warning C4267: 'return' : conversion from 'size_t' to 'uint', possible loss of data
jsruntime\qv4typedarray.cpp(85) : warning C4309: '=' : truncation of constant value

Change-Id: I0b04e1a9d379c068fb3efe90a9db8b592061e448
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQQuickText: respect new line width set by lineLaidOut() handler.
Dmitry Volosnykh [Wed, 21 Jan 2015 11:02:33 +0000 (14:02 +0300)]
QQuickText: respect new line width set by lineLaidOut() handler.

This commit makes text elide properly when custom layout is implemented.

Task-number: QTBUG-44025
Change-Id: Iefe344079c002d3a79aea18096a71667f6c17add
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
9 years agoRework QJSValue internals
Lars Knoll [Wed, 14 Jan 2015 15:22:33 +0000 (16:22 +0100)]
Rework QJSValue internals

Use a flagged pointer to either store a pointer to a
QV4::Value (from the persistent storage) or a pointer to
a QVariant in QJSValue::d. Like this we don't need to malloc
to create a QJSValue for most use cases.

Significantly reduces the memory consumption of QJSValue and
speeds it up a lot.

Change-Id: I10902cc4b6cc3f43d3f816875dc6c4bbb6b4490f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAdd C++11 move operators, and a simpler internal constructor
Lars Knoll [Wed, 14 Jan 2015 11:50:34 +0000 (12:50 +0100)]
Add C++11 move operators, and a simpler internal constructor

Move semantics should optimize some copy operations on QJSValues,
and the internal constructor will simplify refactoring the
QJSValue class to get rid of the extra allocated private.

Change-Id: I24863b30523af2432aa81ad6b87fda7fe35749c4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove the internalClass pointer into Heap::Object
Lars Knoll [Tue, 13 Jan 2015 20:49:09 +0000 (21:49 +0100)]
Move the internalClass pointer into Heap::Object

The other classes that derive from Heap::Base don't need it
at all. So get rid of it there and save a pointer.

Change-Id: I9c5df2e43cd6eeac2e6e41f3d3b8077d3afbc8f2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoGet rid of all uses of Managed::engine()
Lars Knoll [Sun, 11 Jan 2015 15:30:29 +0000 (16:30 +0100)]
Get rid of all uses of Managed::engine()

Change-Id: I596f14554d81f5e9af9996294d96047f2e810bef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove all the setVTable() calls that aren't required anymore
Lars Knoll [Sat, 10 Jan 2015 19:51:15 +0000 (20:51 +0100)]
Remove all the setVTable() calls that aren't required anymore

The memory manager's allocation methods now set this up correctly
for us :)

Change-Id: I8492bf732df601f95a1a851fb3804127ffc83935
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove the remaining bit of code that use the vtable in the internalClass
Lars Knoll [Sat, 10 Jan 2015 19:35:18 +0000 (20:35 +0100)]
Remove the remaining bit of code that use the vtable in the internalClass

Change-Id: Ia52f0e6db325aab37477d455f163487b319dce29
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoIntroduce Flickable.OvershootBounds behavior
J-P Nurmi [Thu, 12 Jun 2014 18:23:10 +0000 (20:23 +0200)]
Introduce Flickable.OvershootBounds behavior

Related to QTBUG-38515. It is not always desired to allow dragging over
bounds even if flicking overshoots. This makes it possible to implement
collision effects for flicks, while a drag over bounds would still do
nothing.

[ChangeLog][QtQuick][Flickable] Introduced Flickable.OvershootBounds
behavior that allows content overshooting the boundary when flicked,
but does not allow dragging content beyond the boundary of Flickable.

[ChangeLog][QtQuick][Important Behavior Changes]
Flickable.DragAndOvershootBounds value changed from 2 to 3. This will
only affect you if you've worked around enum type checking and have
the integer value explicitly in your code.

Change-Id: I63c3540ab293a9c7c801d81220f74909d3fa1e17
Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
9 years agoQQmlData: More member reorganisation to remove holes.
Robin Burchell [Sat, 17 Jan 2015 22:11:20 +0000 (23:11 +0100)]
QQmlData: More member reorganisation to remove holes.

Drops size from 136 bytes to 128 bytes on x86_64.

Change-Id: I008f899539fcae8ad29b8978116e6dce2e10a40e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoModels: Remove QModelIndex metatype re-declaration
Gabriel de Dietrich [Fri, 16 Jan 2015 13:36:24 +0000 (14:36 +0100)]
Models: Remove QModelIndex metatype re-declaration

It's absolutely unnecessary.

Change-Id: Ib9e4077a8720b7f58886b85c4feabe18205ccb41
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
9 years agoQQmlValueTypeWrapper: Use QVariant to QString conversion if possible
Gabriel de Dietrich [Wed, 14 Jan 2015 19:54:13 +0000 (20:54 +0100)]
QQmlValueTypeWrapper: Use QVariant to QString conversion if possible

This makes it easier to customize displaying Q_GADGETs that don't
have a toString() function defined. Instead of having to define
a wrapper Q_GADGET class, it's more straightforward to register a
meta-type converter. Finally, it ensures consistent value displays
between QML and the rest.

Change-Id: I76f93ee0bafabd74f311130972b49c572b38f43f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoSend hover events also to QQuickItem::childMouseEventFilter
Jørgen Lind [Wed, 14 Jan 2015 08:41:23 +0000 (09:41 +0100)]
Send hover events also to QQuickItem::childMouseEventFilter

childMouseEventFilter already gets touch events, and it is logical to
send the hover events which are essentially mouse events. By also
sending hover events to the filter it allows an item to track the mouse.

Existing implementations of childMouseEventFilter should not be effected
by more events being sent to it as checking for the event type should be
practiced in all overloads.

Change-Id: Ie00aceef05e41e4e8f6d80007343c5a5b9f566cf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove vtable out of internalClass
Lars Knoll [Sat, 10 Jan 2015 16:55:29 +0000 (17:55 +0100)]
Move vtable out of internalClass

We can move the internalClass to Object later on, and such save
having the internalClass on lots of Heap objects.

This commit basically adds and starts making use of a new
vtable pointer in Heap::Base. In addition, the construction
methods in the memory manager now automatically setup the
correct vtable.

Removing the vtable code from InternalClass and moving it into
Object will come in a separate commit

Change-Id: If49e8d73c769bf65bf47fe4dbf8b9546c8019dbc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove not required std::vector::reserve() calls
Lars Knoll [Tue, 20 Jan 2015 09:04:35 +0000 (10:04 +0100)]
Remove not required std::vector::reserve() calls

These actually force more reallocations of the vector than
required, and slow things down in practice.

callgrind shows that this saves around 7% of the total instruction
count for crypto.js

Change-Id: Ibd6114d84ade2b484a5261b53c3299f48f79e633
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix a bug in removeMember causing a duplicate transition with an 0 lookup.
Robin Burchell [Mon, 19 Jan 2015 15:26:54 +0000 (16:26 +0100)]
Fix a bug in removeMember causing a duplicate transition with an 0 lookup.

We shouldn't have taken a copy here. I'm not sure why I did that. Also sprinkle
Q_ASSERT fairydust around to try ensure that this doesn't happen again.

This was exposed when we started trying to delete the transitions again, which
were leaked in 6421f275286b3238fe1a7a5e909225251f3e8dbf.

Change-Id: Id9272db7f1863d1ccc5b1f48b6382c68ae0da9da
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoQV4::InternalClass: Fix a memory leak.
Robin Burchell [Mon, 19 Jan 2015 11:51:06 +0000 (12:51 +0100)]
QV4::InternalClass: Fix a memory leak.

Accidentally introduced in 6421f275286b3238fe1a7a5e909225251f3e8dbf.

Change-Id: I45d121a661ba403d1d4573f98fe0944f05319290
Done-by: Slava Monich <slava.monich@jolla.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoExpose QStyleHints as Qt.styleHints
J-P Nurmi [Fri, 2 Jan 2015 14:41:02 +0000 (15:41 +0100)]
Expose QStyleHints as Qt.styleHints

Change-Id: I0fc94e680b011963e645bdbf51110820751e53aa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQQmlData: Reorder fields to drop size from 144 to 136 bytes on x86_64.
Robin Burchell [Sat, 17 Jan 2015 00:37:19 +0000 (01:37 +0100)]
QQmlData: Reorder fields to drop size from 144 to 136 bytes on x86_64.

Change-Id: Icfeb5c27060731dfa79b48151b6dcb5484586708
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQQuickParticleEmitter: Call particleCountChanged by hand on maximumEmittedChanged.
Robin Burchell [Mon, 12 Jan 2015 10:06:46 +0000 (11:06 +0100)]
QQuickParticleEmitter: Call particleCountChanged by hand on maximumEmittedChanged.

Analysis of QObject connections showed that a large number of connections were
set up to the particles system. As this particular case is cheap, we can do it
inline instead, and avoid the connection-per-instance.

Change-Id: Iec2049fff2c257dc39662ef2b5a8ecd75bbd870d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFix Qt.inputMethod ownership
J-P Nurmi [Wed, 14 Jan 2015 10:28:06 +0000 (11:28 +0100)]
Fix Qt.inputMethod ownership

Change-Id: Ic51f9daf17742a421a810d95b2a510caf657e08f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoImplement DefUses::Temps with a QVarLengthArray.
Robin Burchell [Sat, 10 Jan 2015 21:12:29 +0000 (22:12 +0100)]
Implement DefUses::Temps with a QVarLengthArray.

Avoiding heap allocations here shaves 100ms or so off the optimizer runtime.

Change-Id: If00c757532ffe90f2fa9c62dc999bb69e25bb71c
Task-number: QTBUG-43719
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
9 years agoDon't require an ExecutionEngine member in String anymore
Lars Knoll [Tue, 13 Jan 2015 16:22:08 +0000 (17:22 +0100)]
Don't require an ExecutionEngine member in String anymore

Change-Id: I7c1a5471507669871564d79dc17d1026c268b6d0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRefactor persistent values
Lars Knoll [Mon, 12 Jan 2015 20:55:51 +0000 (21:55 +0100)]
Refactor persistent values

Use a page wise allocation mechanism for persistent
values. This significantly reduces memory consumption
of persistent values and also improves their performance
a lot.

Change-Id: I8499d2ca5bdd871e029f643ae605a94544558bb5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQQuickItemParticle: delete delegates once they are completed.
Robin Burchell [Sun, 11 Jan 2015 19:41:38 +0000 (20:41 +0100)]
QQuickItemParticle: delete delegates once they are completed.

This was one gigantic memory leak, if anyone tried to use this functionality, as
evidenced by the bug. The comment notes that deletion was only to be done if the
items were created by the ItemParticle, but I don't think this makes sense:
take()'s documentation doesn't imply that the ownership of the item stays with
the creator, and nor does this seem to be a particularly sensible API decision
to make, so I'm not going to implement that.

Change-Id: I307d77b70c2b4f7b34565865f8efcfe64817be2f
Task-number: QTBUG-37486
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoDrop trailing vertices in GL_LINES and GL_TRIANGLES drawing modes.
Ulf Hermann [Mon, 12 Jan 2015 12:54:45 +0000 (13:54 +0100)]
Drop trailing vertices in GL_LINES and GL_TRIANGLES drawing modes.

This results in more correct behavior if you create nodes with a
number of vertices that doesn't match the drawing mode.

Change-Id: Ic0f59a4019a6b4087b527b7c9b38c35a9e02ece8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoMerge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev
Simon Hausmann [Fri, 16 Jan 2015 14:46:46 +0000 (15:46 +0100)]
Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev

9 years agoAvoid an incorrect warning when dynamically parenting a Window
Jocelyn Turcotte [Thu, 15 Jan 2015 15:05:26 +0000 (16:05 +0100)]
Avoid an incorrect warning when dynamically parenting a Window

"Created graphical object was not placed in the graphics scene."
QQuickWindow is the root of a graphics scene and doesn't need to be
inside another one.

It is already suggested in the Window documentation that Window can
be an inline child of a top-level QtObject. This patch fixer the
warning when dynamically creating a Window component.

Change-Id: Ie6d9d37b9e9ffdb61101aaaad6f4b722216ec759
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMerge remote-tracking branch 'origin/5.4' into dev
Simon Hausmann [Wed, 14 Jan 2015 11:00:56 +0000 (12:00 +0100)]
Merge remote-tracking branch 'origin/5.4' into dev

Conflicts:
.qmake.conf
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4debugging.cpp
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4functionobject_p.h
src/qml/jsruntime/qv4qobjectwrapper.cpp
src/quick/scenegraph/shaders/visualization.frag
tests/auto/qml/qjsengine/tst_qjsengine.cpp

Change-Id: I492e8546c278f80a300a2129e9a29d861e144a30

9 years agoRedirect console.info to new QtInfoMsg
Kai Koehne [Fri, 12 Dec 2014 10:10:45 +0000 (11:10 +0100)]
Redirect console.info to new QtInfoMsg

Change-Id: I6f4560a3baae16dd6db090d51a577060689825ef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoCheck for "c" being a nullptr in all places
Holger Hans Peter Freyther [Sun, 11 Jan 2015 07:56:56 +0000 (08:56 +0100)]
Check for "c" being a nullptr in all places

So either c is never a nullptr or there is a potential crash in
the grab code. Replicate the check from above.

Change-Id: I2c93502c026cdd92dc5d20e3d6d59e6f6f92a6ce
Fixes: Coverity CID 10628
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAdd null check for target as well
Holger Hans Peter Freyther [Sun, 11 Jan 2015 07:53:58 +0000 (08:53 +0100)]
Add null check for target as well

I couldn't see any documentation for the implication that if
stackBefore is set then target must not be null. Coverity didn't
find that implication either.

Change-Id: Ifb93aa4c1e40f417033057b9a403d368dfdf0ba8
Fixes: Coverity CID 10627
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove side-effect in assert
Holger Hans Peter Freyther [Sun, 11 Jan 2015 07:43:29 +0000 (08:43 +0100)]
Remove side-effect in assert

Fixes: Coverity CID 10587

Change-Id: I5101d209a54751532f48094f443afe35c6111e29
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoNo need to include qsgbatchrenderer_p.h from qquickwindow_p.h
Gunnar Sletta [Mon, 12 Jan 2015 13:35:24 +0000 (14:35 +0100)]
No need to include qsgbatchrenderer_p.h from qquickwindow_p.h

Change-Id: Iba97717ae8d485c217613475524a762949ea1dae
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoMake sure we always have an engine when assigning to a Persistent
Lars Knoll [Tue, 13 Jan 2015 08:01:29 +0000 (09:01 +0100)]
Make sure we always have an engine when assigning to a Persistent

This prepares things for a rewrite of the internals of Persistent.

Change-Id: Ib93ec5911984d1bfce87ffdc3f86bc75f6ecafe9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix flick() with ListView.SnapToItem at bounds.
Michael Brasser [Thu, 18 Dec 2014 16:20:37 +0000 (10:20 -0600)]
Fix flick() with ListView.SnapToItem at bounds.

Previously flick() would not always allow flicking to the very end of
a ListView if ListView.SnapToItem were set. Stop ListView from adding
overshoot, and then incorrectly correcting, if we are flicking exactly
to the end of a list.

Change-Id: Iad56e433bc1ba7d62f0553c4355469c9861df919
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoUse a list of lists for free chunks instead of merging in one list
Jocelyn Turcotte [Fri, 9 Jan 2015 17:52:56 +0000 (18:52 +0100)]
Use a list of lists for free chunks instead of merging in one list

This remove the tedious merging of free heap slots into one big list
after sweeping. It now lets each chunk keep its 0-terminated list of
free items and by then linking chunks together in a list for those
containing at least one free item.

The chunk metadata is moved at the beginning of the allocated VM
region to avoid moving it all around while sorting
MemoryManager::Data::heapChunks.

Change-Id: Ia93c2eb7feca0779a28aea5149dd066dacbfa494
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>