aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Fixed a few broken links and snippetsVenu2013-12-231-2/+2
| | | | | | | | | | Couple of \snippet references in the ListModel docs were pointing to files outside the exampledirs boundary. Update those references to use the relative path. Change-Id: Ibf9d0fda9e5280345b08cb66a4fe0db9142a42a6 Reviewed-by: Nico Vertriest <nico.vertriest@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Doc: Made copy of the QML files in the snippets directoryVenu2013-12-131-3/+3
| | | | | | | | | | | | | | The Delegate.qml and view.qml files were not in the scope of Qt QML exampledirs. These files were in the example directory under quick, so had to make of copy of them in the snippets directory and update the snippet path to get the snippets in the html output. Task-number: QTBUG-35445 Change-Id: Ic3fa19dbd36b91d76fbc497ab524f5c0ff91325f Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Nico Vertriest <nico.vertriest@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Encapsulate the current context and fix it's usageLars Knoll2013-12-042-7/+7
| | | | | | | | | | | 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-042-4/+4
| | | | | | | | 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>
* Simplify & speed up function callingLars Knoll2013-11-093-11/+11
| | | | | | | | | 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>
* Doc: Fix broken linksSze Howe Koh2013-11-052-3/+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-042-6/+5
| | | | | Change-Id: Ic0492fbe31a1e134674bc6c20381f735dd6d5b7a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix adding created objects to instantiator.kakadu2013-10-291-1/+1
| | | | | | | | | | | | Before all new objects were pushed into the end of QVector, i.e. if item model changes object with low index newly created object will be added like it has big index. So, removing objects from instantiator was buggy. Task-number: QTBUG-33847. Change-Id: I49fba53a40fce72060b629f737c10b525c67cc86 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix the remaining try/catch statements in C++Lars Knoll2013-10-291-14/+11
| | | | | Change-Id: I2421dc48fb271b66bd476fb16a32a88fcc4c5177 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Avoid side effects when en exception has been thrown.Lars Knoll2013-10-291-12/+11
| | | | | | | | | | | | | | 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-5/+7
| | | | | | | | Replace all try/catch statements used when parsing with checks for engine->hasException. Change-Id: I4493cb600d5a3eb095c2003bb88bd031403e47c9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Reset on model layout changedAlbert Astals Cid2013-10-211-2/+1
| | | | | | | Otherwise the next dataChanged from the model may not be received Change-Id: I16b859d92fdb1823c4a56c297d4451abe438fbb1 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove internal method from public APILars Knoll2013-10-191-2/+2
| | | | | | | | QQmlError is public API and shouldn't expose an internal method. Change-Id: I7caf06af9340fefec5c96103395fe74acbf19497 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* inline get_element callsLars Knoll2013-10-141-0/+1
| | | | | | | | | | | Inline calls to get_element if the base is an object with a simple array structure, and the index is an integer number. Implemented for 64bit only for now, saves ~25% on crypto.js Change-Id: I3e34a6409169d90d3937f62264707d52a6c2f9f7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove some unused flags from ManagedLars Knoll2013-10-121-1/+0
| | | | | Change-Id: I94399489823d5b0d4d40f300e1999272dc2da5c9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove usage of String pointers where not requiredLars Knoll2013-10-111-3/+5
| | | | | Change-Id: Ia533308a1641fab263d8faa8316455e8ade1c859 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more direct usages of Managed pointersLars Knoll2013-10-112-29/+33
| | | | | Change-Id: I32f61b7919797eef51a8705695787175b76244c4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change exception handling APISimon Hausmann2013-10-021-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Cleanup API of Safe<T>Lars Knoll2013-10-021-1/+1
| | | | | | | | Don't have an implicit cast operator to Returned<T> anymore, and return a T* from the operator->() Change-Id: If4165071b986bfc84a157560d94d39c2dcfbc9e1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use SafeValue instead of Value in ScopedValue methodsLars Knoll2013-10-021-1/+1
| | | | | Change-Id: Ie463efe600d498ce77d4b9e8b48abcfd61c1ab78 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix ObjectIterator API to be GC safeLars Knoll2013-10-022-29/+28
| | | | | Change-Id: I3a9c48d53d8dbadcb9b32c00fcef1f89447c4b8c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-027-69/+69
| | | | | | | | | | 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 more uses of QV4::ValueLars Knoll2013-09-302-15/+17
| | | | | Change-Id: I11b0b2b7626297e2c98dc77784574da4b59ba8cf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove most uses of Value from qml/qmlLars Knoll2013-09-302-36/+50
| | | | | Change-Id: I409a8505a9e01f86d777bc694d24516d1c8f0c4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix API for Object::define*PropertyLars Knoll2013-09-282-6/+5
| | | | | | | use ValueRef instead of const Value &. Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Value::fromBool, ... to a new Primitive classLars Knoll2013-09-283-7/+7
| | | | | | | | 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-282-10/+16
| | | | | Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Updated imports, \qmlmodule, and \inqmlmodule versions in src/qml.Jerome Pasion2013-09-274-4/+4
| | | | | | | | | | | | -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>
* Convert more methods in QV8EngineLars Knoll2013-09-262-32/+38
| | | | | Change-Id: I5b059b41842b4a6d9541525b3955d2b64c0011c3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move more API over to use ValueRefLars Knoll2013-09-261-1/+2
| | | | | Change-Id: I372f1f3e3e78d45912a913f437e622e0acfc9646 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix QQmlV4Function API to be GC safeLars Knoll2013-09-263-41/+55
| | | | | Change-Id: Id4f79c22fc48ada1c8a9a858e1b7b3d1cf14d120 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix API of QQmlV4HandleLars Knoll2013-09-262-12/+14
| | | | | Change-Id: Iac4a3fefebd33a5990408598486231a5add8e639 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix Persistent/WeakValue APILars Knoll2013-09-262-17/+25
| | | | | | | Don't use unprotected Values in the API anymore. Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Fixed and updated Qt Quick's \qmlmodule pageJerome Pasion2013-09-254-5/+5
| | | | | | | | | | | -incremented version to Qt Quick 2.2 (in \qmlmodule page) -import changed to QtQuick 2.2 -\inqmlmodule no longer needs the version. QDoc will ignore the version but it is better to remove it now to avoid confusion Task-number: QTBUG-32172 Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* convert Managed::put() API to be GC safeLars Knoll2013-09-221-5/+5
| | | | | Change-Id: I09198ce372fa545372db389fac26828d21ad5731 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use a StringRef for Managed::get()Lars Knoll2013-09-221-1/+1
| | | | | | | | | also store "toString" and "valueOf" as identifiers in the engine and fix two places where we compared strings the wrong way. Change-Id: I70612221e72d43ed0e3c496e4209681bf254cded Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup Object::define*Property APILars Knoll2013-09-221-5/+5
| | | | | Change-Id: I99125908a9bc1d41a2642c409af9704def7a0832 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add a Safe<T> class and start using itLars Knoll2013-09-221-12/+15
| | | | | | | | | | The class denotes objects that are stored safely in areas controlled by the GC. These we can convert fast to a StringRef etc. Change-Id: I6b154eccaefddc42d4fafca55b7ee9e77179830c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Start using StringRef for parameter passingLars Knoll2013-09-221-3/+3
| | | | | Change-Id: If2c41daeda2862cd1162c5da8163a9d62fe4111d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Introduce a Referenced<T> class to pass Objects into methodsLars Knoll2013-09-221-2/+2
| | | | | | | | | | Added some convenience typedefs (StringRef, ObjectRef, ReturnedString, ScopedString, ...) Used StringRef in newBuiltinFunction() for testing. Cleaned up the duplicated code for thrower functions. Change-Id: I7b7676690cbe70d9eabb0a5afd0d922f0be3aefd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup ExecutionEngine::newBuiltinFunction() usagesLars Knoll2013-09-222-8/+5
| | | | | | | And change the return type to be GC safe Change-Id: I6d7513962370fea4072a3d8c6b2c6f2d1705992e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Don't use Value::emptyValue() anymore.Lars Knoll2013-09-222-4/+4
| | | | | | | | | | emptyValue is special and reserved for usage inside the engine to mark missing values. The main to use cases are when converting property descriptors, and to mark holes in array data. Change-Id: I0ed357e65102b1041bf9a878e6e9a4ae0657523b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Further work towards an exact GCLars Knoll2013-09-222-19/+28
| | | | | | | | | | | Add some more convenience in the helper classes in qscopedvalue_p.h Make accesses to CallData safer, and change ExecutionEngine::newObject() to return a safe pointer. Change-Id: I980909754ce9681cf6faa1355bab3a1e5d6dd186 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert most remaining return values from Value to ReturnedValueLars Knoll2013-09-184-42/+50
| | | | | Change-Id: If8b0c3b91be50678693868c10fefc3678008834d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert more methods to use ReturnedValueLars Knoll2013-09-181-1/+1
| | | | | | | Change Exception.value() and a few other places. Change-Id: I53ce17e5656e260138b1ac7f6d467e4636c0a0b9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert builtin methods to return a ReturnedValueLars Knoll2013-09-183-24/+24
| | | | | Change-Id: I6b75adbf53a5be0deab023d2eed98ce2a7915551 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use a ReturnedValue for Managed::getIndexed()Lars Knoll2013-09-182-16/+34
| | | | | Change-Id: I0371ed21c4ef99564d3ffa1082dd109e890a78bf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use ReturnedValue for Managed::get().Lars Knoll2013-09-181-2/+2
| | | | | Change-Id: Ia8f35d227b69d32e1f6a041283abbbd083aa34ca Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use ReturnedValue for Managed::construct()Lars Knoll2013-09-181-2/+2
| | | | | Change-Id: I9e702d60c4e1b7ba19a699ff7a8d53876d6cd5f7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename QV4::ValueScope to QV4::ScopeLars Knoll2013-09-181-3/+3
| | | | | | | | The class is going to be used all over the place, so let's give it a short name :) Change-Id: If61543cb2c885e7fbb95c8fc4d0e870097c352ed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>