platform/upstream/qtdeclarative.git
9 years agoFlickable: drag-over-bounds is not velocity-sensitive
Shawn Rutledge [Fri, 26 Jun 2015 16:14:31 +0000 (18:14 +0200)]
Flickable: drag-over-bounds is not velocity-sensitive

The inspiration for velocity sensitivity was to make it feel more like
native trackpad flicking on OS X.  But on touchscreens it doesn't
make as much sense, and it became too difficult to intentionally
overshoot in applications that depend on pull-to-refresh functionality.

Task-number: QTBUG-46108
Change-Id: I3fea5324aaac1f003ead200e14b0c76bd8c0ece6
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoQtQml: Fix const correctness in old style casts
Thiago Macieira [Sat, 7 Mar 2015 22:35:47 +0000 (14:35 -0800)]
QtQml: Fix const correctness in old style casts

Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c958364a2e9859
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoFix encoding of QV4::Value in host builds
Simon Hausmann [Tue, 7 Jul 2015 11:13:22 +0000 (14:13 +0300)]
Fix encoding of QV4::Value in host builds

When building on a 64-bit host targeting a 32-bit architecture, we would
use QT_POINTER_SIZE == 4 from qconfig.h, which is unfortunately shared.
However on 64-bit hosts the 32-bit encoding appears to result in gcc/clang
to miscompile simple QV4::Value uses - when optimizations are enabled.
As a workaround, let's use 64-bit encoding in all host scenarios.

Change-Id: I000cf13abcc9240c931191d6361b6dee578cb5d4
Task-number: QTBUG-45364
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
9 years agoFix more casts that dropped the constness.
Thiago Macieira [Wed, 13 May 2015 21:20:57 +0000 (06:20 +0900)]
Fix more casts that dropped the constness.

Found with GCC's -Wcast-qual

Change-Id: I66a35ce5f88941f29aa6ffff13dde502fccefb1d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoFix ICC warning about change of sign
Thiago Macieira [Sat, 28 Mar 2015 05:12:56 +0000 (22:12 -0700)]
Fix ICC warning about change of sign

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

Change-Id: Iee8cbc07c4434ce9b560ffff13cf917dd8f9012e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoDelete QQuickWindow's animator driver at the right time.
Gunnar Sletta [Thu, 2 Jul 2015 13:54:43 +0000 (15:54 +0200)]
Delete QQuickWindow's animator driver at the right time.

For the non-threaded renderloops, we there might be a timer firing
before the animationController is cleaned up through deleteLater()
which will then reference the deleted QQuickWindow. Rely instead on
direct and explicit cleanup at the right time in each render loop.

Change-Id: Id81daddae78ce3922d6a932fb21200f2dc7955bb
Task-number: QTBUG-33723
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoQSGSimpleTextureNode: Fix ownership of QSGTexture
Tobias Koenig [Fri, 3 Jul 2015 08:55:35 +0000 (10:55 +0200)]
QSGSimpleTextureNode: Fix ownership of QSGTexture

Make sure the QSGSimpleTextureNode deletes the old QSGTexture
if a new one is set via setTexture() and the ownsTexture flag
is true.

[ChangeLog][QtQuick][SceneGraph] QSGSimpleTextureNode will now delete
the currently set QSGTexture object, if a new QSGTexture is set and
the ownsTexture flag is on.

Change-Id: Iabfbccd390e16948d4575baf29e6c8b4a184a404
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoImprove support for HTML entities in StyledText
Kai Uwe Broulik [Wed, 27 May 2015 08:52:59 +0000 (10:52 +0200)]
Improve support for HTML entities in StyledText

This adds support for the non-breaking space character (&nbsp;) and properly
handling entities that do not end with a semicolon, such as a stray ampersand
in a text.

Change-Id: I2f157c9aa651b27511809d5a47ac07660949a290
Task-number: QTBUG-44869
Task-number: QTBUG-31816
Task-number: QTBUG-33368
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoAdd lancelot test for Emoji text rendering / color glyphs
Tor Arne Vestbø [Fri, 26 Jun 2015 15:37:50 +0000 (17:37 +0200)]
Add lancelot test for Emoji text rendering / color glyphs

We test both native text rendering and distance field text rendering
(which should switch to native for the emoji glyphs automatically),
in various configurations of text color, opacity, and background
color.

Change-Id: I06178820943cd2a52cf338f7eb5c0fca881cb625
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoBump version
Oswald Buddenhagen [Mon, 29 Jun 2015 08:47:36 +0000 (10:47 +0200)]
Bump version

Change-Id: If10035949b42f8481dc182af3d176e68d07d71a3

9 years agoMerge remote-tracking branch 'origin/5.5.0' into 5.5
Liang Qi [Fri, 26 Jun 2015 12:03:55 +0000 (14:03 +0200)]
Merge remote-tracking branch 'origin/5.5.0' into 5.5

Change-Id: I4020a1b3c59dea18faf7cbcbb78b90fcfc3680f0

9 years agoFix documentation for ItemSelectionModel
Gabriel de Dietrich [Wed, 24 Jun 2015 13:59:45 +0000 (15:59 +0200)]
Fix documentation for ItemSelectionModel

Change-Id: I28f61e1853ea2cc75fbf814f76a7ef09e0d17f5d
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
9 years agoCorrectly initialize ListView section attached properties.
Martin Jones [Wed, 24 Jun 2015 05:56:09 +0000 (15:56 +1000)]
Correctly initialize ListView section attached properties.

During item insertion, indexes of items in the visibleItems list were
not adjusted before new items were created. Section initialization was
broken during insertion because section calculation relies on the
indexes of the items in the visibleItems list. The incorrect section
properties caused spurious section header creation, and layout issues.

Apply the index offset before creating the new items. This mirrors what
GridView already does.

Change-Id: I549a81825cf0e979bc5830840bf6cb75c7a82cac
Task-number: QTBUG-43873
Reviewed-by: Bea Lam <bea.lam@jollamobile.com>
9 years agoFix missing images when alpha and shader effects are involved
Laszlo Agocs [Tue, 23 Jun 2015 16:39:40 +0000 (18:39 +0200)]
Fix missing images when alpha and shader effects are involved

Once we hit removedFromAtlas() and the glCopyTexImage2D() path, bad things
tend to happen with OpenGL ES, both on certain embedded devices (Beaglebone, RPi)
and ANGLE.

ANGLE just rejects GL_BGRA_EXT with INVALID_ENUM. So if it fails, just try
with GL_RGBA. The BGRA extensions do not mention glCopyTexImage2D in any form
and in plain GLES (any version) BGRA does not exist. So rejecting it may be valid,
depending on how one reads the specs.

Same problem on Beaglebone, where the call with BGRA fails as INVALID_OPERATION.

The RPi 1 and 2 fails in a different way: the temporary framebuffer is not complete
because BGRA textures are not supported as color attachments. So our only choice
here is to do what we do for some Android devices already: ignore BGRA support.

Task-number: QTBUG-46806
Change-Id: I89b3b38bf7f8883c39509606ec5ae525f131292b
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoDoc: resize tables with overflow
Nico Vertriest [Thu, 4 Jun 2015 10:41:56 +0000 (12:41 +0200)]
Doc: resize tables with overflow

Task-number: QTBUG-46475
Change-Id: Iebb2f7677f8b514d2b3e08480abfc98a0e155c1c
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
9 years agoSupport 32-bit color bitmap glyphs in native text rendering.
Eli Fidler [Fri, 19 Jun 2015 20:44:29 +0000 (16:44 -0400)]
Support 32-bit color bitmap glyphs in native text rendering.

We had been accidentally using the 8-bit alpha glyph shader, which
resulted in rendering solid black outlines of the glyphs.

Task-number: QTBUG-37986
Task-number: QTBUG-45514
Change-Id: Ie8728d50068f58d659e24bc5db2d73e01ca8db75
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
9 years agoDoc: document work-around for static builds using dynamic object creation
Richard Moe Gustavsen [Wed, 17 Jun 2015 13:10:22 +0000 (15:10 +0200)]
Doc: document work-around for static builds using dynamic object creation

Currently we have no system to detect import dependencies that are
not explicitly added to a QML file (other than qmldir "depends", which
is for plugins only). Until we do, document the work-around.

Change-Id: Ic7244728b63bd1f2eb4bf9734474b3e6e48e26fe
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoQSGDefaultRectangleNode: Fix gradient position calculations
Santtu Lakkala [Fri, 29 May 2015 15:40:56 +0000 (18:40 +0300)]
QSGDefaultRectangleNode: Fix gradient position calculations

Change the gradient position calculations to consider full border, not
just half of it, because the border is fully drawn inside the
rectangle, not half outside, half inside.

Task-number: QTBUG-36059
Change-Id: Ie7dec94d9f6e03ae07c612c6e3b1950781973dc7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoEnable high-dpi mode for qml.app on OS X.
Morten Johan Sørvig [Tue, 16 Jun 2015 11:44:38 +0000 (13:44 +0200)]
Enable high-dpi mode for qml.app on OS X.

Add missing "NSPrincipalClass" key.

Change-Id: If7d02470ecee9f85731626f26f2381d434db9367
Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com>
9 years agoVersion scrollGestureEnabled as a new property
Alan Alpert [Thu, 11 Jun 2015 01:40:22 +0000 (18:40 -0700)]
Version scrollGestureEnabled as a new property

Change-Id: I3408cf93a90327e8abbe2f8b7a85d8a84e24ae58
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoqml: Output information about build and GL renderer in verbose mode.
Friedemann Kleint [Wed, 3 Jun 2015 09:05:12 +0000 (11:05 +0200)]
qml: Output information about build and GL renderer in verbose mode.

Make static contain() a member of LoadWatcher() and connect to
QQuickWindow::onOpenGlContextCreated(). Print information similar
to qtdiag.

Change-Id: I0bc6bc43418e4392c6b5e2643d4f7899ff4f4f8b
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoVersion scrollGestureEnabled as a new property
Alan Alpert [Thu, 11 Jun 2015 01:40:22 +0000 (18:40 -0700)]
Version scrollGestureEnabled as a new property

Change-Id: I3408cf93a90327e8abbe2f8b7a85d8a84e24ae58
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoAndroid: Another work around bug of Vertex Shader
Takumi ASAKI [Wed, 3 Jun 2015 06:10:11 +0000 (15:10 +0900)]
Android: Another work around bug of Vertex Shader

Just like commit fd565ec6, this fixes another vertex shader compilation
issue on certain OpenGL drivers.

Change-Id: Ided3d6082fa0790659e9c242d0b43d7de5a2ae4d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoImprove qml error message "invalid alias location"
Aleix Pol [Wed, 10 Jun 2015 19:18:15 +0000 (21:18 +0200)]
Improve qml error message "invalid alias location"

Specify we're talking about the target itself rather than talking
location, which I always doubt about whether it's the location within the
file.
Also specify the offending property, so we get a clue about what to look
into.

[ChangeLog][QtQml] Improve "invalid alias location" error message by specifying
what's the offending property and by calling it "invalid alias target location"

Change-Id: I7a9390089ee8986872c119df44d8036bf267ab99
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoMake argument to QQmlDebuggingEnabler::startTcpServer an enum
Ulf Hermann [Mon, 8 Jun 2015 14:43:23 +0000 (16:43 +0200)]
Make argument to QQmlDebuggingEnabler::startTcpServer an enum

The bool argument is less intuitive as you don't know if e.g. true
means "Yes, run the QML" or "Yes, block the QML engine".

Task-number: QTBUG-46565
Change-Id: I6d268e1354cebeb794b065e118bc0c353d7dd59a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoV4: Fix use of uninitialized field.
Erik Verbruggen [Fri, 5 Jun 2015 13:20:23 +0000 (15:20 +0200)]
V4: Fix use of uninitialized field.

Valgrind pointed out that Transition::id was used in a conditional jump
or move. Fixes regressions of the following tests on OSX:

  ch15/15.2/15.2.3/15.2.3.12/15.2.3.12-2-1 in non-strict mode
  ch15/15.2/15.2.3/15.2.3.12/15.2.3.12-2-2 in non-strict mode
  ch15/15.2/15.2.3/15.2.3.12/15.2.3.12-3-28 in non-strict mode

Change-Id: Ia959ff6f9fdac8d4cb37f54f670fdff4c8ba9a67
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoAdd a version of BitVector that uses QBitArray.
Erik Verbruggen [Fri, 5 Jun 2015 10:54:36 +0000 (12:54 +0200)]
Add a version of BitVector that uses QBitArray.

Some C++ STL libraries are unable to ship a bug-free std::vector<bool>,
and/or a bug-free specialization of std::find for std::vector<bool>. So,
for those platforms there now is a slow version of BitVector, which
relies on QBitArray, which we can fix if we find bugs.

Change-Id: I5ddfb18cabe82049a7ede6083fe6ba142bca068b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoWrap std::vector<bool> in our own class.
Erik Verbruggen [Fri, 5 Jun 2015 10:30:32 +0000 (12:30 +0200)]
Wrap std::vector<bool> in our own class.

So we can replace the implementation when we encounter a broken version
of std::vector<bool> or a broken specialization of std::find for it.

Change-Id: I7d7c0af585388ddedf5167cd9863c52ab638442d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoFix performance regression in Image construction.
Gunnar Sletta [Sun, 7 Jun 2015 10:30:20 +0000 (12:30 +0200)]
Fix performance regression in Image construction.

Setting up the signal leads to a significant memory and performance
overhead. This patch improves the benchmark by almost 10%.

Change-Id: Ib0a76ba42fdce1ca707044a8f8b6bdc6405f20c3
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoAdded auto-generated change log
Simon Hausmann [Wed, 3 Jun 2015 17:34:27 +0000 (19:34 +0200)]
Added auto-generated change log

Change-Id: I188f4137653505fd7635ad911ca41eecb89dd417
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
9 years agoqml: Add options to control the GL renderer.
Friedemann Kleint [Wed, 3 Jun 2015 08:04:54 +0000 (10:04 +0200)]
qml: Add options to control the GL renderer.

Task-number: QTBUG-46030
Change-Id: I5af5a0ef267444d85e8da6df196229ad8199c00f
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoqmlscene: Add option --verbose to obtain diagnostic output.
Friedemann Kleint [Fri, 29 May 2015 15:24:33 +0000 (17:24 +0200)]
qmlscene: Add option --verbose to obtain diagnostic output.

Print the build information and connect to
QQuickWindow::openglContextCreated() to print information on the
GL driver (similar to qtdiag).
Set a window title indicating render type and Qt version.

Task-number: QTBUG-46030
Change-Id: Ib4376126bf9c63f4cab8cb530ff1da66394b634b
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoqmlscene: Add options to control the GL renderer.
Friedemann Kleint [Fri, 29 May 2015 14:38:34 +0000 (16:38 +0200)]
qmlscene: Add options to control the GL renderer.

Replace boolean option controlling context sharing by a vector of
QCoreApplication attributes (bearing in mind that for example
High DPI changes might add more attributes) and add the GL switching
attributes.

Task-number: QTBUG-46030
Change-Id: I934dd8910b7b50ec96ae9e00823649c9df6a00ef
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoRedirect the default FBO correctly with QQuickWidget
Laszlo Agocs [Mon, 1 Jun 2015 15:04:07 +0000 (17:04 +0200)]
Redirect the default FBO correctly with QQuickWidget

Similarly to QOpenGLWidget, functions like QOpenGLFramebufferObject::bindDefault()
should bind the QQuickWidget's FBO, not 0, while rendering the scene graph.

This becomes particularly important on platforms with surfaceless context support.
Here offscreen surfaces are not backed by any surface. Therefore any OpenGL operation
accessing the current draw framebuffer with FBO 0 bound may potentially crash, as there
is no draw framebuffer at all.

The distance field glyph cache exhibits this issue when running with EGL on Mesa:
glViewport crashes when we render via QQuickWidget and the current framebuffer is reset
to 0. The problem goes away when the code changed is to use bindDefault() - as it should have
anyhow - and QQuickWidget is enhanced to communicate the "default" framebuffer to QOpenGLContext,
just like QOpenGLWidget does.

Task-number: QTBUG-46415
Task-number: QTBUG-43269
Change-Id: I35fe375a0870dadecc4a074dfdec122c6a4c92ab
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
9 years agotst_qquickwindow: Prospective fix for instability of cursor test.
Friedemann Kleint [Wed, 3 Jun 2015 12:27:27 +0000 (14:27 +0200)]
tst_qquickwindow: Prospective fix for instability of cursor test.

  FAIL!  : tst_qquickwindow::cursor() Compared values are not the same
     Loc: [tst_qquickwindow.cpp(1444)]

Check that no windows are leaked in slot cleanup and fix all
leaking tests.

Position the window and enlarge it to fix the warning:

WARNING: tst_qquickwindow::cursor() Mouse event occurs outside of target window.

Add window titles to tests.

Replace QVERIFY(a == b) by QCOMPARE(a, b).

Change-Id: Ida892e8a8d7d5f40d4f50787608940dbffc7a29d
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
9 years agoAdd left, right, top and bottom properties to basic QML rect type.
Mitch Curtis [Fri, 22 May 2015 11:03:25 +0000 (13:03 +0200)]
Add left, right, top and bottom properties to basic QML rect type.

Task-number: QTBUG-45528
Task-number: QTBUG-45530
Change-Id: I83c4056b4bde37ef2dc4424ffddd823c1654d92e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoFix flickering when QQuickWidget becomes visible
Joni Poikelin [Fri, 29 May 2015 05:13:58 +0000 (08:13 +0300)]
Fix flickering when QQuickWidget becomes visible

QQuickWidget used short delay before rendering. This caused
black area to flash on the widget briefly. Instead of scheduling
redraw, render scene immediately.

Task-number: QTBUG-46387
Change-Id: I342d96a1aaef3244190221807b0d816815697623
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoDocument the render loops a bit more
Laszlo Agocs [Wed, 27 May 2015 13:39:18 +0000 (15:39 +0200)]
Document the render loops a bit more

Task-number: QTBUG-42699
Change-Id: Ib8a1690bfe38bd0686799fac390207c26e5a6812
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
9 years agoPurge use of VisualDataModel from docs where DelegateModel is required
Alex Blasche [Thu, 28 May 2015 09:07:19 +0000 (11:07 +0200)]
Purge use of VisualDataModel from docs where DelegateModel is required

They are the same types except that VisualDataModel is deprecated
and uses a different import statement. Now, references to VisualDataModel
are only used where we explicitly refer to the replacement/deprecation.

Change-Id: I1e68eb5784235a00233b3882c3d91e21e32af7d1
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoCalqlatr Demo: Adjust ListView delegate height based on font size
Topi Reinio [Fri, 17 Apr 2015 09:11:48 +0000 (11:11 +0200)]
Calqlatr Demo: Adjust ListView delegate height based on font size

To prevent the list tem text overflowing the delegate boundary.

Task-number: QTBUG-45621
Change-Id: I46f35508ea49a2b435286de76dc9ab49620619a6
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoMakes it possible to extract all data from a QML DropArea
Aleix Pol [Sat, 23 May 2015 12:10:36 +0000 (14:10 +0200)]
Makes it possible to extract all data from a QML DropArea

There's many types that aren't being covered by DropArea API, such as
images. getDataAsString is not acceptable, since fromUtf8 chokes on
reading non-utf8.
This patch introduces getDataAsArrayBuffer method that won't try to convert
the data into a QString and simply pass a QV4::ArrayBuffer, that internally
keeps a QByteArray.

Change-Id: I65411b3d365ee6c5e13effd9167156771ee08a05
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoFix the implicitSize of SVG Images on retina display
Jocelyn Turcotte [Wed, 20 May 2015 14:29:45 +0000 (16:29 +0200)]
Fix the implicitSize of SVG Images on retina display

If the user relies on the Image implicitSize to do the layout
but still sets sourceSize to the image, the sourceSize might
be (0, 0) instead of (-1, -1).

readImage checks that the size is > 0 to use the requestedSize
and this would cause us not to use the requestedSize, but still
divide by the devicePixelRatio in QQuickImageBase::pixmapChange,
which would give a different implicitSize on retina display.

Make sure that we get the same implicitSize on both by only
keeping the targetDevicePixelRatio if sourceSize is > (0, 0)
like readImage does.

Task-number: QTBUG-38991
Change-Id: Ib93f57efa47d096f88883845985b44f62db4ad74
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
9 years agoqquickwindow: ensure we delete the correct delayed touch event after delivery
Richard Moe Gustavsen [Tue, 19 May 2015 09:20:12 +0000 (11:20 +0200)]
qquickwindow: ensure we delete the correct delayed touch event after delivery

Delivering a delayed touch event from QQuickWindow can cause the event loop
to recurse (e.g if it starts a drag'n'drop). This again can cause new touch
events to be delivered to QQuickWindow, and new delayed touch events to be
stored.

This results in the following:
    (1) Receive new touch press event in QQuickWindow, and set
        delayedTouch to be a copy of it
    (2) Deliver delayedTouch to items. This can cause an event loop
        recursion.
    (3) While inside the recursion, QQuickWindow receives another new
        touch press event. We then redeliver and delete the current
        delayedTouch event created in (1), and set delayedTouch to be
        a copy of the new event.
    (4) Later we return back from (2), and try to access
        delayedTouch (or actually a reference to the touchpoints inside
        it, qquickwindow.cpp:1958). Since the event was deleted in (3), we
        have a crash.

This patch will ensure that we set delayedTouch to 0 before delivering
it (so it cannot be redelivered), and that we safely delete it afterwards
when it goes out of scope. By converting delayedTouch to a QScopedPointer
we also ensure that the event is not leaked upon destruction.

Task-number: QTBUG-45877
Change-Id: Ic372a39a0eb127abfd12cec2d51b3743ad83194d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoFix basic and windows render loops to use the correct screen
Laszlo Agocs [Thu, 7 May 2015 17:14:23 +0000 (19:14 +0200)]
Fix basic and windows render loops to use the correct screen

GLX, and potentially other platforms too, require that compatible
contexts and surfaces are created with the same screen.

This makes Quick functional on X.org configurations where each
physical screen represents a separate X screen on the same X display.

Change-Id: I03c87819e1aee148c880a3caca13d4a0c5409056
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFix null pointer dereference in QQmlImportNamespace
Vishesh Handa [Thu, 12 Mar 2015 13:26:00 +0000 (14:26 +0100)]
Fix null pointer dereference in QQmlImportNamespace

Change-Id: Iaf61f38790b0dfddb924043e0a25eb8a882571c8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoOptionally apply orientation on images
Allan Sandfeld Jensen [Mon, 18 May 2015 08:13:48 +0000 (10:13 +0200)]
Optionally apply orientation on images

Adds the option to follow EXIF orientation. This was previuosly
automatically applied to TIFF images, but not JPEGs except in
Qt 5.4.1.

[ChangeLog][Image] An autoTransform property has been added to
control whether metadata image transforms such as EXIF orientation
are automatically applied. By default it enabled for TIFF images
and disabled for JPEG.

Change-Id: I8a4cf204985b2a7d158a0e046e52db7cda970d20
Task-number: QTBUG-37946
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoWinRT: fix warnings
Maurice Kalinowski [Tue, 19 May 2015 09:35:12 +0000 (11:35 +0200)]
WinRT: fix warnings

Change-Id: If11db499d743cbe79959145ecfcbcfec896a6845
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
9 years agoFix render loop warning about invalid geometry of exposed windows.
Friedemann Kleint [Mon, 18 May 2015 10:05:19 +0000 (12:05 +0200)]
Fix render loop warning about invalid geometry of exposed windows.

Do the screen check only for toplevel windows and make warning
more verbose.

Change-Id: Ie25271fe34c72c1410022afe8a1a9bdccdf7a12f
Task-number: QTCREATORBUG-10814
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFix MSVC warning about unused variable
Simon Hausmann [Tue, 19 May 2015 09:07:43 +0000 (11:07 +0200)]
Fix MSVC warning about unused variable

Change-Id: I9b2f21dd7cfc82a9da9aa3e4c60d47fa07fdceaf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoMSVC: Fix compiler warning
Kai Koehne [Tue, 19 May 2015 07:16:44 +0000 (09:16 +0200)]
MSVC: Fix compiler warning

Fix compiler warning introduced in commit  d76921e3082cd31:

jsruntime\qv4engine.cpp(1626) : warning C4100: 'v' : unreferenced formal parameter

Change-Id: I1f2b74f8e3fb14019f6e28b407d0336b0812c573
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
9 years agoQtQuick: Fix const correctness in old style casts
Thiago Macieira [Sat, 7 Mar 2015 22:42:59 +0000 (14:42 -0800)]
QtQuick: Fix const correctness in old style casts

Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c9589afabc7ade
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoCreate contexts and pbuffers with the correct screen in QQuickWidget
Laszlo Agocs [Thu, 7 May 2015 17:09:39 +0000 (19:09 +0200)]
Create contexts and pbuffers with the correct screen in QQuickWidget

Change-Id: I8e9db998eee0af5f62c1384f2dcb2028254cc642
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQML: fix mixed debug/release build on OSX.
Erik Verbruggen [Mon, 11 May 2015 08:16:37 +0000 (10:16 +0200)]
QML: fix mixed debug/release build on OSX.

Dyld will take the debug library and link it against the release
versions of the frameworks. (Using the debug versions is an option to
dyld when starting an application.) This requires all symbols in both
debug and release libraries in frameworks to be the same.

Change-Id: I6d96bcdf8577f1dffc63c508cb7adc0db2acc486
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoHide cursor when text fields becomes read only
Santtu Lakkala [Thu, 16 Apr 2015 13:51:45 +0000 (16:51 +0300)]
Hide cursor when text fields becomes read only

Clear the cursor node in TextEdit if field is read only. Otherwise the
cursor stays visible indefinitely, if it were at the moment the flag
was set.

Task-number: QTBUG-44735
Change-Id: Ib39138260ad8a4d7e5ed2185b8a04c577ee1eff0
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoAdd QtQuick::Text::font.weight enum values
Shawn Rutledge [Mon, 11 May 2015 09:34:08 +0000 (11:34 +0200)]
Add QtQuick::Text::font.weight enum values

Followup to 517da68893be9e6d97c7993922c573de9560604d in qtbase:
make all possible font weights available in QML.

Task-number: QTBUG-38482
Change-Id: I4f821d2fadbcd42fbb237903be474d67a0a5a7c9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoqmllint: Fix parsing js files with .import directives
Sérgio Martins [Fri, 8 May 2015 19:10:06 +0000 (20:10 +0100)]
qmllint: Fix parsing js files with .import directives

For .pragmas we removed them explicitly but the correct fix is to
not use "qmlMode" when setting code in the lexer.

Change-Id: I6ffc0ca9e7ebab09fbf91e647d292ff0a3a1fd7d
Task-number: QTBUG-45916
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoAdd protection against "wrong" marking in debug builds
Simon Hausmann [Fri, 8 May 2015 10:34:53 +0000 (12:34 +0200)]
Add protection against "wrong" marking in debug builds

To protect against situations where we accidentally mark an object that belongs
to a different engine - there are many possible entry points - this patch adds
an assertion in debug builds for this situation. When it happens, it will point
more or less directly to the code that tries to push an object to the wrong JS
stack for marking. This helped in the investigation of QTBUG-44895

Change-Id: I311b9ff6d282d52e725044b03a62cd77085536be
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoFix memory corruption when sharing QObjects between different QML engines
Simon Hausmann [Thu, 7 May 2015 14:22:24 +0000 (16:22 +0200)]
Fix memory corruption when sharing QObjects between different QML engines

When marking the JS wrappers for QObject manually, we cannot use
ddata->jsWrapper directly but we must respect the case where the same
object is exposed to different engines and then we must mark the wrapper
that belongs to the engine that is currently collecting garbage.

Change-Id: If82883c762ccaf3431e7074243ff2ff703234d66
Task-number: QTBUG-44895
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Jan Kundrát <jkt@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
9 years agoAvoid namespacing QTEST_MAIN
Rainer Keller [Fri, 8 May 2015 07:18:03 +0000 (09:18 +0200)]
Avoid namespacing QTEST_MAIN

The test tries to be smart but it won't work once GPU blacklists are
supported because QTEST_MAIN will contain some imports that cannot be
namespaced.

Change-Id: Id0538cf1ba3885736d8b177e64064bd06f8fef2e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
9 years agoAvoid uninitialized bytes in QV4::CompiledData
Simon Hausmann [Tue, 5 May 2015 11:14:36 +0000 (13:14 +0200)]
Avoid uninitialized bytes in QV4::CompiledData

When populating the QV4::CompiledData for a JS unit, we memset the malloc'ed
data to zero. We should do the same when creating a unit for QML files. We do
write all the fields that we use, but due to padding we may end up with bytes
that are neither used nor written but still uninitialized. Consequently they
should be zero'ed, otherwise serialization will write garbage.

Change-Id: I0b093e4dde6789d7236247507221f4f3476ba89d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoFix memory corruption in array handling
Simon Hausmann [Tue, 5 May 2015 08:52:34 +0000 (10:52 +0200)]
Fix memory corruption in array handling

SimpleArrayData's markObjects() implementation did not mark the entries
correctly. When the dequeue offset was non-zero, we would end up marking values
that may have been garbage collected earlier.

Task-number: QTBUG-45888
Change-Id: Iacec350ccc76399ad4d16138af50acf22b2809db
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoFix memory corruption when multiple QML engines have JavaScript wrappers for the...
Simon Hausmann [Tue, 28 Apr 2015 13:38:09 +0000 (15:38 +0200)]
Fix memory corruption when multiple QML engines have JavaScript wrappers for the same QObject

It's possible that the same QObject is exposed to multiple JavaScript
environments, for which we have this "extra" hack in the form of a QMap.  The
common case is that QQmlData has a QV4::WeakValue that points to the JS wrapper
for the object. However in the rare case of multiple exposure, a map in the
other engines stores those references. That map was erroneously storing
pointers to temporary values on the JS stack instead of heap pointers.

Change-Id: I8587f9921a9b4f9efd288326d00cebc25ad0bc12
Task-number: QTBUG-45051
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoBorderImage support for @2x assets
Andy Nichols [Thu, 6 Nov 2014 19:30:45 +0000 (11:30 -0800)]
BorderImage support for @2x assets

Despite being a subclass of QQuickImageBase, BorderImage components did
not support using @2x assets like Image components.  The 9 patch image
logic now accounts for device pixel ratio when needed.

Manual tests added for stretch, repeat and round tiling modes.

[ChangeLog][BorderImage] Add support for @2x HiDPI border images.
This means, no more need to multiply the border sizes by the device
pixel ratio.

Change-Id: I79958739929964c816ba5dacedd9eaf93a60a183
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoEnhance QQuickFramebufferObject docs regarding the state
Laszlo Agocs [Tue, 5 May 2015 09:45:31 +0000 (11:45 +0200)]
Enhance QQuickFramebufferObject docs regarding the state

Add a note about resetOpenGLState() and the initial state to render().
This tries to tackle the common issue of forgetting to set or reset the
state the custom OpenGL code relies on.

Change-Id: I706b2b1eac76468a9b35cfb7cd99bd5483f2912c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQuickWindow: Replace assert() on unreleased touch points by warning.
Friedemann Kleint [Tue, 5 May 2015 07:36:31 +0000 (09:36 +0200)]
QQuickWindow: Replace assert() on unreleased touch points by warning.

Output a warning message and clear
QQuickWindowPrivate::itemForTouchPointId should unreleased touch points
exist when QEvent::TouchEnd is received.

Task-number: QTBUG-45856
Change-Id: I8a05220e4258c0ca401f79a2c32ec4f1d43fa444
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoFix qml-i18n example
Simon Hausmann [Mon, 4 May 2015 11:49:52 +0000 (13:49 +0200)]
Fix qml-i18n example

Commit f0e285381800c0809e5bfd3a4871a2283ea10fb9 renamed the example, but
it did not adjust the context in the translations. From that point on the
context didn't match anymore and the entire example stopped working.

Change-Id: I491d518235aea07768b69c52d13b2bbf5060f61f
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix implicitHeight for Text items bindings dependent on implicitWidth.
Andrew den Exter [Thu, 23 Apr 2015 11:29:47 +0000 (21:29 +1000)]
Fix implicitHeight for Text items bindings dependent on implicitWidth.

Recalculate the implicitHeight on the second layout if the width
changes after setting the implicitWidth, and potentially do another
layout if the updating the implicitHeight changes the height.

Change-Id: Ib6a637452013b56dba7ae8a6862cd92156386578
Task-number: QTBUG-45546
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoMerge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5
Simon Hausmann [Mon, 4 May 2015 08:21:10 +0000 (08:21 +0000)]
Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5

9 years agoMerge remote-tracking branch 'origin/5.4' into 5.5
Simon Hausmann [Mon, 4 May 2015 08:20:20 +0000 (10:20 +0200)]
Merge remote-tracking branch 'origin/5.4' into 5.5

Change-Id: Ie8ea118ed0a1a9a1c3d81e1e34d85c03c695c9a4

9 years agoAvoid QQuickItem in materials's compare() on the render thread
Gunnar Sletta [Tue, 28 Apr 2015 05:45:28 +0000 (07:45 +0200)]
Avoid QQuickItem in materials's compare() on the render thread

Task-number: QTBUG-44664
Change-Id: I4438e666b75fdf2e8d4353e64454d4c665a24350
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoFix default value for XMLHttpRequest.response property
Simon Hausmann [Tue, 28 Apr 2015 14:03:07 +0000 (16:03 +0200)]
Fix default value for XMLHttpRequest.response property

The default value for responseType is the empty string, for which
the expected data type for the response property is a string - same
as when the response type is set to "text". In other words: By default
the response property should contain the string representation of the
data.

Task-number: QTBUG-45862
Change-Id: I563160e5cdfbf93aca7e283e455d77a6b9deceb4
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Reviewed-by: Valery Kotov <kotov.valery@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoCreate QOpenGLContext with the correct screen
Jan Arne Petersen [Tue, 13 Jan 2015 10:23:10 +0000 (11:23 +0100)]
Create QOpenGLContext with the correct screen

Change-Id: I91169e719ac97b8e32805e08d6a1f43caa897f73
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFix passing of locals as function arguments with side-effects
Simon Hausmann [Thu, 30 Apr 2015 11:20:43 +0000 (13:20 +0200)]
Fix passing of locals as function arguments with side-effects

Commit 75c22465cf8fe262edfe6178bb9ca19661fb710e regressed in allowing
locals and arguments to be passed directly as further arguments to function
calls, but that's incorrect when considering

    var i = 2;
    testFunction(i, i += 2)

where it is instrumental to place the first argument into a temp (making a
copy) instead of passing it directly.

Change-Id: Iffcf6c6eda92a8fb665982cda1db0b96359cd092
Task-number: QTBUG-45879
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoFix uninitialized variables/data
Simon Hausmann [Tue, 28 Apr 2015 14:53:37 +0000 (16:53 +0200)]
Fix uninitialized variables/data

* Initialize the indexOfRootObject member
* When creating the QV4::CompiledData::String objects,
  don't include the one ushort _beyond_ the QString, which
  is random data.

Change-Id: I8fe8a465e2713a385504f217b367a62b70ee5fdf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoDoc: Fix linking issues in Item QML type documentation
Topi Reinio [Mon, 27 Apr 2015 11:23:05 +0000 (13:23 +0200)]
Doc: Fix linking issues in Item QML type documentation

Use explicit link commands as QDoc cannot create links to single-word
QML type names automatically.

Task-number: QTBUG-45827
Change-Id: I048300728356d3ae9901c5c57febc683137ce090
Reviewed-by: Martin Smith <martin.smith@digia.com>
9 years agoFix rendercontrol example for screens with different dpr
Laszlo Agocs [Thu, 16 Apr 2015 13:56:33 +0000 (15:56 +0200)]
Fix rendercontrol example for screens with different dpr

renderWindow() was not reimplemented in the example. This is pretty
bad since renderWindowFor() fails to find a window and thus falls
back to using the default device pixel ratio (which is the highest
dpr present in the system). The result is broken content from Quick
because it operates with a dpr of 2 any time a retina screen is connected,
even when the example's own QWindow is placed on a normal screen.

Add also a note to the QQuickRenderControl docs because it is easy to
overlook.

Task-number: QTBUG-45613
Change-Id: I31bf92ec285f3d9867a5604a4b4e3bea73791932
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoRecreate the FBO on dpr change in rendercontrol example
Laszlo Agocs [Thu, 16 Apr 2015 13:41:26 +0000 (15:41 +0200)]
Recreate the FBO on dpr change in rendercontrol example

Even when the window size is not changing. This provides a useful
example of connecting to the screenChanged() signal.

Task-number: QTBUG-45613
Change-Id: I0652838d9c0cfec8b64b3422997159f385445b20
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoAvoid showing garbage when resizing the rendercontrol example
Laszlo Agocs [Thu, 16 Apr 2015 10:47:42 +0000 (12:47 +0200)]
Avoid showing garbage when resizing the rendercontrol example

The threaded variant was working well since that triggers a render
when resizing. The single threaded version lacked this and this
resulted in showing garbage on OS X at least since the new FBO had
undefined contents. Avoid this.

Task-number: QTBUG-45613
Change-Id: Ibb3d3f7640bab5da913df1c0c63cc3a3aaafb140
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoAvoid calling potentially pure virtual method
David Edmundson [Thu, 23 Apr 2015 13:01:24 +0000 (15:01 +0200)]
Avoid calling potentially pure virtual method

In Qt 5.4 screenChanged is called indirectly from the destructor of
QPlatformScreen. By comparing new values against the oldScreen we call
call virtual methods of QPlatformScreen from it's own destructor which
results in a crash.

This patch simply emits change signals whenever a screen change regardless
of whether the value differs from the previous screen. Arguably less
efficient, but better than crashing.

This fix is not needed in Qt 5.5 where the QPA architecture has changed.

Task-number: QTBUG-45753
Change-Id: Ic155906928855a377add9b21bff9e72b31f4667e
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
9 years agoMerge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5
Simon Hausmann [Mon, 27 Apr 2015 13:18:05 +0000 (13:18 +0000)]
Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5

9 years agoMerge remote-tracking branch 'origin/5.4' into 5.5
Simon Hausmann [Mon, 27 Apr 2015 07:52:51 +0000 (09:52 +0200)]
Merge remote-tracking branch 'origin/5.4' into 5.5

Conflicts:
.qmake.conf
tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp

Change-Id: I715b8a78b74cbe0dcaf599367fd6e08af4858e11

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: I10fd1e9f1440dcff93aed06e2c77c2912bc7dd39
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
(cherry picked from commit 54a19db8d00b67044861c8ffd1d5b1e646658609)
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoInstantiator: Make asynchronous mode work
Gabriel de Dietrich [Thu, 23 Apr 2015 09:12:08 +0000 (11:12 +0200)]
Instantiator: Make asynchronous mode work

This patch proceeds in two steps. First, and the most trivial,
we make sure not to offend the Instantiator's objects container
since asynchronous creation also means the objects can be created
in any order. We do so by ensuring the objects container has
always the necessary size.

The second step is to make sure the objects don't get destroyed by
the delegate model when their incubation tasks are asynchronous.
We force to keep an extra reference calling the object() function
on the instance model, but only if the creation was asynchronous.
However, it's not enough to check for the Instantiatior async value
since the incubation tasks in QQmlDelegateModel are async-if-nested.
Therefore, we need to keep track of the object index requested to
the model and see if it matches when the createdItem() signal gets
emitted.

Task-number: QTBUG-36410
Change-Id: I180b03b6a7468d6521827a9631755577e9e6d357
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
9 years agoMerge remote-tracking branch 'origin/5.4.2' into 5.4
Simon Hausmann [Sat, 25 Apr 2015 15:40:39 +0000 (17:40 +0200)]
Merge remote-tracking branch 'origin/5.4.2' into 5.4

Change-Id: Ie0987bcaeae5ee06e01f06ac27f0d161272720b0

9 years agoProspective fix for flakey "network" related QML tests
Simon Hausmann [Wed, 22 Apr 2015 15:15:30 +0000 (17:15 +0200)]
Prospective fix for flakey "network" related QML tests

Replace hard-coded server ports with dynamically allocated ports.

Change-Id: Iab8f9a88343a9f2c49af3cd700c954c13c3bf121
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
9 years agoAdd list of changes for 5.4.2 relative to 5.4.1
Shawn Rutledge [Fri, 24 Apr 2015 06:39:19 +0000 (08:39 +0200)]
Add list of changes for 5.4.2 relative to 5.4.1

Change-Id: I9f64f0ff3d10ced8ddc7a4aafac1c77680e3f30e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoDoc: corrected error on return value qmlRegisterType
Nico Vertriest [Tue, 21 Apr 2015 11:02:50 +0000 (13:02 +0200)]
Doc: corrected error on return value qmlRegisterType

Task-number: QTBUG-45584
Change-Id: I97508aabe47c49d8e27329a7856dd921ee0505dd
Reviewed-by: Martin Smith <martin.smith@digia.com>
9 years agoFix a memory leak in the material shader cache.
Robert Griebl [Wed, 15 Apr 2015 11:57:51 +0000 (13:57 +0200)]
Fix a memory leak in the material shader cache.

There were multiple problems in the implementation of the shader cache:
 1) it was not thread-safe
 2) nothing was ever removed from the hash
 3) since the keys into the hash are the actual shader source code, problem
    #2 would lead to serious memory consumption over time

Change-Id: I20d1fb2074932e23f89edddba12e68ab8adcbff0
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFix regression with nested objects served by custom parsers
Simon Hausmann [Wed, 22 Apr 2015 11:39:06 +0000 (13:39 +0200)]
Fix regression with nested objects served by custom parsers

The following piece of code used to work and broke with Qt 5.3:

ListModel {
    property var conn: Connection {
        ...
    }
}

When validating the properties of the ListModel we would not validate
the Connection sub-object here, which meant the custom parser for the
connection object was never called.

We need to extend the logic for sub-object validation to recursive into
sub-objects when this is either an attached property (Component.onComplete on a
list model for example) or the object is assigned to an _existing_ property,
i.e. a property not deal with by the custom parser. In this case that's a
custom declared property.

Change-Id: Ic99f746f08771460cc6424a9e8a839c78a7eafd9
Task-number: QTBUG-45735
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoMake the scenegraph_lancelot test work on Mac
Eirik Aavitsland [Tue, 14 Apr 2015 11:30:36 +0000 (13:30 +0200)]
Make the scenegraph_lancelot test work on Mac

Grabbing the window after every frame is needlessly expensive and
would overload a less powerful Mac. Rewrote the grabber to just do the
necessary grabs.

Make the hostinfo script not output the unneeded '[undefined]' value
for unset environment variables, as the braces would upset the paths
in the html report.

Change-Id: I76104235c15eafd5e7f92f2ec01c84f5b11b55a6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years ago[labs.settings] Minor optimization
Konstantin Ritt [Mon, 20 Apr 2015 08:07:18 +0000 (12:07 +0400)]
[labs.settings] Minor optimization

Prefer clear() over subsequent erase() and remove duplicated check.

Change-Id: Ibc70c665972e2f972763e7a0088263815792a997
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoV4: include alloca private header as alloca is used unconditionally.
Pasi Petäjäjärvi [Wed, 22 Apr 2015 12:28:21 +0000 (15:28 +0300)]
V4: include alloca private header as alloca is used unconditionally.

Change-Id: I9d0f63c41609c4aaef272fabafd5b1272853a099
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoQtQml.Models: bump up the import version number to 2.2
J-P Nurmi [Mon, 20 Apr 2015 13:59:08 +0000 (15:59 +0200)]
QtQml.Models: bump up the import version number to 2.2

The latest version is 2.2 since 4ca9be5.

Change-Id: I19014c26301a67f2ce2ef93d7bab124a65337b59
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
9 years agoAdd plugins.qmltypes for QtQml.Models
J-P Nurmi [Mon, 20 Apr 2015 12:56:36 +0000 (14:56 +0200)]
Add plugins.qmltypes for QtQml.Models

Task-number: QTBUG-43229
Task-number: QTCREATORBUG-13780
Change-Id: Ice39a26809eb433a01205bae5cea9cfdc0699c27
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
9 years agoadd manual tests for touch interaction
Shawn Rutledge [Wed, 18 Feb 2015 08:23:32 +0000 (09:23 +0100)]
add manual tests for touch interaction

So far there are manual tests for Flickable and
MultiPointTouchArea.  It can be expanded later.

Change-Id: Ifa838b68f137a49647a208dc15f22c90f1e02d1f
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoXCB: respect QPlatformDrag::ownsDragObject().
Mitch Curtis [Tue, 21 Apr 2015 11:41:33 +0000 (13:41 +0200)]
XCB: respect QPlatformDrag::ownsDragObject().

In a Qt Quick application on X11, QDrag events were deleted before
their data could be passed to an external application. There was a
function introduced recently to account for this problem, so we should
use that instead.

Change-Id: If74dd32bb8c7aa7c2e3160448af546d2e8640528
Task-number: QTBUG-45604
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
9 years agoqmlplugindump: add dependencies
Marco Benelli [Tue, 17 Mar 2015 15:33:14 +0000 (16:33 +0100)]
qmlplugindump: add dependencies

Change-Id: I53b2a394ba1f6c8a7a88f7456fba8646cdf35bf4
Task-number: QTBUG-41079
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoQML: do not check stack size if stack grows up
Rolf Eike Beer [Wed, 4 Feb 2015 12:24:53 +0000 (13:24 +0100)]
QML: do not check stack size if stack grows up

On architectures where the stack grows upwards (i.e. HP PA-RISC) the
stack limit calculation fails because the variables used to check the
offset are usually close to the bottom of the stack, which is in this
case the origin of the stack grows. Since these machines are a rare
obscurity simply assume that everything is fine on these machines. The
few people that are indeed running QML on such machines will probably
be able configure their stack size properly by default.

Task-number: QTBUG-44268
Change-Id: Ia83a39179a0f6e0602ba7a5032d386e12d8d1ba3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoEliminate remaining property cache string lookups upon object instantiation
Simon Hausmann [Mon, 13 Apr 2015 11:46:40 +0000 (13:46 +0200)]
Eliminate remaining property cache string lookups upon object instantiation

Even for the id property binding we can use the property data cache and
therefore avoid string hashing.

Change-Id: Id9a4ca3159cdfe5ba93060f1bc8626e70140daa1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoSpeed up instantiation of objects that are assigned to list properties
Simon Hausmann [Fri, 10 Apr 2015 08:13:04 +0000 (10:13 +0200)]
Speed up instantiation of objects that are assigned to list properties

For example massive amount of Item{} objects that are "children" of another
item and thus get assigned to the default data list property. Instead of
repeatedly retrieving that list property via a meta-call, we can do that only
once and re-load if necessary.

Change-Id: Ia7d10b84b3c7dca58d9f0b4b2138bd6f916c128d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>