platform/upstream/qtdeclarative.git
9 years agoMerge remote-tracking branch 'origin/5.5' into dev
Frederik Gladhorn [Tue, 3 Mar 2015 17:13:37 +0000 (18:13 +0100)]
Merge remote-tracking branch 'origin/5.5' into dev

Change-Id: I94f8ae93d76bd5c120de25d9c238701afe8bfbd0

9 years agoUse of fullsize distance field textures should be font-dependent.
Michael Brasser [Mon, 2 Mar 2015 22:32:50 +0000 (16:32 -0600)]
Use of fullsize distance field textures should be font-dependent.

This shouldn't be a static decision as the glyph count depends on the
font.

Change-Id: I67ea98595505df4a3a30b16e867e76f89b28c1ef
Task-number: QTBUG-29264
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoExport QQuickItemViewTransitioner & friends privately
J-P Nurmi [Sun, 8 Feb 2015 22:29:59 +0000 (23:29 +0100)]
Export QQuickItemViewTransitioner & friends privately

This allows the future C++ version of QtQuick.Controls.StackView to run
proper QtQuick Transitions instead of having to run Animations by hand.

Change-Id: I259e940ed496d3449bccb2b8cca607742a703777
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoV4: fix regalloc for loops with many life&changing vars.
Erik Verbruggen [Mon, 2 Mar 2015 13:35:28 +0000 (14:35 +0100)]
V4: fix regalloc for loops with many life&changing vars.

When all registers are in use, and one needs to be spilled, the register
whose use is the furthest in the future will be chosen. What needs to be
taken into account is that any use that can also work from the stack can
be skipped, because it does not require the value to be in a register.

Task-number: QTBUG-44687
Change-Id: Ide624b190603d9a22f992d4ae5daa3ce8d94472c
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
9 years agoV4: fix phi node use position calculation.
Erik Verbruggen [Mon, 2 Mar 2015 13:22:24 +0000 (14:22 +0100)]
V4: fix phi node use position calculation.

As phi-nodes get transformed into moves, and the moves end up right
before the terminator of the basic block of the incoming edge, the
use by that phi-node is the position of that terminator minus one.

However, when checking if uses need a register, this was not taken into
account, resulting in an invalid life-time interval split position
calculation.

Task-number: QTBUG-44687
Change-Id: I0edd416f7ee5c8ea16bf7133870be45d0e6efea9
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
9 years agoMove memory management related functionality into it's own folder
Lars Knoll [Thu, 12 Feb 2015 20:16:42 +0000 (21:16 +0100)]
Move memory management related functionality into it's own folder

Start moving the memory related functionality into it's own folder.
This will simplify refactoring of the GC related functionality later
on.

Change-Id: I70ec6f512af7a7897625afb84d914c17572b0ccd
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoIntroduce a Heap::Pointer class
Lars Knoll [Thu, 12 Feb 2015 20:03:53 +0000 (21:03 +0100)]
Introduce a Heap::Pointer class

This is required to properly mark pointers to other heap
objects, as well as to have a single point where to implement
a write barrier later on.

Change-Id: I7d57044f1a306ca8da8183793635ed49a3637146
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoAvoid assert in rich text when img width is invalid
Eskil Abrahamsen Blomfeldt [Mon, 2 Mar 2015 12:17:04 +0000 (13:17 +0100)]
Avoid assert in rich text when img width is invalid

If you set the width or height of an <img> tag to something
invalid, this will be registered as -2 by the HTML parser.
We should treat this case the same as if there is no width/height
specified and use the implicit size instead.

[ChangeLog][Text] Fixed assert when setting an invalid width or
height on an <img> tag in a text element.

Change-Id: Iae8c33fa184316632f72318e71f26ab005645a21
Task-number: QTBUG-44743
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agotestlib: Introduce MouseDoubleClickSequence() method
Caroline Chao [Fri, 27 Feb 2015 11:11:58 +0000 (12:11 +0100)]
testlib: Introduce MouseDoubleClickSequence() method

The existing method MouseDoubleClick() emulates the mouse
double click event only.

The added method MouseDoubleClickSequence() emulates the full
sequence of mouse events a physical double-click would generate:
Press-Release-Press-DoubleClick-Release

Introducing a new method in order to provide convenience when a
test requires to simulate a complete double-click action without
changing the behavior of MouseDoubleClick() and risking to break
existing tests.

Add autotest.

Task-number: QTBUG-42185
Change-Id: I1cdddd9e21d3b1d8a818f6d4e3717b06b7d70e08
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoQQuickWindow: rename deliverGestureEvent to deliverNativeGestureEvent
Shawn Rutledge [Fri, 27 Feb 2015 07:14:49 +0000 (08:14 +0100)]
QQuickWindow: rename deliverGestureEvent to deliverNativeGestureEvent

Native gestures are distinct from QGestureEvent, and we might need
another deliver method for those eventually.

Change-Id: I969c9b830d1dc7a91ffbc6cae2bdb68552a58344
Reviewed-by: Andrew Knight <qt@panimo.net>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoQQuickWindow: move deliverGestureEvent outside QT_NO_WHEELEVENT section
Shawn Rutledge [Fri, 27 Feb 2015 07:11:20 +0000 (08:11 +0100)]
QQuickWindow: move deliverGestureEvent outside QT_NO_WHEELEVENT section

Turning off support for wheel events does not affect gesture support.

Change-Id: I64a110327179d62a69864979396b92472c53285e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Andrew Knight <qt@panimo.net>
9 years agoQtQuick: Micro-optimize iterator loops.
Friedemann Kleint [Mon, 23 Feb 2015 12:45:44 +0000 (13:45 +0100)]
QtQuick: Micro-optimize iterator loops.

Avoid repeated instantiation of end() in loops, use variable instead.

Change-Id: I6ab1fe2b82406d5ee91710a0333587ffb82c04d4
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
9 years agoQtQml: Micro-optimize iterator loops.
Friedemann Kleint [Mon, 23 Feb 2015 12:44:12 +0000 (13:44 +0100)]
QtQml: Micro-optimize iterator loops.

Avoid repeated instantiation of end() in loops, use variable instead.

Change-Id: I3bb1c6918cfd16a5dcefbcc03c442e99fe9bf76b
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
9 years agoOptimize distance field construction.
Michael Brasser [Fri, 20 Feb 2015 13:50:45 +0000 (07:50 -0600)]
Optimize distance field construction.

Reduce the number of times we construct a painter path from a glyph.

Change-Id: Ic1f32c78ab5dfd3b75d5442da163cda1dedab3ee
Task-number: QTBUG-42853
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoInclude <limits> in qqmlprofilerservice_p.h
Ulf Hermann [Fri, 20 Feb 2015 12:37:09 +0000 (13:37 +0100)]
Include <limits> in qqmlprofilerservice_p.h

As we use std::numeric_limits in that file we should do this.

Change-Id: Idd8da16ce062b2ef24f926bcf33de95559464bb9
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoAllow glyph cache textures to be created at full size.
Michael Brasser [Tue, 24 Feb 2015 15:29:15 +0000 (09:29 -0600)]
Allow glyph cache textures to be created at full size.

On embedded hardware, texture resizes can be quite slow. The glyph
cache currently often needs to resize when new glyphs are added, and
glyph additions are very frequent when using a language with a large
set of glyphs (such as Chinese).

The current glyph cache design minimizes the amount of memory used.
When QSG_PREFER_FULLSIZE_GLYPHCACHE_TEXTURES is set, and we are using
a font with a large number of glyphs, we can instead allocate max-sized
textures. This leads to significantly less time when inserting glyphs
into the cache (often incurred over a span of time), at the cost of
higher initial memory and creation times (often incurred at
application startup).

Change-Id: Id1021b9d213e5f8635c4197b624474f28c6f44ff
Task-number: QTBUG-29264
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
9 years agoMerge remote-tracking branch 'origin/5.4' into 5.5
Frederik Gladhorn [Tue, 24 Feb 2015 16:36:04 +0000 (17:36 +0100)]
Merge remote-tracking branch 'origin/5.4' into 5.5

Conflicts:
.qmake.conf
LICENSE.GPLv2
examples/qml/networkaccessmanagerfactory/view.qml
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4stringobject.cpp

Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32

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 agoHandle TouchCancel events in QQuickPinchArea
Aaron McCarthy [Wed, 18 Feb 2015 05:53:09 +0000 (15:53 +1000)]
Handle TouchCancel events in QQuickPinchArea

QQuickPinchArea did not handle TouchCancel events and would recursively
call QQuickItem::event(). Cancel the pinch gesture by restoring the
pinch state to the start state. Don't recursively call
QQuickItem::event(), instead call QQuickItem::touchEvent() for
unhandled touch events.

[ChangeLog][QtQuick][PinchArea] Fix infinite recursion when TouchCancel
events are received.

Change-Id: Ifce4af91aec4285873cb701069e007bcee180851
Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
9 years agoFix deprecation warnings about constructing QString from const char*.
Friedemann Kleint [Mon, 16 Feb 2015 12:08:40 +0000 (13:08 +0100)]
Fix deprecation warnings about constructing QString from const char*.

types/qqmlmodelindexvaluetype.cpp: In static member function 'static QString QQmlModelIndexValueType::propertiesString(const QModelIndex&)':
types/qqmlmodelindexvaluetype.cpp:47:56: warning: 'QString::QString(const char*)' is deprecated (declared at qstring.h:649) [-Wdeprecated-declarations]
items/qquickimagebase.cpp: In member function 'virtual void QQuickImageBase::load()':
items/qquickimagebase.cpp:213:49: warning: 'QString::QString(const char*)' is deprecated (declared at qstring.h:649) [-Wdeprecated-declarations]
items/qquickimagebase.cpp:213:88: warning: 'QString::QString(const char*)' is deprecated (declared at qstring.h:649) [-Wdeprecated-declarations]

Change-Id: I03266aba589ade8228bc286cd3f3f237cd06a780
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
9 years agoFix MSVC 64 bit warnings about loss of data when converting from 'size_t' to 'int'.
Friedemann Kleint [Wed, 18 Feb 2015 09:08:24 +0000 (10:08 +0100)]
Fix MSVC 64 bit warnings about loss of data when converting from 'size_t' to 'int'.

jsruntime\qv4arraybuffer.cpp(94) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
jsruntime\qv4persistent.cpp(53) : warning C4267: 'initializing' : conversion from 'size_t' to 'const int', possible loss of data

Change-Id: I6ccef9a64ecfb53b18204b35e17421c0a5ac955b
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 agoFix some qdoc-warnings.
Friedemann Kleint [Fri, 20 Feb 2015 13:48:46 +0000 (14:48 +0100)]
Fix some qdoc-warnings.

qtdeclarative/src/quick/scenegraph/coreapi/qsgmaterial.cpp:384: warning: Class RenderState has no \inmodule command; using project name by default: QtQuick
qtdeclarative/src/quick/scenegraph/util/qsgsimplerectnode.cpp:39: warning: Class QSGSimpleRectNode has no \inmodule command; using project name by default: QtQuick
qtdeclarative/src/quick/scenegraph/util/qsgtextureprovider.cpp:38: warning: Class QSGTextureProvider has no \inmodule command; using project name by default: QtQuick
qtdeclarative/src/quick/items/qquickwindow.cpp:3156: warning: Cannot find 'closing(...)' in '\fn' void QQuickWindow::closing()
qtdeclarative/src/quick/items/qquickwindow.h:160: warning: No documentation for 'QQuickWindow::closing()'
qtdeclarative/src/quick/items/qquickwindow.cpp:3134: warning: Can't link to 'Window.closing()'
qtdeclarative/src/qml/qml/qqmlfileselector.cpp:90: warning: Undocumented parameter 'parent' in QQmlFileSelector::QQmlFileSelector()

Change-Id: I42cf1e06c9e7a63327acc470bd33a726acc69bfc
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.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 agoremove unnecessary LICENSE.GPLv2
Jani Heikkinen [Tue, 7 Oct 2014 07:50:57 +0000 (10:50 +0300)]
remove unnecessary LICENSE.GPLv2

Change-Id: Iea5465791b2ac3b0303ffbae5378c43d8ae2f130
Reviewed-by: Iikka Eklund <iikka.eklund@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 agodocs: Add a link to Drag and DropArea in MouseArea's drag section
Sérgio Martins [Sun, 15 Feb 2015 12:13:03 +0000 (12:13 +0000)]
docs: Add a link to Drag and DropArea in MouseArea's drag section

They are related subjects so deserve a mention.

Change-Id: I52f338402c8568f54dfd4b91845f9fafa762ca4d
Reviewed-by: Alan Alpert <aalpert@blackberry.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 agoUpdate url location for missing Qt logo
Sergio Ahumada [Thu, 12 Feb 2015 13:17:03 +0000 (14:17 +0100)]
Update url location for missing Qt logo

Change-Id: I21084651044f1db0c7863f2121431dffec8526e3
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
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 agoDoc: fix example
Joerg Bornemann [Thu, 12 Feb 2015 16:39:34 +0000 (17:39 +0100)]
Doc: fix example

Change-Id: I818e0a3235060fa48c61d4f21f1202d976b15d5e
Task-number: QTBUG-38456
Reviewed-by: Topi Reiniö <topi.reinio@digia.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 agoFix width/height property assignment during animations.
Aaron McCarthy [Thu, 12 Feb 2015 05:36:44 +0000 (15:36 +1000)]
Fix width/height property assignment during animations.

During animations the behavior of

anchors.fill: parent

and

width: parent.width
height: parent.height

can be different resulting in subtle UI bugs where the final value of a
property is not applied because it is within epsilon of the previous
value. Fixed by directly comparing the width and height instead of
using operator==(QSize, QSize) which does a fuzzy comparison.

Change-Id: I4288b93db2b7baacd9f71ae1932ae743a428313a
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
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 agoFix QML Timer running not being updated together with triggered signal
Troels Nilsson [Wed, 21 Jan 2015 13:18:35 +0000 (14:18 +0100)]
Fix QML Timer running not being updated together with triggered signal

The running property of the QML Timer should be updated at the same
time as the triggered signal is emitted, otherwise code like e.g. the following:
    if (qmlTimer.running)
    {
        qmlTimer.stop()
    }
doesn't work as expected. In addition if the timer is stopped or restarted
between posting the QEvent_Triggered event and receiving it, the triggered
event should not be emitted. This avoids the issue of stopped timers still
emitting the triggered signal which can potentially cause problems in
existing code.

Task-number: QTBUG-44026
Change-Id: Ia14d80d152967d09adc1586467715b2e1c6662cc
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
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 agobic: Add/Replace 5.{0,1,2,3,4}.0 bic data for linux-gcc-amd64
Sergio Ahumada [Tue, 3 Feb 2015 17:14:41 +0000 (18:14 +0100)]
bic: Add/Replace 5.{0,1,2,3,4}.0 bic data for linux-gcc-amd64

Remove the ia32 data since there are no linux x86 machines in
the CI system (which makes the data useless from an automated
testing point of view) and most people use x64 these days anyway.

Change-Id: I6aa1106bf6406c8338e2ffcf89436338c19b1ee5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
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 agoMerge "Merge remote-tracking branch 'origin/5.4.1' into 5.4" into refs/staging/5.4
Frederik Gladhorn [Tue, 10 Feb 2015 21:27:43 +0000 (21:27 +0000)]
Merge "Merge remote-tracking branch 'origin/5.4.1' into 5.4" into refs/staging/5.4

9 years agoUpdate C++11 warning logic from QtWebKit
Allan Sandfeld Jensen [Fri, 30 Jan 2015 10:54:44 +0000 (11:54 +0100)]
Update C++11 warning logic from QtWebKit

Fixes compatibility with gcc 5.0.

Change-Id: I017c6d690c1f64359c3bac6c8b6b0f5e089861eb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
9 years agoMerge remote-tracking branch 'origin/5.4.1' into 5.4
Frederik Gladhorn [Tue, 10 Feb 2015 09:34:35 +0000 (10:34 +0100)]
Merge remote-tracking branch 'origin/5.4.1' into 5.4

Change-Id: I127c746c4131fc907ea4b6713d307f12a4760666

9 years agoFix crash when invalidating qqmltypeloader
Daiwei Li [Fri, 23 Jan 2015 22:33:35 +0000 (14:33 -0800)]
Fix crash when invalidating qqmltypeloader

Change-Id: I16db2ea9a6c25d26e2b803b9bb8d9ef7156e254d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoReplace blog.qt.digia.com with blog.qt.io
Sergio Ahumada [Fri, 6 Feb 2015 12:58:48 +0000 (13:58 +0100)]
Replace blog.qt.digia.com with blog.qt.io

Change-Id: I2518576bbe2ca9f68928973ea83b9e58084b91e3
Reviewed-by: Tero Kojo <tero.kojo@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoDoc: fix a file name of an image
Liang Qi [Fri, 6 Feb 2015 10:09:40 +0000 (11:09 +0100)]
Doc: fix a file name of an image

Change-Id: I6c93fd9d97649eee819a48863b92bde533dabe63
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
9 years agoFix regression where QQuickScreenAttached overwrites QScreen values
Albert Astals Cid [Fri, 6 Feb 2015 09:40:03 +0000 (10:40 +0100)]
Fix regression where QQuickScreenAttached overwrites QScreen values

Up to Qt 5.3 it was fine setting the orientationUpdateMask in
QScreen in C++, with 5.4 that value is always discarded and overwrote
with 0, this change makes it possible to still set the orientationUpdateMask
value in C++ and not have it overwritten unless specifically changed from QML

Change-Id: I134290ce91be8b91df4e9e8e71120753813f48d7
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
9 years agoFix crash when QQuickWindow::updatePolish() deletes QQuickItems.
Gunnar Sletta [Thu, 5 Feb 2015 11:00:00 +0000 (12:00 +0100)]
Fix crash when QQuickWindow::updatePolish() deletes QQuickItems.

When an item is deleted as a result of an updatePolish() call, it will
be removed from the itemsToPolish set. However, updatePolish()
internally works on a copy of the itemsToPolish set because changes to
the set would invalidate its iterator. Because it is a copy will still
contain the deleted item.

Fix this by simplifying the algorithm to instead pick items one by
one from the itemsToPolish set until it is empty. The recursion guard
has been increased because we're not decrementing it for every single
QQuickItem::updatePolish() call.

Task-number: QTBUG-42913
Change-Id: If7ab7f7616b01daf4d3ed843f927c163dfb03843
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
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 agoAdd list of changes for 5.4.1 relative to 5.4.0 v5.4.1
Simon Hausmann [Fri, 30 Jan 2015 08:54:53 +0000 (09:54 +0100)]
Add list of changes for 5.4.1 relative to 5.4.0

Change-Id: I2ea7f237ffb4af6445e62178f824421104be1f1d
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
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 agoDoc: link issues qtdeclarative
Nico Vertriest [Mon, 2 Feb 2015 11:43:49 +0000 (12:43 +0100)]
Doc: link issues qtdeclarative

Task-number: QTBUG-43810
Change-Id: I154ffa83512435c3e455937a3f81931a45d9e368
Reviewed-by: Martin Smith <martin.smith@digia.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 agoTextInput: update the baseline offset when vertical alignment changes
J-P Nurmi [Tue, 3 Feb 2015 16:26:08 +0000 (17:26 +0100)]
TextInput: update the baseline offset when vertical alignment changes

Change-Id: I2153e879c7ad8b770d5ca47dac68f994bb171b2d
Reviewed-by: Alan Alpert <aalpert@blackberry.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 Text wrapping when growing from 0 width.
Michael Brasser [Mon, 2 Feb 2015 17:23:31 +0000 (11:23 -0600)]
Fix Text wrapping when growing from 0 width.

The fix for QTBUG-30896 caused a regression in the test case. Now check
both width and implicit width validity before resetting widthExceeded.

Change-Id: I4aba2aad299746906cfe20e288fa60cfe2acc64f
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
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 agoqquicktest: Wait for the view to finish loading
Daiwei Li [Fri, 23 Jan 2015 22:42:33 +0000 (14:42 -0800)]
qquicktest: Wait for the view to finish loading

Tests can be skipped if the view is still loading by the time we get
to the end of the loop. There is a case where the window is active
but the QML hasn't been loaded.

Change-Id: I4e8346ee547653810458d042925d673748c1fec8
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoFix possible crash when removing items from QQmlDelegateModel
Daniel Vrátil [Wed, 28 Jan 2015 18:09:04 +0000 (19:09 +0100)]
Fix possible crash when removing items from QQmlDelegateModel

When iterating over the cache in QQmlDelegateModel::_q_itemsRemoved(), removing
of some of the items can trigger layout change in the view, which might in turn
remove a QQmlDelegateModelItem from the cache, causing us to dereference an
already deleted pointer.

To prevent crash, we always check whether the item is still valid in the original
cache and skip it if it has been removed in the meanwhile.

Task-number: QTBUG-34351
Change-Id: Ib91a0544e11dbd7bf6d82fa4dc4400cac9d0b5f7
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
9 years agoDoc: Fixed a broken link about sprite sheet script
Liang Qi [Wed, 7 Jan 2015 22:04:36 +0000 (23:04 +0100)]
Doc: Fixed a broken link about sprite sheet script

Change-Id: Ia574bee49f9c509c83bf9818442fbd314a0259b7
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
9 years agoFix vertical positioning of the first image in Text
Joni Poikelin [Wed, 19 Nov 2014 13:25:02 +0000 (15:25 +0200)]
Fix vertical positioning of the first image in Text

Task-number: QTBUG-38528
Change-Id: Ie16000cf9ba20598da51683751a8fb62798a1322
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
9 years agoDoc: add missing "winrt" & "winphone" to Qt.platform.os
J-P Nurmi [Thu, 29 Jan 2015 13:14:54 +0000 (14:14 +0100)]
Doc: add missing "winrt" & "winphone" to Qt.platform.os

Change-Id: Idc252cc0303ffd7e8259cd9bf19a05a643657600
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
Reviewed-by: Karim Pinter <karim.pinter@digia.com>
9 years agoDoc: fix Qt.platform.os since -tag
J-P Nurmi [Thu, 29 Jan 2015 13:15:35 +0000 (14:15 +0100)]
Doc: fix Qt.platform.os since -tag

Change-Id: I623ae8818d6d8f10faec2f823c4d27a37d8fecda
Reviewed-by: Caroline Chao <caroline.chao@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 agoVerify context creation in Quick tests.
Friedemann Kleint [Mon, 26 Jan 2015 08:25:15 +0000 (09:25 +0100)]
Verify context creation in Quick tests.

Verify initialization steps and initialize pointers to avoid
crashes.

Change-Id: I2d3a53c6719727aed56e673d0d8cf5a02ae0f0f6
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoQQuickTextItem: fix crash on polishing
Giuseppe D'Angelo [Mon, 26 Jan 2015 14:40:29 +0000 (15:40 +0100)]
QQuickTextItem: fix crash on polishing

The "d->extra" pointer is lazily allocated, hence we must check if it's
valid before dereferencing it.

Task-number: QTBUG-44128
Change-Id: Id69c91e889193b0e9b73ed178c0ff3b13003227f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.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 agoDon't crash on FreeBSD when computing stack limits
Alex Richardson [Wed, 21 Jan 2015 09:10:01 +0000 (09:10 +0000)]
Don't crash on FreeBSD when computing stack limits

On FreeBSD pthread_attr_t is a pointer and is dereferenced when calling
pthread_attr_get_np() so if we don't initialize it will probably crash.
This is not a problem on glibc systems since there pthread_attr_t is an
opaque union an doesn't need to be allocated using malloc().

Change-Id: I227685ddf9981974ade08aee8917f7262c301787
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
9 years agoEnsure that Canvas has the correct size with complex bindings.
Mitch Curtis [Tue, 27 Jan 2015 17:09:56 +0000 (18:09 +0100)]
Ensure that Canvas has the correct size with complex bindings.

When a Canvas is a child of an item with certain width and height
values (as described in the bug report), it won't paint correctly.

For example, the order of events might occur like so:

1. Canvas width set to 1
2. Canvas height set to 1
3. Canvas width set to 32, which causes the height to also be set to 32

Every size change causes QQuickCanvasItem::geometryChanged() to be
called, but the third event above causes it to be called recursively,
such that the most nested call results in the size being 32x32, but
then the execution returns to the first call and 32x1 is used instead,
overwriting the correct size.

We fix this by setting the new canvas size to width() and height(),
ignoring the recursion and instead using the latest size of the item.

Change-Id: Iebbcbfaa3217319b32b97f6b68f7a8af197a0e89
Task-number: QTBUG-42878
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoDoc fix: QHistoryState is registered in QML as HistoryState
Pierre Rossi [Tue, 27 Jan 2015 12:29:49 +0000 (13:29 +0100)]
Doc fix: QHistoryState is registered in QML as HistoryState

The documentation enum values should reflect that.

Task-number: QTBUG-44088
Change-Id: I0042da252eac10301fff4289402f158a7b0d0ff6
Reviewed-by: Simon Hausmann <simon.hausmann@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 agoCanvas: don't crash when getContext("2d") is called on destruction.
Mitch Curtis [Mon, 26 Jan 2015 14:53:15 +0000 (15:53 +0100)]
Canvas: don't crash when getContext("2d") is called on destruction.

We'd assume that a Window existed when that's not always the case.
For example:

import QtQuick 2.4
import QtQuick.Window 2.2
Window {
    Loader {
        sourceComponent: Canvas {
            Component.onDestruction: getContext("2d")
        }
        Component.onCompleted: active = false
    }
}

Change-Id: I5f30876e21ced5658adfa3bac494fd4196e0a7e3
Task-number: QTBUG-42222
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
9 years agoAvoid sRGB usage when targeting an incapable FBO
Laszlo Agocs [Mon, 19 Jan 2015 17:06:07 +0000 (18:06 +0100)]
Avoid sRGB usage when targeting an incapable FBO

Native text rendering results in very different output on OS X
with QQuickWidget/QOpenGLWidget. When targeting an FBO, enabling
sRGB is futile if the FBO was not created with the correct format.
In this case we need to disable the usage of sRGB.

Task-number: QTBUG-42861
Change-Id: I887482e70be2cbfba40d6758546128d03b36def1
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
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>