aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcomponent.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Convert regexpsLars Knoll2014-07-221-18/+19
| | | | | | | | | | Change-Id: I5b62a265a7ce363a16b1e14ae93cadbb1ab0cb5b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of all uses of ObjectRefLars Knoll2014-07-221-1/+1
| | | | | | | | | | Change-Id: I705e2362dcda542f56826dadec6b0a6f15848788 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert ExecutionContext to new storage schemeLars Knoll2014-07-221-8/+8
| | | | | | | | | | Change-Id: I9fcc13da5360f37cef3149b114ed9263b9b74281 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Rename V4_OBJECT_NEW back to V4_OBJECTLars Knoll2014-07-221-1/+1
| | | | | | | | | | | | | | | | 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 the incubator object to new storage layoutLars Knoll2014-07-221-37/+47
| | | | | | | | | | Change-Id: Ib4b3168349520ea872046cd90e5eedf48945b467 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-021-3/+3
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/quick/scenegraph/openglunderqml/squircle.h src/quick/doc/src/qmltypereference.qdoc src/quick/scenegraph/qsgthreadedrenderloop.cpp Change-Id: Ife4f4b897044a7ffcd0710493c6aed1d87cf1ef9
| * Fix memory leak in QQmlComponent::createObjectSimon Hausmann2014-06-231-2/+2
| | | | | | | | | | | | | | | | | | Regression introduced with 5.3.0. Prevent the leak of the object creator on repeated createObject calls by using a scoped pointer. Change-Id: Ib4fe7c9c6926c2390f7ae78f3287bb7da5f60527 Task-number: QTBUG-39742 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Fix QQmlComponent detailed description.Mitch Curtis2014-06-201-1/+1
| | | | | | | | | | | | | | | | setParent() => setParentItem() Task-number: QTBUG-39687 Change-Id: I67dc871a6d3b10af321d1f7b08921dcad0a6f19d Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Cleanup: Get rid of the url and file name members in QQmlCompiledDataSimon Hausmann2014-06-051-1/+1
|/ | | | | | | | This is part of the effor of moving members from QQmlCompiledData into QV4::CompilationUnit in order to eliminate the former in the long run. Change-Id: Icce7fe0ee9a49cb3a7677fd7020008fc55ecdcf6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: Document signals (not handlers) under \qmlattachedsignalSze Howe Koh2014-03-281-8/+8
| | | | | | | | | | - They're not "attached properties" either. - Append the handler names to the end of the corresponding signal doc. - Update descriptions and links Task-number: QTBUG-35846 Change-Id: I54e93187b3209546ec344a20e0482c98d7f14109 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Cleanup: Remove last traces of QQmlScriptSimon Hausmann2014-03-191-1/+0
| | | | | | | | | | What remains is the code for removing .pragma from script source code (and replacing it with white-space to preserve line/column numbers). The previous code even returned the value of the pragmas, but for the remaining caller sites that value isn't used, so we can just return void. Change-Id: I16db15da236970660b817d6c4493005365a7a1af Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove old compiler and VMESimon Hausmann2014-03-071-35/+16
| | | | | | | | | | | | This removes the bulk of the code. A few smaller cleanups remain, to be done in smaller changes as they move code around. Additionally the "optimize" option of qqmlbundle was removed. It called QQmlScript::Parser::preparseData, which however was not implemented and always returned an empty QByteArray. Therefore "optimize" would not do anything and the class is gone now :) Change-Id: I0c265e756704cb53c5250be1f69e4a3e1b6e64d5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Add support for deferred propertiesSimon Hausmann2014-03-051-1/+7
| | | | | Change-Id: I592518444ef353cfcf153df0e6afa2fbac613560 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix some qqmlincubator testsSimon Hausmann2014-03-041-1/+1
| | | | | | | | | | | | | | | We need to track the objects created and pass them over to the VME guard used in the incubator. The incremental build nature of the incubator requires that to avoid crashes. For nested incubators we need to set the activeVMEData field in the root QQmlContext, to allow child incubators to locate the parent. Lastly we need can emulate most of the VME behavior in terms of build states when running with QQmlInstantiationInterrupt by presenting four build steps: The initial state, two build steps, a finalization step and the state when we're done. Change-Id: I16cd7f71744decb9d4735ec77e9d944fad18e88d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Document qmlContext() and qmlEngine().Mitch Curtis2014-03-041-0/+20
| | | | | | | | | | | | | | | | | | | 146b942d59cca446516652d42718197573d34e46 documented them (Qt 5), but for some reason they aren't visible [1]. c74e4a74ba97d32df7406fb684527d415dd8a6ba (Qt 5.1) then moved them into the QtQml namespace "to avoid symbol conflicts with QtDeclarative", and then did the following trick so that they could be called without qualifying the functions with the namespace: using namespace QtQml; For that reason, qdoc shouldn't see the namespace, so we #ifdef it out. [1] project.org/doc/qt-5.0/qtqml/qqmlengine.html Change-Id: Id815ae4de7f081c22755eef7c37a2bc6e812b440 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* [new compiler] Match class and file nameSimon Hausmann2014-02-161-2/+2
| | | | | | | QmlObjectCreator -> QQmlObjectCreator Change-Id: I23da2d9c7fa0dcd760f5cc695c1759b44d1e72f0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Cleanup object creator membersSimon Hausmann2014-02-161-1/+1
| | | | | | | | Collect variables shared across recursive instances in a SharedData structure, get rid of some other members. Change-Id: I8d52fbb34820ce17d754b91c3fdee9e534a95753 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix component attachment linking across sub object creatorsSimon Hausmann2014-02-071-1/+1
| | | | | | | This brings up the list view in the components gallery. Change-Id: Ib91ca3b30b8093acad0343b47be60cf4b51e4da7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Allow for interruption during object finalizationSimon Hausmann2014-02-071-1/+2
| | | | | | | | | The object tree construction and binding allocation remains synchronous, but the initial evaluation of the bindings is now cooperatively interruptible again, like in the VME. Change-Id: Idd037dd481782c81ad43e20e93d922eb12ac8b85 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix propagation of imported scripts for anonymous componentsSimon Hausmann2014-02-051-2/+2
| | | | | | | | We must take the imported scripts from the creation context. Fixes various errors in Qt Quick Controls. Change-Id: I336d8ffa0537cefd4eeac15f98bbf1b0a5c784af Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* CleanupsLars Knoll2014-01-311-3/+3
| | | | | | | | | | Remove SafeValue, it was used to port over to an exact GC. Since we now have that, we can now safely merge it with QV4::Value again. Also rename SafeString to StringValue for better naming consistency. Change-Id: I8553d1bec5134c53996f6b0d758738a0ec8a2e4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Split ManagedVTable into two classesLars Knoll2014-01-211-3/+3
| | | | | | | | Keep the basic methods in ManagedVTable, but have the Object related stuff in an ObjectVTable class. Change-Id: I9b068acf3caef813686227b8d935e7df1a7d1a6e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* [new compiler] Preliminary support for QQmlIncubatorSimon Hausmann2014-01-081-1/+5
| | | | | | | | Just enough to run some unit tests that use QQuickLoader, components are created instantly. Change-Id: I1c827aa946d3e2a60ccc220bb79572aca2ed8c96 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove unused static functions from QtQml found by Clang 3.4Thiago Macieira2014-01-041-28/+0
| | | | | | | qqmlcomponent.cpp:112:23: error: unused function 'buildTypeNameForDebug' [-Werror,-Wunused-function] Change-Id: I5cc82b20fee8e3f0b61ad59b831723359c8dcda4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Encapsulate the current context and fix it's usageLars Knoll2013-12-041-1/+1
| | | | | | | | | | | Encapsulate accesses to the current context, and rework the way we push and pop this context from the context stack. Largely a cleanup, but simplifies the code in the long term Change-Id: I409e378490d0ab027be6a4c01a4031b2ea35c51d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the vtable pointer from the object to the internal classLars Knoll2013-12-041-1/+1
| | | | | | | | This saves one pointer per object, and willmake other optimizations easier in the future. Change-Id: I1324cad31998896b5dc76af3c8a7ee9d86283bfe Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove old qml object creation profilingUlf Hermann2013-11-291-16/+0
| | | | | | | | | | The old way the object creation profiler works is unsuitable for detailed profiling as it only tracks top level components. Task-number: QTCREATORBUG-10631 Change-Id: I502d0e144f2965f5e09af8461b50b56c61de5b4b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Simplify & speed up function callingLars Knoll2013-11-091-10/+10
| | | | | | | | | Get rid of the SimpleCallContext, instead simply use the CallContext data structure, but don't initialize the unused variables. Change-Id: I11b311986da180c62c815b516a2c55844156d0ab Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Refactor marking GC'ed objectsLars Knoll2013-11-051-6/+6
| | | | | | | | | | | Don't use recursive function calls anymore. Instead, push marked objects onto the JS stack, and then pop them off when their children are being marked. Should reduce stack memory usage, and improves performance by ~5%. Change-Id: I2d37d97579144fcba87ec8e9fd545dd220c01fbb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Fix broken linksSze Howe Koh2013-11-051-2/+2
| | | | | | Change-Id: Ie7408409ddbaa354370267f2dd74326ec56a4186 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
* Fix various compiler warnings in order to remove warn_off in the near futureErik Verbruggen2013-11-041-4/+0
| | | | | Change-Id: Ic0492fbe31a1e134674bc6c20381f735dd6d5b7a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix the remaining try/catch statements in C++Lars Knoll2013-10-291-6/+6
| | | | | Change-Id: I2421dc48fb271b66bd476fb16a32a88fcc4c5177 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Avoid side effects when en exception has been thrown.Lars Knoll2013-10-291-5/+5
| | | | | | | | | | | | | | We don't want to check for exceptions after every single line on our runtime methods. A better way to handle this is to add the check in all methods that have direct side effects (as e.g. writing to a property of the JS stack). We also need to return whereever we throw an exception. To simplify the code, ExecutionContext::throwXxx methods now return a ReturnedValue (always undefined) for convenience. Change-Id: Ide6c804f819c731a3f14c6c43121d08029c9fb90 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Properly propagate parse errorsLars Knoll2013-10-291-1/+1
| | | | | | | | Replace all try/catch statements used when parsing with checks for engine->hasException. Change-Id: I4493cb600d5a3eb095c2003bb88bd031403e47c9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove internal method from public APILars Knoll2013-10-191-1/+1
| | | | | | | | QQmlError is public API and shouldn't expose an internal method. Change-Id: I7caf06af9340fefec5c96103395fe74acbf19497 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make QQmlIncubatorPrivate refcountedLars Knoll2013-10-151-1/+1
| | | | | | | | | This fixes possible bugs and crashes where the incubator could get deleted through GC while constructing the component. Change-Id: Ibe0c5d4e172f0b5505ace0c3ea0369169b8b48a5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make sure the incubated object survives the statusChanged callLars Knoll2013-10-151-6/+10
| | | | | | | | | | | | QQmlComponent::statusChanged() marked the incubated object as destructable when it was done loading. This implied that any gc call afterwards could clean it up. To fix, push the object on the GC stack so it lives until the method returns. Also renamed the WrapperIncubator to QQmlComponentIncubator. Change-Id: I5a8f478a1fd65ea73ddff310392219709a935a70 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix GC issue with incubatorsLars Knoll2013-10-151-19/+45
| | | | | | | | | | | | Never use multiple inheritance with Managed subclasses, as this can easily mess up garbage collection. In this case the vtable from the QQmlIncubator would be added before the start of the Managed pointer. That would not work correctly for the memory manager that casts void pointers to Managed pointers. Change-Id: I1c1ebc6c44bd9cb77eea49738e86ce3374c7ef80 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change exception handling APISimon Hausmann2013-10-021-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the exception handling API in the engine slightly, encapsulating any use of direct throw statements and catch blocks with concrete types. In the future we need to be able to change the way these are implemented, in order to ensure that the correct stack unwinding code is triggered for throw and re-throw. This patch separates the C++ exception object thrown from the V4 exception (that includes value, throwing context pointer) and stores the latter inside the engine. In order for that to compile, ExecutionEngine::StackTrace and StackFrame had to move into the QV4 namespace directly. In addition the syntax for catching exceptions changes from try { ... } catch (QV4::Exception &ex) { ex.accept(context); QV4::ScopedValue exceptionValue(scope, ex.value()); } to try { ... } catch (...) { QV4::ScopedValue exception(scope, context->catchException()); } Context::catchException() checks if there's a "current" exception in the engine, and if not assumes that we caught an unrelated exception and consequently re-throws. partiallyUnwind() is also gone and replaced with rethrowException(), in order to encapsulate the re-throw. Lastly, in the future nesting try/catch blocks isn't going to be possible due to limitations in the common C++ ABI with regards to foreign exceptions. Change-Id: Ic81c75b057a2147e3176d8e0b4d326c14278b47d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-1/+1
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Remove most uses of Value from qml/qmlLars Knoll2013-09-301-10/+9
| | | | | Change-Id: I409a8505a9e01f86d777bc694d24516d1c8f0c4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Less QV4::Value usageLars Knoll2013-09-281-4/+4
| | | | | | | | Fix some usages in qv4engine, and fix return types in methods in qqmlxmlhttprequest. Change-Id: I3d6225ca01bf7ea77fcc424914c8392bb6c3a454 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Value::fromBool, ... to a new Primitive classLars Knoll2013-09-281-6/+6
| | | | | | | | This will simplify finding the remaining direct usages of QV4::Value that need fixing. Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix CallContext to not hold arguments on the C stack anymoreLars Knoll2013-09-281-7/+12
| | | | | Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Updated imports, \qmlmodule, and \inqmlmodule versions in src/qml.Jerome Pasion2013-09-271-1/+1
| | | | | | | | | | | | -QDoc ignores the version in \inqmlmodule so its better to remove them to avoid confusion. -Qt QML import version is 2.2 for 5.2 release -Qt Quick import version is 2.2 for 5.2 release Task-number: QTBUG-32172 Change-Id: I15df270f1fb4df0476a9ddd854fb9ddf58e9fc7c Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix QQmlV4Function API to be GC safeLars Knoll2013-09-261-23/+24
| | | | | Change-Id: Id4f79c22fc48ada1c8a9a858e1b7b3d1cf14d120 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix Persistent/WeakValue APILars Knoll2013-09-261-15/+19
| | | | | | | Don't use unprotected Values in the API anymore. Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix cases where mark() would access uninitialized memoryLars Knoll2013-09-221-2/+3
| | | | | Change-Id: I4e07e20d30ba57759a0ece1c298a02b098718b33 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup Object::define*Property APILars Knoll2013-09-221-4/+4
| | | | | Change-Id: I99125908a9bc1d41a2642c409af9704def7a0832 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Start using StringRef for parameter passingLars Knoll2013-09-221-3/+3
| | | | | Change-Id: If2c41daeda2862cd1162c5da8163a9d62fe4111d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>