Commit Graph

9279 Commits

Author SHA1 Message Date
Laszlo Agocs 657766f19b Do not send deferred deletes from the QQuickWindow dtor
Otherwise doing deleteLater() on an ancestor of the QQuickWindow will
cause double deletion for that ancestor. This is typical when using
WA_DeleteOnClose since that uses deleteLater().

Task-number: QTBUG-40920
Change-Id: I9146fc0854f77c42cad2eda23b3cdaa7a9e22080
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-08-26 11:46:50 +02:00
Simon Hausmann e525c55139 Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4 2014-08-26 11:21:16 +02:00
Simon Hausmann e9e6f70d35 Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
	src/qml/qml/qqmlobjectcreator_p.h
Change-Id: I60858ddb46866a8fa1a8576bb05b412afeeb4e41
2014-08-26 09:51:56 +02:00
Gunnar Sletta 916ced089f Make QQuickPaintedItem a texture provider.
Change-Id: I605dc35fcc2284a890851c41946cf95537e92d2e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-26 06:13:40 +02:00
Gunnar Sletta 695a9605c6 Make use of QQuickWindowQObjectCleanup in QQuickImage.
Saves us a few lines..

Change-Id: I572f6fc44ede3b923208ce3563116d8fcc9bb922
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-26 06:13:27 +02:00
Gunnar Sletta b0149afd07 Make Canvas a texture provider.
Change-Id: I8b5c9d8a5ed9ef9079eafb30ef0cb73786204ee6
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-26 06:12:51 +02:00
Gunnar Sletta 1075dca1b5 Added an example that shows how to consume texture providers from C++.
And how to use use two textures in the same material.

Change-Id: Idcc618ed359422c2a104eeed105b7c4f5086ee4e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-26 06:10:51 +02:00
Gunnar Sletta 3035fd9ad9 Clamp QQuickItem::opacity to [0,1].
This was an oversight the the implementation of
setOpacity. QSGOpacityNode already does the right thing.

[ChangeLog][QtQuick][Item] When Item.opacity is set to a value outside
the range of 0 to 1, it will be clamped.

Change-Id: Ib7f23c5d8860c76e009a25e5ab2c36db20301faf
Reviewed-by: Raine Mäkeläinen <raine.makelainen@gmail.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
2014-08-26 06:10:07 +02:00
Lars Knoll eadc35f499 Don't use d->instanceModel after free'ing it
prevModel points to d->instanceModel and is being
used further down in the code. So reset the pointer
to 0 after freeing the old instanceModel.

Change-Id: I8854ae3e09c8b2fe50ad311f3dbc7b8ed26805e1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-26 05:50:50 +02:00
Tasuku Suzuki d28a3b7b19 Mark custom node in textureinthread dirty after rendering texture
Change-Id: I4401a6db18b1fcc69403062f3f4775d3b62dfd3e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-08-26 03:43:52 +02:00
Pelle Johnsen 81975f5fe7 Fix QML2 hang on gcc 4.6.3 armhf
With gcc 4.6.3 armhf (defualt for Ubuntu 12.04) some optimization bug
results in QML2 v4 compiler hang during type inference.

Task-number: QTBUG-40364
Change-Id: Iea1a8be3b5a7d9410304110d89dae3735339cb72
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-25 22:54:41 +02:00
Sebastian Sauer cae7176827 QSM: Reintroduce guard argument evaluation
Implements the suggestion from Simon Hausmann (codereview 89716
from 08-05 14:46) to use QQmlScriptString rather then the previous
used MetaObject-manipulation.

This also introduces comparison operators for QQmlScriptString
to be able to determinate if a QQmlScriptString changed what
is needed cause there is otherwise no way to access (all) the
needed details within QQmlScriptStringPrivate.

Change-Id: I198479eac8fd37cbdd98a99aacdd8eebf7b75d21
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-25 17:29:21 +02:00
Simon Hausmann b0835b31fd Fix crash with early QObject property access
In the reported bug, it can happen that we try to access the compile-time resolved
QObject property of an object that is referenced by id. The binding that uses this is
triggered when the property changes but _also_ when the id referenced object gets either
created or deleted. The first time the binding is evaluated is very early on, when the
id referenced object is not created yet, so the binding evaluation fails. However the
dependency is set up, and so later then the id referenced object is created and the id
property is set on the context, the notification triggers and the binding is re-evaluated.
During that binding evaluation a QObject property access happens by index on an object that
doesn't have its VME meta-object set up yet. Therefore the property access fails and a
crash occurs or the Q_ASSERT(property) assertion fails.

The fix is to set register the id named object in the context _after_ the VME meta-object is
setup.

Task-number: QTBUG-40018
Change-Id: Ic2d7b4a0c49635efe68e93f2f6c316eb65f0c309
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-08-25 15:42:15 +02:00
Albert Astals Cid 9fcb883aab Fix typo in DelegateModelGroup documentation
Change-Id: Ic01f0935c469f85f32699aebaeb1fc6f8b2279fb
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-08-25 14:41:55 +02:00
Mitch Curtis 99fd3a6b22 Remove references transforms have to items in QQuickItem's destructor.
In case they try to remove themselves from our list of transforms when
that list has already been destroyed after ~QQuickItem() has run.

Task-number: QTBUG-40877
Change-Id: Ie57f5dd1e8b791846f08629183974c771553c4bf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-08-25 14:41:34 +02:00
Lars Knoll 8ef1e1e7a4 Protect some members in QQmlObjectCreator
Avoid dangling pointers when nested incubators are being used.

Task-number: QTBUG-40437
Change-Id: I73922d2f373b2efbc00983305cdea9e8d60f0c41
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-25 14:28:00 +02:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-08-25 11:28:46 +02:00
Lars Knoll 44108a88dd Initialize variable
Change-Id: Ia54dc43d22b8edaa49634c6a364f87b4a06d659d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-24 17:53:41 +02:00
Lars Knoll d41121119b Don't abuse new to do a reinterpret_cast
Using new to do a reinterpret_cast is rather confusing.
Also protect the list model case against self-assignment
which could lead to memory corruption.

Change-Id: I10b81644d0004d4a50a5a74e5b8c58e27cbe6934
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-24 13:38:25 +02:00
Albert Astals Cid 4f98d16c66 Add const & to arguments
Change-Id: I1bcf69638fee32b6e6565b8ea828c0adcff48a67
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-24 09:56:59 +02:00
Gunnar Sletta 23776181b8 Mark QQuickFBO's node dirty after rendering the texture.
It is impossible to use in a shader effect otherwise.

Change-Id: I489e6ae43cdc3fe8f54efa6d86ead4d21831b84d
Task-number: QTBUG-40809
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-24 08:32:26 +02:00
Gunnar Sletta 3f117a3901 Introduce QQuickWindowQObjectCleanupJob.
Convenience for cleaning up texture providers. Private class for now,
we can maybe make it public in 5.5.

Change-Id: I3489fde2a268bc988634a16f87ee558b9ac5dba2
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-24 08:32:14 +02:00
Simon Hausmann 441dca4592 Improve the internal NodeVisitorEx API
Allow the implementation of visit to control whether the children should be
processed afterwards or not. This is modelled after the JS AST visitor in
Qml.

Change-Id: I5b1adf5e1aefd8899bf444e993ddfbf2c5c125c9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-08-23 10:55:35 +02:00
Gunnar Sletta 8d0e307bc7 Downscale textures which exceed the GL texture limit
This way they will at least render.

[ChangeLog][QtQuick] Images exceeding GL_MAX_TEXTURE_SIZE will be
downscaled to fit so they will still show.

Change-Id: I169ecac768036812b8e14265ec1a0a8902655666
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-23 08:00:43 +02:00
Gunnar Sletta a400d33e81 Protect incubation against its creator being deleted.
Change-Id: Ica7ed02c9b67243310ddce3feaf91935b699086d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-23 08:00:26 +02:00
Simon Hausmann 15ee12508e Cleanup: Separate the sub-tree layering out of QtQuick into the scene graph
This basically renames QQuickShaderEffectTexture to QSGDefaultLayer and
introduces QSGLayer as interface to be used. QQuickShaderEffectTexture is
generic for the scene graph and has no QtQuick dependencies. The interface
separation allows scene graph backends to customize layers.

Change-Id: I9a7f37addaa4b80a34ff9a1456b0cb9b16d4e9f3
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-23 07:56:30 +02:00
Gatis Paeglis 253e9257e1 Introspect qrc files in FolderListModel.
And don't use "file watchers" for resource file paths,
otherwise it generates the following warning:

QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No
such file or directory

Change-Id: I6b75c9195fb2b2ba7b3e0bb7d146fc5cd343927e
Task-number: QTBUG-40307
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-08-22 23:00:37 +02:00
Laszlo Agocs 3cc2b8d7d9 Avoid creating fbo with zero size in QQuickWidget
Get rid of incomplete attachment warnings on Android.

Change-Id: I7da546861b1814677b0c8ae110416f69bbbb7edc
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-08-22 22:06:05 +02:00
Alan Alpert b43e6b76eb Add 5.3.2 changelog for qtdeclarative
Change-Id: I33e8149ec9e2f7ecfebb7f55de0dbb291805be93
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-22 21:14:23 +02:00
Simon Hausmann e59482f7f5 Fix crash with recursively loading cached compilation units
When a cached compilation unit depends on an import that is implemented as a
Qml C++ plugin and that plugin in turn loads an asynchronous component that is
cached, we would get a crash in the typeloader and a failing assertion
(ASSERT: "d->m_mainThreadWaiting == false" in file qml/ftw/qqmlthread.cpp, line 300)

This is because we did not implement the asynchronous loading within the loader
thread for cached compilation units. This is simply done using a posted event,
using the same mechanism used for other async load methods.

Change-Id: Iefce67ab634ce26122c348dcdfc8e66b00fec671
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-08-22 21:13:44 +02:00
Simon Hausmann d9c531781e Cleanup: Remove ShaderEffectSourceNode
We can simply use a standard image node and do the dirty marking also
directly in the texture (both live in the same thread).

Change-Id: I7345c702613782adec3c6a36a7705a2a54ed82ec
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-22 21:13:28 +02:00
Sebastian Sauer 595340f162 v4: Enable primitive conversation to QQmlScriptString in javascript
This makes following QML-code proper working:

ParentChange {
  x: 0
  Component.onCompleted: x = 10
}

where x is a QQmlScriptString.

Before this patch an error-message would be thrown that the
bool/int/string/etc cannot be converted to a QQmlScriptString.

With the patch primitive types including null and undefined are
proper converted to a QQmlScriptString. The patch ignores (as
in not implements) function/binding assignment.

Unfortunately since commit aa25ad8d5f its not possible any
longer to instanciate QQmlScriptString what means there is
otherwise no (easy) way to inject a QQmlScriptString from
within Javascript.

Change-Id: I18aac6a6e9a57f3b7d0a2d66cdab2be6c3c153c5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-22 20:46:08 +02:00
Gunnar Sletta 29efdf1981 Fix memory corruption in shader materials.
Change ee616b3905 accidentally
removed the member variable used to refcount the attribute
names. This resulted in the names being deleted and the
stored const char *'s to become invalid. Add it back.

Change-Id: Ie33f75cd76085283a5ee685602e023bb3c42c896
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-08-19 09:50:53 +02:00
Mitch Curtis 74325015e7 Fix typo in StateChangeScript documentation.
Change-Id: Iec72331c183ea02680bad01f04eae82ebd815cdb
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-19 07:40:05 +02:00
Erik Verbruggen 2ae518d3a4 V4 IR: Add loop peeling.
By peeling the first iteration off of a loop and putting it in front of
the loop, type inference can deduce more type information for esp. loop
induction variables. To prevent increasing the code size too much, only
the inner-most loops are peeled.

This gives a 10% speed-up on crypto.js.

Change-Id: I57f9611695bc8defc0bff84e440b8a20b2c8a34e
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-08-18 16:05:55 +02:00
Erik Verbruggen 7e5a589b90 V4 IR: add immediate dominator re-calculation.
When removing edges, the control-flow graph changes, so some immediate
dominators might need to be updated. This change collects all candidates
and processes them in a single batch.

Change-Id: I928f42232427a84bcb9658e314dadd0bd021b12f
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-08-18 16:05:51 +02:00
Topi Reinio 23193dbdd1 Doc: Removing url variable from qdocconf file.
-url inherited from the url variable set in qtbase/doc/global

Change-Id: I94a0da7aa98af1fdd6140168fe9feb27b11c0bdb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-08-16 12:56:45 +02:00
Alex Montgomery 672c533bde Fix setContextObject to re-evaluate bindings
Fix QQmlContext::setContextObject to reevaluate bindings as the
documentation says that it should.

Task-number: QTBUG-40798
Change-Id: Ifbd97c7a07a5432f4948937da863370b05705206
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-15 18:48:33 +02:00
Laszlo Agocs 63f0c196ee Fix cursorShape with QQuickWidget
Task-number: QTBUG-40729
Change-Id: If3b2f8ca8795da1ac7c626db9c872f735d1e7b5d
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-08-15 10:35:01 +02:00
Venu 1d0d8413de Added the QtSQL dependency info. to the project file
Without this information the app fails to find the plugin
required to load the QtQuick.LocalStorage module on Android.

Task-number: QTBUG-37203
Change-Id: I245012e78ab8d1fe3205e08939f4baec58c20759
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-08-15 10:29:50 +02:00
Simon Hausmann 82fc196252 Cleanup
Merge QV4::CompiledData::QmlUnit into QV4::CompiledData::Unit. For pure JS
units it means a slight increase of memory usage by a few bytes, but overall it
makes the code a lot simpler.

Change-Id: Ib48927749720b056f004aac0fe22cb8ec729e3f6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-08-15 08:28:43 +02:00
Robin Burchell 47380a930e tst_dialogs: verify that rootObject is valid
if there's an error during loading, it's much easier to spot if this fails
rather than crashes.

Change-Id: If0106729e18768819da8a877959a095398af8547
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-08-15 06:16:10 +02:00
Robin Burchell 16f2557a2e tst_dialogs: QTRY_ on the expression (spyVisibilityChanged.count) not the variable.
We only assign to the variable once, so the value may not change in time.

Change-Id: I54ac7faad60d3984bfde4606aaf7e30a2340ba3e
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-08-15 06:15:59 +02:00
Gunnar Sletta b29fac2d05 The cached objects can be deleted, so keep them in a QPointer.
Change-Id: Ieaebd2e7b9823cbe22efc331e42ceab8fbbda0e8
Task-number: QTBUG-40201
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-08-14 17:06:17 +02:00
Laszlo Agocs ddb134af99 Fix flicker when showing QQuickWidget
This also reintroduces the change from commit 14b4747b17.
Due to some bizarre merge issue that change has disappeared from qquickwidget.cpp
and its history. It is there in the main log, though.

The new fix depends on this older one, so the combined one fixes the following
three issues:

1. Polish and sync cannot be skipped when we are rendering for the first time.

2. Recreating the fbo twice when the widget is shown. Calling
createFramebufferObject() is not necessary in this case since createContext()
will trigger this anyhow due to scenegraphInitialized().

3. Avoid recreating the fbo when the size is the same as before. Some platforms
are keen on sending resize events with the same size. These should be ignored.
What's worse, some platforms (cocoa) generate a resize on exitting (Cmd-Q)
and not ignoring the resize at that stage is dangerous since the scenegraph
is already invalidated.

Task-number: QTBUG-40710
Task-number: QTBUG-40505
Change-Id: I2e897acc68fa68233563a1db63ffb6c5d0baad73
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-14 15:58:45 +02:00
Erik Verbruggen ccb1eb743d V4 JIT: fix int32 to double conversion code
Missing else: two (nearly identical) conversions would get generated.

Change-Id: I745120f81d42bf28fbce7ab6a62da909a8e14458
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-14 15:58:12 +02:00
Erik Verbruggen 35d76da20a V4 JIT: add d8-d15 as available FP registers on ARM.
VFP3-d16 is the minimum implementation available on ARMv7, so these
registers are also always available. The big added bonus is that they
are callee saved, so using them will result in less loads/stores for
doubles.

Change-Id: I0cab3fe24d8677315b4c7d9449d8619cbf9a2919
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-14 15:28:04 +02:00
Erik Verbruggen 8e47157252 V4 JIT: support saving used callee saved FP registers.
This is not used yet by any platform/abi we support, because we do not
define any callee-saved FP registers. Yet.

Change-Id: I5857a452456175398c5e9681ff33800b9431b9da
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-14 15:27:59 +02:00
Erik Verbruggen a503efe0df V4 JIT: calculate used registers and only save those.
Instead of saving all possibly used ones. Note that floating point
registers are not saved yet, as we don't support callee-saved FP
registers yet.

Change-Id: I1db2ba2513f7b466c64ec103eda0c464269247b0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-14 15:27:55 +02:00
Erik Verbruggen d9f33ccdef V4 JIT: parameterize the prologue and epilogue generation
... with the regular (non-FP) registers that need to be saved. This
patch shouldn't change any of the JIT generated code, because all
regular callee saved registers are passed in.

Change-Id: Id11b8f37f06d80e8015ac6f0d0ccefdfa3342cbe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-08-14 15:27:51 +02:00