aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Simon Hausmann2014-08-266-15/+40
|\
| * Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-266-15/+40
| |\ | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlobjectcreator_p.h Change-Id: I60858ddb46866a8fa1a8576bb05b412afeeb4e41
| | * Fix crash with early QObject property accessSimon Hausmann2014-08-252-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * Protect some members in QQmlObjectCreatorLars Knoll2014-08-252-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | Avoid dangling pointers when nested incubators are being used. Task-number: QTBUG-40437 Change-Id: I73922d2f373b2efbc00983305cdea9e8d60f0c41 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| | * Protect incubation against its creator being deleted.Gunnar Sletta2014-08-231-1/+1
| | | | | | | | | | | | | | | Change-Id: Ica7ed02c9b67243310ddce3feaf91935b699086d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| | * Fix crash with recursively loading cached compilation unitsSimon Hausmann2014-08-222-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | QSM: Reintroduce guard argument evaluationSebastian Sauer2014-08-252-0/+41
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Update license headers and add new licensesJani Heikkinen2014-08-25160-3030/+1750
| | | | | | | | | | | | | | | | | | - 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>
* | Add const & to argumentsAlbert Astals Cid2014-08-242-1/+14
| | | | | | | | | | Change-Id: I1bcf69638fee32b6e6565b8ea828c0adcff48a67 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | v4: Enable primitive conversation to QQmlScriptString in javascriptSebastian Sauer2014-08-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 aa25ad8d5f4 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>
* | Fix setContextObject to re-evaluate bindingsAlex Montgomery2014-08-151-0/+1
| | | | | | | | | | | | | | | | | | 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>
* | CleanupSimon Hausmann2014-08-157-40/+36
| | | | | | | | | | | | | | | | | | 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>
* | Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Simon Hausmann2014-08-122-9/+7
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-122-9/+7
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4include.cpp src/quick/items/qquickrendercontrol.cpp src/quick/items/qquickrendercontrol_p.h src/quickwidgets/qquickwidget.cpp Change-Id: Ib2dc0051a38cd283a37a7665eb4a76f6f7ec8b15
| | * Avoid double deletion when deleting an incubating component.Martin Jones2014-08-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The guard in QQmlIncubatorPrivate::clear() was invalidated by clearing the guards in QQmlIncubatorPrivate::incubate() when a deletion was detected. If we detect a deletion, leave the guards in place, to be handled in QQmlIncubatorPrivate::clear(). Task-number: QTBUG-40685 Change-Id: I1bf7422fda97745f1f7a3b42285a399244c09a1f Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| | * Clarify Component.onCompleted/onDestruction docsGunnar Sletta2014-08-061-5/+4
| | | | | | | | | | | | | | | Change-Id: I86bb6b85043282f4f46a685e30b435a2f7430430 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | | Doc: Remove duplicated wordsTopi Reinio2014-08-121-1/+1
|/ / | | | | | | | | | | | | | | Removes duplicated (repeated) words and fixes other minor documentation issues. Change-Id: I891f2b3e60194b207737425c1dcc1d35a5bd921a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* | Merge "Merge branch '5.3' into dev" into refs/staging/devGunnar Sletta2014-08-081-1/+0
|\ \
| * | Merge branch '5.3' into devGunnar Sletta2014-08-071-1/+0
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/context2d/qquickcontext2d.cpp src/quick/items/context2d/qquickcontext2dtexture.cpp Change-Id: I1a9b911b3a92333a5dddbaf43275f71bad2006f0
| | * Fix assertion: ASSERT: "hasException" in file jsruntime/qv4engine.cpp, line 933Robin Burchell2014-07-311-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was seemingly tripped by trying to catch the exception twice: once with catchException and once with catchExceptionAsQmlError. Change-Id: I7176d56fe6e6f748e80d0894e314ed2b8f6e751d Done-by: Mikko Harju <mikko.harju@jollamobile.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | | Accelerate property lookups for C++-based QObject singletons.Michael Brasser2014-08-073-1/+16
|/ / | | | | | | | | Change-Id: Icbdf06a077014db5dd57cba42f84591433ec4196 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-293-7/+23
|\| | | | | | | Change-Id: Id95f7b01de36bccecbb7b73acc041654a1fe2ebe
| * Don't dereference null pointer.Sérgio Martins2014-07-281-1/+1
| | | | | | | | | | | | Task-number: QTBUG-40448 Change-Id: I75eb886ae765191101d6b01ebd038211e5fe8fba Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Fix interaction of garbage collector with JS objects during QML type ↵Simon Hausmann2014-07-262-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instantiation It may happen that during the lengthy process of instantiating a tree of objects for QML, the garbage collector runs. For objects created by QML we support different ownership models, for example in QtQuick visual parents keep their visual children alive, despite perhaps a lack of QObject parentship. That ownership becomes active once the QML autoparent function has assigned the correct visual parent, which happens after object instantiation (after QQmlObjectCreator). Similarly when a composite type is created, its QObject parent is only set after all properties have been set. The root QObject is kept alive through a special boolean, but if the sub-objects aren't children yet, their JS wrapper might get deleted. For composite types with var properties, that also means their var properties get deleted, such as the model property of TableView.qml in the bug report. In the future we want to support creating QWidget hierarchies with QML, which also for layouts may rely on a delayed parent assignment for layouts. To accommodate all this, this patch introduces an array on the JS stack that keeps track of all JS wrappers for all QObjects created. This array is alive during object tree creation. Afterwards, the different ownership models take over, for example the auto parent function assigning a visual parent. This patch also fixes an off-by-one in the total object count calculation for composite types, where when instantiating a composite type as a sub-object we counted the sub composite's object count but forgot the object itself. Task-number: QTBUG-38835 Task-number: QTBUG-39966 Change-Id: I6104b2434510642081e0c54793ed296adeca7481 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devSimon Hausmann2014-07-261-0/+5
|\| | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4engine.cpp Change-Id: Ie3ef6202b6a3a8521971e1be10c40c6a2db6989c
| * QQmlComponent::create(): visual items must have a visual parent.Mitch Curtis2014-07-241-0/+5
| | | | | | | | | | | | | | There seems to be a bit of confusion about this on public forums. Change-Id: Id193de541e7d7e353dc5d75b64a15f481e2cf8b6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | qmlRegisterCustomExtendedType, qmlRegisterExtendedUncreatableTypePaul Lemire2014-07-251-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases in Qt3D where we'd like to be able to register uncreatable extended types. The main use case is having an abstract class that has an extension class so as to have a clean separation between the C++ and QML API. Implementations of the abstract can then be easily registered to QML and rely on the extension class for QML specific properties. The other feature we'll need in the near future is the ability to create extended QML types that use a custom parser. Two new type registration method were added to qqml.h to fulfill those needs. Unit tests for those are present in qqmlecmascript and qqmllanguage. Change-Id: I15b2cd791ffd36b537305af1873491c079d4094e Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | QQmlError::toString: improve handling of empty urls.David Faure2014-07-242-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | "file::2:23: ..." is strange to read. Show "<Unknown File>:2:23: ..." instead, by treating empty urls (including "file:") as unknown, and by still showing line and column numbers in such a case. This change makes it possible for QUrl::fromLocalFile("") to return an empty url rather than "file:", which this module was relying upon in the tests. Change-Id: I91918090fd4e0aa9a25dbbb18893a0ce94140e21 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanup: Get rid of __data membersSimon Hausmann2014-07-229-89/+0
| | | | | | | | | | | | | | These are not needed anymore Change-Id: Ib834aa294e84ca9fbdd5b6850d5bc172e8b54ba1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix Managed::as<>() methodLars Knoll2014-07-229-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The as<> casting method was not doing the right thing in 100% of the cases. It only checked if the object in question was exactly of the type being asked for. It however didn't check if the object was derived from the type. This commit fixes this by adding a parent chain to the vtables, that is then being used to check this safely at runtime. Change-Id: I9e0b13adbda668aee8c7451e2bb71cd6d4e316d9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Change the object allocation schemeSimon Hausmann2014-07-229-29/+29
| | | | | | | | | | | | | | | | | | Instead of allocating the data directly, centralize the object and its ::Data allocation in one place in the memory manager. This is in preparation for additional pointer indirection later. Change-Id: I7880e1e7354b3258b6a8965be378cd09c9467d25 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Convert String to new constructor syntaxLars Knoll2014-07-222-3/+3
| | | | | | | | | | Change-Id: I07f7667d3d72a7d72e6717d194de8d7b15435777 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert regexpsLars Knoll2014-07-223-28/+27
| | | | | | | | | | Change-Id: I5b62a265a7ce363a16b1e14ae93cadbb1ab0cb5b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert context and list wrapperLars Knoll2014-07-224-37/+33
| | | | | | | | | | Change-Id: Ida3ac10092e1fae53f57e2e664f58c6138a17a99 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | New construction scheme for the binding wrapperLars Knoll2014-07-221-2/+2
| | | | | | | | | | Change-Id: Ic248aef22e1222e84dfb9b8af0413cf750beb576 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert TypeWrapper and ValueTypeWrapperLars Knoll2014-07-224-73/+83
| | | | | | | | | | Change-Id: Ib1debebda1cc6dbfaf9c6dca40cde72800a2769b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Construct xhr objects the new wayLars Knoll2014-07-221-120/+101
| | | | | | | | | | Change-Id: I52085f9b807c6d796ba8ed06d9846cde17e068b6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove unused methodLars Knoll2014-07-222-7/+0
| | | | | | | | | | Change-Id: I3830de8c4f01cc7340ab37673024ceea93585a9e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert constructors for builtin functionsLars Knoll2014-07-222-73/+75
| | | | | | | | | | Change-Id: I9db595e5d6ee20a291252566a38ac3bdfff900f6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of all uses of ObjectRefLars Knoll2014-07-224-7/+6
| | | | | | | | | | Change-Id: I705e2362dcda542f56826dadec6b0a6f15848788 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove the less often used Ref classesLars Knoll2014-07-223-5/+4
| | | | | | | | | | Change-Id: I9ee531c903317a0f324671d98af1f967b684915c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of StringRefLars Knoll2014-07-2212-64/+62
| | | | | | | | | | | | | | | | Remove the Ref classes, as they won't be required anymore once Managed and Managed::Data are separated. Change-Id: Ic6bec2d5b4ecf2595ce129dbb45bbf6a385138a5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix compiler warningLars Knoll2014-07-221-0/+1
| | | | | | | | | | Change-Id: Ib1d83a3d14aa0ef3f62b8ec26ff5b8571cdb485c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert ExecutionContext to new storage schemeLars Knoll2014-07-2210-457/+457
| | | | | | | | | | Change-Id: I9fcc13da5360f37cef3149b114ed9263b9b74281 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Rename Managed::managedData() to d() to be consistentLars Knoll2014-07-221-1/+1
| | | | | | | | | | | | | | | | No need to differentiate in the name anymore, as the data structures all inherit from each other now. Change-Id: Ia41f50ce4e521f9626d874311ceb57e0e194888b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Rename V4_OBJECT_NEW back to V4_OBJECTLars Knoll2014-07-228-15/+15
| | | | | | | | | | | | | | | | The _NEW variant was there only temporarily to aid converting to the new data layout. Change-Id: I1d126ee0999c8f0a49f5a08c2e8c090497dd6dd5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert xmlhttprequest to new data layoutLars Knoll2014-07-221-124/+151
| | | | | | | | | | Change-Id: Ia5d9ca1f3ed35290eef82cf1f83b9f0f094092be Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert qqmlbuiltinfunctions to the new storage layoutLars Knoll2014-07-223-22/+34
| | | | | | | | | | Change-Id: Idb075e97a5f62bbfe8086155d13a01d1dbc99c08 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert QQmlValueTypeWrapper to the new storage schemeLars Knoll2014-07-222-60/+67
| | | | | | | | | | Change-Id: Ibbba8652e2d3db8569f5fa69015c6e13fa2ae4c3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert type wrapper to new data layoutLars Knoll2014-07-222-35/+47
| | | | | | | | | | Change-Id: Ie569c4419addf31fc0297bbc4acdf08269a3e80e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>