platform/upstream/qtdeclarative.git
9 years agoBasic support for typed arrays
Lars Knoll [Thu, 11 Sep 2014 13:37:31 +0000 (15:37 +0200)]
Basic support for typed arrays

This implements most of the spec required for the
Khronos typed array specification.

It tries to follow ECMAScript 6 as closely as possible,
but currently only implements a subset of the ECMAScript
6 specification.

Addes a test script in tests/manual/v4 to test our
implementation.

Change-Id: I8ec63869500358e088b73240e1f37120ae3cf59a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoImplement DataView
Lars Knoll [Wed, 10 Sep 2014 14:39:23 +0000 (16:39 +0200)]
Implement DataView

The second class that is required for typed
array support.

Change-Id: Idc2dcec7c1eee541f76dc5ab1aea6057ba03cb93
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoImplement ArrayBuffer
Lars Knoll [Wed, 10 Sep 2014 12:50:28 +0000 (14:50 +0200)]
Implement ArrayBuffer

This is the first class required to support typed
arrays in our JS engine.

Change-Id: I0fe1e1ca430769c171912dda207cfae772e9b9db
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix subscript and superscript for QQuickText
Joni Poikelin [Wed, 8 Oct 2014 05:07:09 +0000 (08:07 +0300)]
Fix subscript and superscript for QQuickText

Task-number: QTBUG-32948
Change-Id: I4920015b2604afbd9e2050f0225de98d5188d589
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
9 years agoQQuickParticleSystem: Use QVector instead of QList.
Robin Burchell [Fri, 17 Oct 2014 23:37:24 +0000 (01:37 +0200)]
QQuickParticleSystem: Use QVector instead of QList.

This is more efficient, for the use we're seeing. In addition, reserve the size
in advance, to avoid reallocations.

Change-Id: I987ee7cea1aa32c4b1aad1246b6e22b87efd9cc6
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQuickParticleSystem: Micro-optimize m_emitters' handling of null pointers.
Robin Burchell [Fri, 17 Oct 2014 23:32:05 +0000 (01:32 +0200)]
QQuickParticleSystem: Micro-optimize m_emitters' handling of null pointers.

This shaves off around 35ms from samegame setup of a large game.

Change-Id: I91cb7e8d8db5da672e0dcf30a3c0bb0fa855c93f
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQuickParticleSystem: Optimize hash manipulation.
Robin Burchell [Fri, 17 Oct 2014 23:26:53 +0000 (01:26 +0200)]
QQuickParticleSystem: Optimize hash manipulation.

Before even checking the hash, perform the fast (empty string) check.

If it's not empty, then do a single hash lookup, not two of them. There's no
point doing a second lookup, since if it doesn't exist, we insert anyway.

This takes hash manipulation on samegame on a large screen from ~142ms to ~70ms,
which is expected.

Change-Id: I4e2a099e996f2f5fb95a5b066d7756373a1dbacd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFix newly added qquickitem_before_paintNode() implementation.
Gunnar Sletta [Mon, 20 Oct 2014 07:23:28 +0000 (09:23 +0200)]
Fix newly added qquickitem_before_paintNode() implementation.

Bug spotted after the fact with lancelot.

Change-Id: Id9b2d2577658f772f3083b1396f61710a950f83b
Reviewed-by: aavit <eirik.aavitsland@digia.com>
9 years agoRemove the "groupNode"
Gunnar Sletta [Thu, 16 Oct 2014 08:02:11 +0000 (10:02 +0200)]
Remove the "groupNode"

We originally had the groupnode to simplify adding and removing clip /
effect / opacity nodes to the item tree at a time when the renderer
was a bit more trivial and only did a single pass over the tree during
rendering. The runtime cost at the time was negligible. The
QSGBatchRenderer has a bit more logic, so the extra node now costs a
bit more. In addition to extra memory, we need to allocate shadow
nodes for it and put those into the renderer's internal shadownode
hash.

This removal increases the performance of adding / removal of simple
items by ~10% in addition to reducing the number of nodes in the
scene graph by up to 1/3.

Change-Id: I8cd64984f868d75820e25d33dfdbebd4d20651fe
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoIntroduced QQuickCustomRenderStage.
Gunnar Sletta [Tue, 30 Sep 2014 09:26:45 +0000 (11:26 +0200)]
Introduced QQuickCustomRenderStage.

The purpose of this concept is to make it possible to plug in an
external rendering stage, like replacing the GL rendering with a
composition step performed by a hardware compositor in QtCompositor.

Change-Id: I994b93af443f68a77ca73cf310b5910c49e014c3
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoOnly delete all child nodes twice if effectRefEffectivelyChanged is set.
Robin Burchell [Tue, 14 Oct 2014 10:17:28 +0000 (12:17 +0200)]
Only delete all child nodes twice if effectRefEffectivelyChanged is set.

We already handle ChildrenUpdateMask again in the general case below, so this
second clear doesn't make sense, *but* for the fact that we are modifying
groupNode here when effectRefEffectivelyChanged is set. So keep doing it for
that case.

As a nice side-effect, this means that groupNode is not always allocated.

Also, don't fetch groupNode redundantly if we are clearing nodes.

Task-number: QTBUG-34255
Change-Id: Icc01b942d3c09c17300e19d61e9a65f220004796
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoUse QWindow::requestUpdate in threaded renderloop.
Gunnar Sletta [Tue, 30 Sep 2014 19:32:17 +0000 (21:32 +0200)]
Use QWindow::requestUpdate in threaded renderloop.

The default implementation is the same as what we do with the exhaust
delay, but it is now possible for platforms to line it up with vsync
so the GUI thread doesn't spend so much time being blocked.

Change-Id: Ie126f00a1be978608bf2a1db33d80d7f0458590d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoResolve QQuickItemPrivate::beforePaintNode dynamically.
Gunnar Sletta [Wed, 15 Oct 2014 06:40:20 +0000 (08:40 +0200)]
Resolve QQuickItemPrivate::beforePaintNode dynamically.

It will be the 0 unless the item has a direct child with negative z,
which occurs very rarely.  Its presence complicates the algorithm used
to solve QTBUG-34255 and it wastes 8 bytes per visual item.

No difference could be noted in a benchmark animating 6000+ sprites.

Task-number: QTBUG-34255
Change-Id: Id0a78a246f0d621a51c8caad23da02b55d59b9bb
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Thu, 9 Oct 2014 16:13:54 +0000 (18:13 +0200)]
Merge remote-tracking branch 'origin/5.4' into dev

Conflicts:
src/quick/items/context2d/qquickcanvasitem.cpp
src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
src/quick/scenegraph/coreapi/qsgrenderer.cpp
src/quick/scenegraph/qsgadaptationlayer.cpp
src/quick/scenegraph/qsgrenderloop.cpp
src/quick/scenegraph/qsgthreadedrenderloop.cpp
src/quick/scenegraph/qsgwindowsrenderloop.cpp
src/quick/scenegraph/util/qsgatlastexture.cpp
src/quick/scenegraph/util/qsgtexture.cpp
src/quick/util/qquickprofiler_p.h

Change-Id: Ie274c3baf72a8a0711c87d67238d68e2b2887429

9 years agoFix memory leak and crash with transform animators.
Gunnar Sletta [Mon, 6 Oct 2014 19:13:18 +0000 (21:13 +0200)]
Fix memory leak and crash with transform animators.

Every time initialize() was called, we would increment the ref on
an item. However, initialize is called every time the job is started,
so the ref would increase and only decrease once, leading to a leaked
helper. Change it to only increment the first time.

A different problem was that when an item was destroyed, we could run
the risk of the QQuickTransformAnimatorJob destructor being called
with the helper's item being null. This would lead to the helper not
being removed from the cache and a dangling helper would remain in the
transforms cache. Now change it so that when a target is destroyed, we
explicitly destroy the helper as well (as no animation can happen then
anyway) and reset all pointers in the job.

Change-Id: I1ce76db134bbc1871d32f1224ba5b68a4a4eeafa
Reviewed-by: Michael Brasser <michael.brasser@live.com>
9 years agoRemove alpha channel from images that doesn't actually have alpha.
Gunnar Sletta [Fri, 3 Oct 2014 14:12:56 +0000 (16:12 +0200)]
Remove alpha channel from images that doesn't actually have alpha.

We did this for QPixmap since forever, and it has a huge impact
on rendering performance, so there is no reason why we shouldn't
spend that extra bit of time.

Change-Id: Ibd2e6d585525a5b5a975b8d7498c21dec00647c5
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoCompare doesn't work for colors, so compare the channels explcitily.
Gunnar Sletta [Thu, 2 Oct 2014 10:05:14 +0000 (12:05 +0200)]
Compare doesn't work for colors, so compare the channels explcitily.

Change-Id: I7a21328700c85b5b79dbb4342817e28833dece70
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoRelax ShaderEffectSource's sourceItem vs window handling.
Gunnar Sletta [Thu, 2 Oct 2014 10:03:27 +0000 (12:03 +0200)]
Relax ShaderEffectSource's sourceItem vs window handling.

For dynamically loaded items, the window may not be set
on either the source or the item, so we need to be a bit
more relaxed in our checking.

This fixes a regression for dynamically loaded GaussianBlur.

Change-Id: I3e888405a95058ca79ecd2dff42c0ed4c8fff065
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoFix missing glyphs in selection
Eskil Abrahamsen Blomfeldt [Wed, 8 Oct 2014 10:30:27 +0000 (12:30 +0200)]
Fix missing glyphs in selection

Change 198009db79a85d3cab7fe3a6432635d36123a2d6 revealed a bug in the
new selection algorithm which would occur sometimes
when a given run of text spanned several script items. Since we
are checking the glyph runs for overlaps in the actual text, we
need to report the exact characters spanned by the glyph run. We
use the new enabler for this in QGlyphRunPrivate.

Added a new test case which is an error case we did not yet cover,
which is when there is only a single script item, but several
font engines are used to produce it (fallback fonts).

Change-Id: Ie4c3e79ad98a033d5c75fd67ada4ae83df33435b
Task-number: QTBUG-41808
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoTemporarily skip tst_qquickframebufferobject when using ANGLE.
Friedemann Kleint [Tue, 7 Oct 2014 12:28:49 +0000 (14:28 +0200)]
Temporarily skip tst_qquickframebufferobject when using ANGLE.

Task-number: QTBUG-41815
Change-Id: I5c6ec36a4f8830d95e1d4904d1be41d752757339
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQuickWindow autotest: focus transferred to parent on window close
Shawn Rutledge [Thu, 9 Oct 2014 08:09:24 +0000 (10:09 +0200)]
QQuickWindow autotest: focus transferred to parent on window close

These bugs were fixed so XFAIL is no longer necessary in the autotest
(change da0c74550f0e8a21239896d6aead6e05f85eb695 in qtbase).

Task-number: QTBUG-33423
Task-number: QTBUG-39809
Change-Id: Ia89554b9f54aca7ef6c6ac6b474ca2bb9c0f5629
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoAnimations with no frameSync should be synchronized to the start time
Jan Arve Saether [Thu, 18 Sep 2014 15:00:12 +0000 (17:00 +0200)]
Animations with no frameSync should be synchronized to the start time

(i.e. "start time" means the time when running was set to true)

Unfortunately, we reset the timestamp *after* the image had been
loaded and assembled in buildNode(), therefore, the first *displayed*
frame would always be the first one in the animation regardless of
how long time it took to load the image.

Change-Id: I6b57a0f69afd3c9140628b874481cdeda1dffce5
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
9 years agoAdd QSG_OPENGL_DEBUG environment variable
enkore [Mon, 6 Oct 2014 17:39:27 +0000 (19:39 +0200)]
Add QSG_OPENGL_DEBUG environment variable

If QSG_OPENGL_DEBUG is set the OpenGL context is always created as a debug
context. Not setting QSG_OPENGL_DEBUG uses the default value obtained
from QSurfaceFormat::defaultFormat().

Change-Id: I8cc2c8f995cfdb2ed762eb155d77ca11b2db7b72
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFixed AnimatedSprite to respect 'loops' properly
Jan Arve Saether [Thu, 4 Sep 2014 15:11:08 +0000 (17:11 +0200)]
Fixed AnimatedSprite to respect 'loops' properly

Previously, AnimatedSprite could stop before it had performed its
desired number of loops.

Task-number: QTBUG-36338
Change-Id: I9485886681f55d410786f27b4f6afdc72a058202
Reviewed-by: Michael Brasser <michael.brasser@live.com>
9 years agoDo not crash under certain conditions in AnimatedSprite
Jan Arve Saether [Fri, 3 Oct 2014 08:56:48 +0000 (10:56 +0200)]
Do not crash under certain conditions in AnimatedSprite

The code that tried to find the remaning number of frames on the last
row was incorrect if the last row were full.
It basically did totalNumberOfRows % framesPerRow, which doesn't always
work, for instance:

If the animation had 8 frames per row and a total of 16 frames
the calculation to find the remaining number of frames became:

 16 % 8 = 0 (correct result should have been 8)

As you can see, it only didn't work in the cases where the last row
were full.

Change-Id: I9ff6ac7baa91538b01576b659ea6651992cfca0b
Reviewed-by: Michael Brasser <michael.brasser@live.com>
9 years agoQQuickPixmapStore: Don't start expiration timer when application quits
Oleg Shparber [Mon, 7 Jul 2014 21:56:38 +0000 (14:56 -0700)]
QQuickPixmapStore: Don't start expiration timer when application quits

This change removes a warning printed during application closing
stage about a timer started not from QThread.

Change-Id: I93ca4da7066bd5e0784509676bc59969a8e2ad48
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoPrevent removeFirst call on empty list. v5.3.99+beta1
Zeno Endemann [Tue, 30 Sep 2014 12:02:45 +0000 (14:02 +0200)]
Prevent removeFirst call on empty list.

The hoverItems list might get changed as a result of the sendHoverEvent
call, so it is safer to take the element out first.

Change-Id: I88c7380a2e4dd2297f9d0cfe01edc453ca525cb3
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agouse the new form of QTranslator::load() for more flexibility
Shawn Rutledge [Thu, 4 Sep 2014 12:29:21 +0000 (14:29 +0200)]
use the new form of QTranslator::load() for more flexibility

As the docs explain, the variant of QTranslator::load() taking a
const QLocale& is better because it "uses QLocale::uiLanguages()
and not simply the locale name, which refers to the formatting of
dates and numbers and not necessarily the UI language."  And, using
a default-constructed QLocale permits QLocale::setDefault() to
override the system locale, so for example an application's
main.cpp can do that before constructing a QQmlApplicationEngine.

Task-number: QTBUG-7329
Change-Id: Ia29a4c894087c92b071c0fe484728866f2660fe6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
9 years agodocumentation for qmldir "depends" declaration
Shawn Rutledge [Tue, 30 Sep 2014 07:00:21 +0000 (09:00 +0200)]
documentation for qmldir "depends" declaration

[ChangeLog][QtQml][qmldir] added the ability to declare dependencies
on other modules in a module definition qmldir file

Task-number: QTBUG-41489
Change-Id: Icd526bc7617bc3e4f725c7d008d0522a201cf645
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoqmlimportscanner: parse "depends" lines in qmldir files
Shawn Rutledge [Thu, 25 Sep 2014 16:28:27 +0000 (18:28 +0200)]
qmlimportscanner: parse "depends" lines in qmldir files

These lines specify additional hidden dependencies.  The first use case
is in QtQuick.Dialogs: DefaultFileDialog.qml uses FolderListModel, but
this file is not listed in the qmldir because the decision whether to
use it is made at runtime.  So QtQuick.Dialogs qmldir contains this:
depends Qt.labs.folderlistmodel 1.0

Task-number: QTBUG-41489
Change-Id: Ide4bca2ce2e342b95e9a87cc418d26f331372d12
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
9 years agoqmldir parser: add support for "depends component version" syntax
Shawn Rutledge [Wed, 24 Sep 2014 15:36:53 +0000 (17:36 +0200)]
qmldir parser: add support for "depends component version" syntax

Dependency declarations are initially for the benefit of
qmlimportscanner which does not (yet) use this parser.  This patch
adds support for dependencies into the qmldir parser for completeness,
along with autotests.  It is necessary to prevent errors at runtime
when parsing a qmldir which contains the "depends" declaration.

Task-number: QTBUG-41489
Change-Id: Ief2524a30140c42874f94f1735755b171e15dcf7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
9 years agoPartially revert d9c531781e6c95f80681b3c82700833e1de88794
Gunnar Sletta [Wed, 1 Oct 2014 09:12:18 +0000 (11:12 +0200)]
Partially revert d9c531781e6c95f80681b3c82700833e1de88794

This logic changed then timing for when the layer's m_dirtyTexture
was set and unset, which had some side effects. Revert to the old
and known-to-work behavior of using a connection.

Change-Id: I4048e7ae70491afe36b2d766e6c506d9febc44ed
Task-number: QTBUG-41451
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMake Canvas use texture atlas for smallish Image based canvases.
Gunnar Sletta [Fri, 26 Sep 2014 17:43:52 +0000 (19:43 +0200)]
Make Canvas use texture atlas for smallish Image based canvases.

This makes Canvas with Image batchable in the renderer which
means that it is feasible to have 100s of small Canvases in a
scene, for instance as static icons rendered with a bit of
script.

Change-Id: I3ad57360d632b7093fd6993afa88ed35c21d178a
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoDocument that QQmlApplicationEngine's root item must be a window.
Mitch Curtis [Tue, 30 Sep 2014 08:40:40 +0000 (10:40 +0200)]
Document that QQmlApplicationEngine's root item must be a window.

Change-Id: I22466e82105c9b56894a53400394d1124191f93d
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoFix compiler warning
Lars Knoll [Tue, 2 Sep 2014 12:48:03 +0000 (14:48 +0200)]
Fix compiler warning

Add a matching operator delete to our operator new to shut
up MSVC.

Task-number: QTBUG-40652
Change-Id: I1396094d23c4d0cfc88a73fabbab05f1d4ec7b44
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoUpdate the Calqltr demo visuals and engine logic
Topi Reinio [Wed, 24 Sep 2014 12:37:46 +0000 (14:37 +0200)]
Update the Calqltr demo visuals and engine logic

    - Add logic for displaying the calculation result in the best
      available precision, determined by the display width
    - Display 'ERROR' when the result cannot be displayed
    - Animate the number pad button colors to react to presses and
      visually disable them when pressing the button has no effect
    - Fix issues in calculator.js logic
    - Update documentation accordingly

Task-number: QTBUG-41253
Change-Id: Ibed7b8218ea4cd074b8f9b90d9bb4e3ea6b25ba2
Reviewed-by: Johanna Äijälä <johanna.aijala@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
9 years agoDoc: Combine the extending QML tutorial chapters into a single example
Topi Reinio [Fri, 26 Sep 2014 13:00:14 +0000 (15:00 +0200)]
Doc: Combine the extending QML tutorial chapters into a single example

Combine the six examples associated with each tutorial chapter
into a single, top-level example project 'extending-qml', with
subprojects for each of the tutorial chapters.

Clean up the docs, add links, and a note about a warning that
the user may see when running the code in the first chapter.

Task-number: QTBUG-32947
Change-Id: Idba4e2153817ab29f1afaf1947d1f2e25964e7b3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
9 years agoFix build when using -Werror
Sérgio Martins [Thu, 25 Sep 2014 20:02:04 +0000 (21:02 +0100)]
Fix build when using -Werror

"'borderBottom' may be used uninitialized in this function [-Werror=maybe-uninitialized]"

Observed when compiling for android.

Change-Id: Ifcb26e28440f08528a192ea2fe88d6343e33710b
Reviewed-by: BogDan Vatra <bogdan@kde.org>
9 years agoAdd orientationUpdateMask to QQuickScreen
Alex Blasche [Wed, 24 Sep 2014 10:08:10 +0000 (12:08 +0200)]
Add orientationUpdateMask to QQuickScreen

Task-number: QTBUG-38699
Change-Id: I173b7e53c27dba336351572859f7c9aeafe07ef9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
9 years agoRevert "Temporarily mark grab()/item.layer tests insignificant under ANGLE"
Andrew Knight [Wed, 24 Sep 2014 07:29:39 +0000 (10:29 +0300)]
Revert "Temporarily mark grab()/item.layer tests insignificant under ANGLE"

This reverts commit 6b31418a1b5d9be47df5ed61747e8a5fb225acfa.

These tests now pass with the latest ANGLE.

Change-Id: If812d430e69f0d39a970e9119ebc1f2e5b4886dc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
9 years agoPartially revert "Disable tests on failing ANGLE config"
Andrew Knight [Wed, 24 Sep 2014 09:09:50 +0000 (12:09 +0300)]
Partially revert "Disable tests on failing ANGLE config"

This partially reverts commit fa29df24bd2792f5eb64e4ff21a116b2c5f5384c.

The sprite sequence test now passes in CI under MSVC2010.

Change-Id: Ie8f7abdd2ff00db377b1ef3f221c5048c430c067
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
9 years agoFix example in scope documentation
Simon Hausmann [Mon, 29 Sep 2014 11:21:09 +0000 (13:21 +0200)]
Fix example in scope documentation

The example tried to demonstrate the use of direct access to properties of the
root component object, but unfortunately it also defined an id property that
clashed with it. Therefore the provided example did not work as intended and
produced a "stringified" object reference instead of the text of the "title"
property.

This patch changes the id to avoid a clash.

Change-Id: Ib9abcf48482773a0dcdf5e2375d1445d87ccf4ef
Reviewed-by: Michael Brasser <michael.brasser@live.com>
9 years agoAlso search for visual children in TestCase::findChild().
Mitch Curtis [Tue, 23 Sep 2014 08:36:22 +0000 (10:36 +0200)]
Also search for visual children in TestCase::findChild().

It previously used QObject::findChild(), which won't work in all cases,
because items like ListView don't seem to make their delegate items
QObject children, while simple nested Items do.

Change-Id: I1a8ed1fb55493212cb25abf595d016437812a80f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoGive Item::layer documentation some much needed love.
Gunnar Sletta [Sun, 28 Sep 2014 10:26:55 +0000 (12:26 +0200)]
Give Item::layer documentation some much needed love.

Change-Id: I31e038d961d3aa09a36db0c091c4e4910e395c2e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoDo not fail test because window moves out of desktop area bounds.
Jan Arve Saether [Mon, 22 Sep 2014 11:52:56 +0000 (13:52 +0200)]
Do not fail test because window moves out of desktop area bounds.

For some reason the window moved in the bottom-right direction each
time the window was resized. This could cause the window to move out of
the bounds of the desktop area, which again could cause an autotest
failure. We therefore ensure that the window is centered for each test
call.

Task-number: QTBUG-33017
Change-Id: I0a2b9bb4ba866d8a3f80309c6b33863bab4d2bcf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
9 years agoqmlimportscanner: allow a qmlFile to come from stdin
Fawzi Mohamed [Thu, 18 Sep 2014 20:40:09 +0000 (22:40 +0200)]
qmlimportscanner: allow a qmlFile to come from stdin

Change-Id: I22b0e45a8aa25d232791cdbeca15b5bc7400ae7d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
9 years agoDoc: Replace VisualDataModel with DelegateModel
Nico Vertriest [Mon, 15 Sep 2014 11:36:12 +0000 (13:36 +0200)]
Doc: Replace VisualDataModel with DelegateModel

Task-number: QTBUG-37725
Change-Id: Iad3b31470af8ea965d19b3d0901822b901407d40
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoUpdated calqlatr demo
Johanna Aijala [Tue, 16 Sep 2014 12:14:16 +0000 (15:14 +0300)]
Updated calqlatr demo

Fixes and finetuning of calqlatr demo:
- fixed text overlapping, changed max length of a number from 14 to 9
- fixed app "freeze" after entering number of maximum length
- implemented +/- operator functionality
- fixed listview scrolling, after multiple operations listview was
scrolling only when entering '=' leaving the active line hidden when
the numbers and operator were typed
- added support for entering numbers and certain operators from keyboard
- removed commented code

Task-number: QTBUG-38818
Change-Id: Ic0ecd2dff68a89007421e95a5bdc3ab7ca2e401d
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoDoc: Add docs for Clocks example
Leena Miettinen [Fri, 19 Sep 2014 13:00:11 +0000 (15:00 +0200)]
Doc: Add docs for Clocks example

Change-Id: I626376ae2a169f7d892e86309754633e9ed6a6e9
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoReset 'invalidatePending' after the FBO has been recreated.
Gunnar Sletta [Thu, 25 Sep 2014 07:02:13 +0000 (09:02 +0200)]
Reset 'invalidatePending' after the FBO has been recreated.

If not, we will always request a new FBO during updatePaintNode,
even when the fbo is not following the items size.

Task-number: QTBUG-41565
Change-Id: I20b4b3a8e3630ff963a876320808869bba62fb8a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoQDSM: Nested statemachines are supported
Sebastian Sauer [Wed, 17 Sep 2014 17:10:40 +0000 (00:10 +0700)]
QDSM: Nested statemachines are supported

* Remove wrongly printed info that nested
  statemachines are not supported.
* Added autotest for nested statemachines.
* Re-enable commented out testcase in the
  nestedInitalStates autotest. The reason
  why the test was disabled was fixed a
  while ago.

Change-Id: I921483fa49d751d14c877f8f63335fa88cf2ce7b
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agomove QQuickWindowAttached to QQuickWindowQmlImpl
Shawn Rutledge [Wed, 10 Sep 2014 13:27:58 +0000 (15:27 +0200)]
move QQuickWindowAttached to QQuickWindowQmlImpl

It causes problems to do qmlRegisterType on QQuickWindow if the
attached property also refers to QQuickWindow.

Task-number: QTBUG-40816
Task-number: QTBUG-41047
Change-Id: I7a6f75af52f65e2be022b97128702982bec7cbe8
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
9 years agoFix cleanup of non-threaded render loops.
Gunnar Sletta [Fri, 19 Sep 2014 07:52:25 +0000 (09:52 +0200)]
Fix cleanup of non-threaded render loops.

They would unconditionally call cleanupNodesOnShutdown on hide(), but
QQuickWindow::sceneGraphInvalidated would only be emitted if this was
the last window being hidden, leading to an inconsistent state in the
application.

Since the non-threaded render loops do not support releasing resources
(there is one OpenGL context and one QSGRenderContext shared between
all windows) we delay cleanup until the window is destroyed.

This change also make the render loops track the windows until they
are destroyed, similar to what the threaded one does. The purpose of
this is to, in the case of dangling windows, only trigger invalidation
of the scene graph when the last QQuickWindow is destroyed through
QSGRenderLoop::cleanup().

Task-number: QTBUG-41210
Change-Id: I7e12a4f726ebb3e7935c822b6046abb3590c583a
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoCleanup: Simplify CompiledData::Unit structure to always include the string table...
Simon Hausmann [Wed, 24 Sep 2014 10:27:21 +0000 (12:27 +0200)]
Cleanup: Simplify CompiledData::Unit structure to always include the string table at the end

Change-Id: Iae86b8f4dc0dc67c14974472f627e28d6795369f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoAllow multiple cached qml unit registration functions
Simon Hausmann [Mon, 22 Sep 2014 12:09:41 +0000 (14:09 +0200)]
Allow multiple cached qml unit registration functions

Only few will be necessary, but this allows for greater flexibility
at run-time.

Change-Id: Ia03abeb6296a5dee97544209c578dc2974af7cbc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoFix disappearing slider during size/orientation change
Alex Blasche [Fri, 19 Sep 2014 09:46:44 +0000 (11:46 +0200)]
Fix disappearing slider during size/orientation change

Now the slider remains at a position that is equivalent to the old
position based on the previous percentage.

This change is most commonly triggered during orientation changes on
mobile device. That is the reason why the app was converted to a
proper Qt project. This way it was possible to test this behavior
on Android.

Task-number: QTBUG-18423
Change-Id: If05e6a1e42249f90a821c4882021d28cf212fc52
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoDoc: apply title case to all section1 titles
Nico Vertriest [Fri, 12 Sep 2014 09:01:33 +0000 (11:01 +0200)]
Doc: apply title case to all section1 titles

Task-number: QTBUG-41250
Change-Id: I303d989992c9685f73baae50c64accf71b43549f
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoUpdated the example to accept input on Android
Venu [Mon, 15 Sep 2014 15:02:43 +0000 (17:02 +0200)]
Updated the example to accept input on Android

The Android inputMethod doesn't commit the text
until a word is chosen from the suggestions list.
This makes the URL for XMLHTTPRequest invalid. To avoid
the invalid URL, we should either not use predictive text
or explicitly commit the text. I choose to go with the earlier
option.

Task-number: QTBUT-41335
Change-Id: Id03c4dc8cfbd1b32cc2868fe8b78cd039994ff71
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoRecreate the fbo on screen change in QQuickWidget when needed
Laszlo Agocs [Thu, 11 Sep 2014 11:04:49 +0000 (13:04 +0200)]
Recreate the fbo on screen change in QQuickWidget when needed

Move the rendering code out into a separate function since it is
now called from three places.

Like in QOpenGLWidget, the FBO may need to be recreated with a
different size in case the window is moved onto a screen with
a different device pixel ratio.

Change-Id: Iaaa42a06dab9e02710b0a7dafb0ea8c018b69ec2
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoAdd missing import to documentation code snippet
Sérgio Martins [Fri, 19 Sep 2014 13:31:19 +0000 (14:31 +0100)]
Add missing import to documentation code snippet

Change-Id: I358b306fb286ffb00d2edd51bc3d97f1884fe34e
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
9 years agoFix clip state tracking in Context2D
Matt Fischer [Wed, 10 Sep 2014 18:34:51 +0000 (13:34 -0500)]
Fix clip state tracking in Context2D

A recent change (f45fe58ad2aa741c90b756643da75f1a6bc2fdf6)
introduced the concept of clipping being disabled for a context,
so that it can start with no clip path set.  However, this state
is not properly tracked, so an attempt to restore a context state
which has no clip path does not work properly.  This change adds
this information to the Clip command, so that it can be properly
restored.

This patch also re-enables a test case which was supposed to
check this behavior, but had been disabled.

Task-number: QTBUG-40312
Change-Id: I3fd5626ecfcc1298a81931828cbb590290098a92
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoDon't do qgetenv on library load
Thiago Macieira [Tue, 16 Sep 2014 22:20:53 +0000 (15:20 -0700)]
Don't do qgetenv on library load

Bad for two reasons: first, it increases the load time of the
application and second, it makes it impossible to to setenv/putenv from
main(). The latter is useful if you need to work on an embedded device
that doesn't allow setting environment variables.

Change-Id: Id543f77336d7ac2e4ea820b51f55ce5a40a33b4e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoWindow example: setOrientationUpdateMask to allow all orientations
Shawn Rutledge [Mon, 22 Sep 2014 14:04:19 +0000 (16:04 +0200)]
Window example: setOrientationUpdateMask to allow all orientations

The purpose of showing both orientation and primaryOrientation is to
see how they both change when the screen is rotated.

Change-Id: I54e51c834c568b1dbd895584b9f80e4b00c8d506
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
9 years agoFix deadlock with QQuickView embedded via QWidget::createWindowContainer
Dyami Caliri [Sun, 21 Sep 2014 19:30:24 +0000 (12:30 -0700)]
Fix deadlock with QQuickView embedded via QWidget::createWindowContainer

A QQuickView embedded in a widget application will be deleted in the
QApplication destructor. At that point, events are not being posted,
so the QQmlThread cannot properly shut down, and will deadlock waiting
for an event.

Task-number: QTBUG-36115
Change-Id: I4595f03e0afcf9463cfbc2ba95146d4777d19c56
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoStocQt example: Display trading volume scale for stock charts
Topi Reinio [Tue, 16 Sep 2014 10:51:24 +0000 (12:51 +0200)]
StocQt example: Display trading volume scale for stock charts

Similar to how the example already shows scale of the stock price
on the right-hand side margin, this change adds a scale for the
trading volume.

Large volume values are shortened to a more readable format, using
symbols for units of thousand/million/billion etc.

Task-number: QTBUG-38254
Change-Id: I068bba1622d2a586a5dd14dddd4b832c8b112d2d
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Diana de Sousa <diana.desousa@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
9 years agoUpdate used colors on basis of the recommended color palette.
Tarja Sundqvist [Wed, 17 Sep 2014 12:14:14 +0000 (15:14 +0300)]
Update used colors on basis of the recommended color palette.

qtdeclarative/examples/quick/animation uses some colors which are not
mentioned on the recommended color palette. They are replaced with
recommended colors.

Task-number: QTBUG-41368
Change-Id: I6f07340735333c5da319fdc59ecf8aa7388ad2a5
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoCleanup remaining QtQuick.Dialogs leftovers
J-P Nurmi [Wed, 17 Sep 2014 12:57:02 +0000 (14:57 +0200)]
Cleanup remaining QtQuick.Dialogs leftovers

QtQuick.Dialogs was moved to the qtquickcontrols module in Qt 5.3

Change-Id: I16d03dc1c342d396963c5bec3125b3d11d0d9bed
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoqmlplugindump: Use _CrtSetReportMode() for MSVC only.
Friedemann Kleint [Fri, 19 Sep 2014 09:59:42 +0000 (11:59 +0200)]
qmlplugindump: Use _CrtSetReportMode() for MSVC only.

Fix warnings when using MinGW:

main.cpp: In function 'int main(int, char**)':
main.cpp:734:55: warning: statement has no effect [-Wunused-value]
     _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
                                                       ^
main.cpp:735:53: warning: statement has no effect [-Wunused-value]
     _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG);
                                                     ^
main.cpp:736:54: warning: statement has no effect [-Wunused-value]
     _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);

where _CrtSetReportMode() is an empty macro.

Change-Id: I644bc207b5a3df62d6390811f53b2c0948979d58
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
9 years agoMake tst_qquickanimations more reliable
Ulf Hermann [Wed, 17 Sep 2014 12:56:54 +0000 (14:56 +0200)]
Make tst_qquickanimations more reliable

As we usually don't get realtime guarantees we cannot rely on exact
sleep times. This change relaxes our expactations in that regard.

Task-number: QTBUG-29062
Change-Id: I54dfb7a28d6bb46479aedb9f943f5ff4db2df701
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
9 years agoDoc: add documentation for Photo Viewer example
Leena Miettinen [Thu, 11 Sep 2014 15:15:37 +0000 (17:15 +0200)]
Doc: add documentation for Photo Viewer example

Change-Id: Iffedd9361bd0475a53c1a8b9567c9cbf5e5d4867
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix compiler warnings in qv8engine.cpp.
Friedemann Kleint [Fri, 19 Sep 2014 07:23:22 +0000 (09:23 +0200)]
Fix compiler warnings in qv8engine.cpp.

qml\v8\qv8engine.cpp(91) : warning C4805: '|' : unsafe mix of type 'bool' and type 'int' in operation

Task-number: QTBUG-40431
Change-Id: Ibdc96907aaab132956c87dd6aec2eab2f3bf0e9f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove qtdemo from gitignore
Rainer Keller [Wed, 17 Sep 2014 08:51:05 +0000 (10:51 +0200)]
Remove qtdemo from gitignore

QtDemo was removed with a commit in qtdoc.

Change-Id: I75228b748a2307a713f0c86ecf144dae3b3569a3
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
9 years agoRevert mapping of var signal parameters to QJSValue
Simon Hausmann [Thu, 18 Sep 2014 15:03:44 +0000 (17:03 +0200)]
Revert mapping of var signal parameters to QJSValue

This reverts commit 70004585f89f325f398c556d101bfa1833d87b53, which is
superseded by commit 3dbe05f6bf3fd51ce8097c35f6c7f12b39acb0f6, which is
a much better solution.

[ChangeLog][QtQml][Important Behavior Changes] Qt 5.3 changed the mapping
of "var" parameters in QML declared signals to QJSValue. This was reverted
to the behavior of earlier Qt versions to use QVariant. The original issue
of not being able to pass function objects through var parameters of QML
declared signals is solved by wrapping a QJSValue inside the QVariant.

Task-number: QTBUG-39971
Change-Id: I44de2ef2660c64c68e6a3b2a1ae251ad563d6b3c
Reviewed-by: Taylor Braun-Jones <taylor@braun-jones.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoReplace vsnprintf with qvsnprintf.
Bjoern Breitmeyer [Thu, 4 Sep 2014 09:26:04 +0000 (11:26 +0200)]
Replace vsnprintf with qvsnprintf.

Windows CE does not have vsnprintf, so
use qvsnprintf instead.

Change-Id: I30ddbf2469424ec174903f0cce2b482c652b5d22
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFixed frame focusing on touch devices
Tomi Korpipää [Thu, 18 Sep 2014 04:41:11 +0000 (07:41 +0300)]
Fixed frame focusing on touch devices

Also fixed the \quotefromfile commands in the doc to
display the changed code correctly.

Task-number: QTBUG-38779
Change-Id: I37d37139459cb9cdee7ec9beaffeab26a1cb4aaf
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoRemove tst_dialogs - moved to qtquickcontrols
J-P Nurmi [Wed, 17 Sep 2014 11:41:33 +0000 (13:41 +0200)]
Remove tst_dialogs - moved to qtquickcontrols

QtQuick.Dialogs were moved from qtdeclarative to qtquickcontrols
already in Qt 5.3, but the auto test was forgotten.

Change-Id: I5c74e45b9ee2302f1d20fb476af6a93879913a28
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
9 years agoAvoid crashing the rendercontrol example on exit
Laszlo Agocs [Wed, 17 Sep 2014 14:18:00 +0000 (16:18 +0200)]
Avoid crashing the rendercontrol example on exit

Task-number: QTBUG-41278
Change-Id: I456467698e66fb28f1bf6a05d85771ac25f454d0
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFinally: A default animation driver which doesn't use walltime.
Gunnar Sletta [Fri, 12 Sep 2014 09:21:36 +0000 (11:21 +0200)]
Finally: A default animation driver which doesn't use walltime.

I've wanted this for a long time, but the animation system didn't
support it when mixed with timers/pauses. However, because of
dfc8f8b5d4a02f33c7f9063c2a28450902a9d863 and
0db3ea4048fe572a256deb343ea5e64a55d98de9 to qtbase, it is now
possible.

Change-Id: Ic70c181ce49eae90276bd4f22a2d299061f96087
Reviewed-by: Michael Brasser <michael.brasser@live.com>
9 years agoFix QQuickText::lineLaidOutRelayout autotest on OS X
Jan Arve Saether [Tue, 16 Sep 2014 11:31:20 +0000 (13:31 +0200)]
Fix QQuickText::lineLaidOutRelayout autotest on OS X

QTextLine::height() can be different that QTextLine::rect().height()

Task-number: QTBUG-37829
Change-Id: I7fa93d50e29397237220ba111baa3bd1a56b88f2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
9 years agoUse new sceneGraphInitialized() method for canvas item
Ulf Hermann [Wed, 17 Sep 2014 09:49:21 +0000 (11:49 +0200)]
Use new sceneGraphInitialized() method for canvas item

This relies on the canvas item using a valid configuration in the first
place. You cannot have renderTarget == FramebufferObject on a
non-OpenGL scene graph, for example. You can, however, use
renderTarget == Image and that doesn't require the OpenGL context to
be present.

Task-number: QTBUG-41353
Change-Id: Id9ca6c9f04d5c6063b42563bf6ee08af983d65bc
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoAdd methods for finding out if scene graph context has been initialized
Ulf Hermann [Wed, 17 Sep 2014 09:46:38 +0000 (11:46 +0200)]
Add methods for finding out if scene graph context has been initialized

We cannot rely on the OpenGL context for that as there may be
non-OpenGL scene graphs. In order for those to announce their readiness
QSGRenderContext::isValid() has to be virtual.

Change-Id: Ica35d8590e3f06edb54d57d93898d52e753f0407
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoSync QQuickWindow::update() up with polishAndSync().
Gunnar Sletta [Wed, 17 Sep 2014 08:08:09 +0000 (10:08 +0200)]
Sync QQuickWindow::update() up with polishAndSync().

When calling QQuickWindow::update() on the GUI thread, we would
immediately flag the render thread that a repaint was needed and then
schedule a polishAndSync. If the render thread completed the current
frame before the GUI thread got to polishAndSync, it would repaint
right away without syncing with GUI first.

Instead of sending the repaint right away, register the need for a
full repaint in the window and set it as part of the next sync phase.

Change-Id: Ia731fb46724cc79f5391422213b069de9362d002
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoQQuickWindow::setColor() should use update() rather than dirtyItem()
Gunnar Sletta [Wed, 17 Sep 2014 08:06:31 +0000 (08:06 +0000)]
QQuickWindow::setColor() should use update() rather than dirtyItem()

dirtyItem() will trigger maybeUpdate in the renderloop which may
decide to skip the render pass if nothing changed in the scene
graph. Use update() instead which forces the rendering to go through
regardless.

Change-Id: I4730bb0cd79d58fa21970a847cc1720060cb14a8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoDon't assume a QSGRenderContext is valid just because it's not 0
Ulf Hermann [Tue, 16 Sep 2014 14:01:40 +0000 (16:01 +0200)]
Don't assume a QSGRenderContext is valid just because it's not 0

Task-number: QTBUG-41353
Change-Id: I2a8c500ed974b3e5f45f3a1eb1f66c7a24b17d56
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoProtect QQuickWindow::openglContext against not having a context.
Gunnar Sletta [Wed, 17 Sep 2014 08:49:20 +0000 (10:49 +0200)]
Protect QQuickWindow::openglContext against not having a context.

Change-Id: I3d5087d9c322ee5ee3325858ee717161fd7801a3
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
9 years agoAdd a note about winId() to QQuickWidget
Laszlo Agocs [Mon, 15 Sep 2014 12:36:23 +0000 (14:36 +0200)]
Add a note about winId() to QQuickWidget

This unfortunate function causes the creation of a
native window which is very wrong.

Task-number: QTBUG-40765
Change-Id: Ia08138cf35c240c883c63a66a54f949b86ccc2d2
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
9 years agoFix mapping of JS objects/arrays to C++
Simon Hausmann [Wed, 10 Sep 2014 15:13:10 +0000 (17:13 +0200)]
Fix mapping of JS objects/arrays to C++

[ChangeLog][QtQml][Important Behavior Changes] When a JavaScript object/array
is passed to C++ through a QVariant, the engine no longer immediately converts
the object recursively into a QVariantMap or QVariantList but instead stores
a QJSValue in the QVariant. This prevents a loss of data when the JS object
contains non-primitive types such as function objects for example. Code that
expects the variant type to be exactly QVariant::Map or QVariant::List may
need to be adapted. Registered conversion functions however ensure that code
that merely calls toMap() or toList() continues to work.

Task-number: QTBUG-40431
Change-Id: I1dbc1d5f8e78ad28bb62db3681b9a0b34557e7f5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoCleaned up the documentation for QQmlEngine::ObjectOwnership.
Kavindra Palaraja [Tue, 16 Sep 2014 18:36:19 +0000 (20:36 +0200)]
Cleaned up the documentation for QQmlEngine::ObjectOwnership.

The paragraphs needed a bit of polish.

Change-Id: I5c6b41fad34f3f58a372aa1bf8be627769871cf8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFixed documentation for QQmlEngine::ObjectOwnership.
Kavindra Palaraja [Tue, 16 Sep 2014 18:10:05 +0000 (20:10 +0200)]
Fixed documentation for QQmlEngine::ObjectOwnership.

The ObjectOwnership enum's documentation mentioned that QObjects
returned from property access are indestructible, which they aren't.

Task-number: QTBUG-35426
Change-Id: Ic936b33b736ff7a45482cf1b626977d34ac4ebb2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix crash when borders exceed item width/height in border image
Eskil Abrahamsen Blomfeldt [Tue, 16 Sep 2014 11:34:15 +0000 (13:34 +0200)]
Fix crash when borders exceed item width/height in border image

While we protected against the the borders exceeding the size of
the source image when deciding whether to create a given patch,
we did not protect against the case where the target rectangle
is smaller than the borders. To fix this, we simply move the
calculation of the target rectangle up to before we create the
nodes, and check for isEmpty() before creating the nodes.

In addition, we did not properly handle changing the borders
dynamically. The subtree has to be rebuilt if the borders change
so that the source or target rectangles change.

Change-Id: Ia6a0df616ebbd0a32924de0b63fd48043027930a
Task-number: QTBUG-41338
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoQQuickTextControl: update cursor rect when cursor changes position
Richard Moe Gustavsen [Tue, 16 Sep 2014 08:10:14 +0000 (10:10 +0200)]
QQuickTextControl: update cursor rect when cursor changes position

If the text cursor changes position by indirect manipulation of the
document that backs a QQuickTextControl, we need to inform that
the cursor rect changed as well.

This will fix a bug with QQuickTextEdit that caused the platform input
method to be out of sync since the cursor rect signal was never
emitted from the the text control.

Task-number: QTBUG-41042
Change-Id: Idcf35a2d51c8dffcb80ba21f8e59a61e04e5a879
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
9 years agoMake Canvas test case independent of chosen font.
Ulf Hermann [Tue, 16 Sep 2014 10:18:01 +0000 (12:18 +0200)]
Make Canvas test case independent of chosen font.

0/0 is not always a red pixel after rendering "Hello" in red. The
chosen font has an influence on that. Looking for some red pixel in row
0 is pretty safe.

Change-Id: I669548c3c9d8cd25d720998fd9ba31c1f480e4e3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoDon't start QQmlThreads from their constructor
Ulf Hermann [Mon, 15 Sep 2014 14:57:35 +0000 (16:57 +0200)]
Don't start QQmlThreads from their constructor

In the case of derived classes (like the only user of QQmlThread) we
cannot guarantee that the class is completely constructed when the
thread starts. This includes the vtable which is necessary to decide
which virtual functions to call.

Change-Id: Ieaea67a72cc3b4f845b8621b34ca2928185917fb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoWait longer for image to be loaded in canvas item test
Ulf Hermann [Mon, 15 Sep 2014 16:59:50 +0000 (18:59 +0200)]
Wait longer for image to be loaded in canvas item test

200ms can be too short if the system is busy

Change-Id: I4f9c6bcbec93d511b5b5e9d531450f3ffd22cb0c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQQmlBoundSignalExpression: Remove extra padding.
Robin Burchell [Mon, 15 Sep 2014 00:41:06 +0000 (02:41 +0200)]
QQmlBoundSignalExpression: Remove extra padding.

Size goes from 104 to 96 bytes on x86_64.

Change-Id: I84614d9e4949e4470e841c0efb6a674e1cb74778
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agotst_compilation: Fix the horrifically broken benchmark.
Robin Burchell [Mon, 15 Sep 2014 01:52:44 +0000 (03:52 +0200)]
tst_compilation: Fix the horrifically broken benchmark.

Start by updating the horrifically outdated QML (re-copy from SameGame). In
addition to this, we reinstate the QVERIFY which cunningly hid the fact that the
benchmark was totally broken, and change it to a QVERIFY2, so we can easily
identify what broke if anything in the future.

Change-Id: Icaa60e0dd0b78861cdd2431af36e534d257a855d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQML Engine: Support for "OPTIONS" method for XMLHTTPRequest was added.
Valery Kotov [Mon, 18 Aug 2014 19:06:38 +0000 (22:06 +0300)]
QML Engine: Support for "OPTIONS" method for XMLHTTPRequest was added.

Support for OPTIONS method was added to QQmlXMLHttpRequest. Tests for
OPTIONS method in XMLHttpRequest were added.

[ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now
supports the OPTION method in HTTP requests.

Task-number: QTBUG-35892
Change-Id: Ibbcf3ecddeb8ced64d8c3e52b777dd6ec0ed98f7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoLet QSGPlainTexture support shutting down without a GL context.
Gunnar Sletta [Fri, 12 Sep 2014 15:34:34 +0000 (17:34 +0200)]
Let QSGPlainTexture support shutting down without a GL context.

Change-Id: Iae934e4d9e91f4ea21dd5bf27c4fafc5d481fb0a
Task-number: QTBUG-41278
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
9 years agoFix stack size check on systems with less than 256kb stack
Simon Hausmann [Thu, 11 Sep 2014 15:00:06 +0000 (17:00 +0200)]
Fix stack size check on systems with less than 256kb stack

We require at least 256 kbytes slack stack space, and if a system is
configured with less (or equal), then the stack size checks fail early on
and strange error message occur during engine startup and execution.

This patch calls the stack check code early on and bails out with an error
message that's more descriptive.

Change-Id: I3263f2f93f62332d08003411e1bb5b3b1140d02b
Task-number: QTBUG-41213
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoMade emission of AnimatedSprite currentFrameChanges consistent.
Jan Arve Saether [Wed, 3 Sep 2014 09:15:25 +0000 (11:15 +0200)]
Made emission of AnimatedSprite currentFrameChanges consistent.

Both the order was wrong and sometimes the currentFrame property
did not correspond to the 'arg' argument that was carried by the signal.
The order was sometimes like this:

 [window got exposed, m_running == false]
currentFrame: 1, arg: 1 <== Unexpected, its not running
 [start() got called, m_running == true]
currentFrame: 1, arg: 0 <== Unexpected, they are inequal
currentFrame: 2, arg: 2 <== Not sure what to expect here

The root of the problem was that we would enter prepareNextFrame on
startup (due to QQuickWindow::exposeEvent) even if we were in the
stopped state. Getting rid of the first invalid emission solved
the issue.

Change-Id: Iba002ee91d4d1acafcf4fd0911c28c93a4bc6fd5
Reviewed-by: Alan Alpert <aalpert@blackberry.com>