aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
Commit message (Collapse)AuthorAgeFilesLines
...
* | Make QML composite types inherit enumsJ-P Nurmi2015-09-216-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: in Qt Quick Controls 2, enums declared in the abstract C++ base types were not accessible with the concrete QML type name, but had to be referenced using the base type name: Slider { snapMode: AbstractSlider.SnapOnRelease } Solution: this change resolves the C++ base type and creates the missing link between the composite type and its base type's meta- object. This allows referencing enums using the concrete/composite QML type name: Slider { snapMode: Slider.SnapOnRelease } Change-Id: Icefdec91b012b12728367fd54b4d16796233ee12 Task-number: QTBUG-43582 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove some dead codeSimon Hausmann2015-09-212-39/+6
| | | | | | | | | | | | | | Also get rid of the unnecessary QQmlCustomCompilerBackend interface. Change-Id: I6cfdd88ef49d3d314d07aa069da481d304e7a285 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Simplify Object::putValue()Lars Knoll2015-09-151-1/+1
| | | | | | | | | | Change-Id: I1cc43f0081f63aed27c82875192e0f415ec995d5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Further cleanupsLars Knoll2015-09-152-10/+5
| | | | | | | | | | | | | | Reduce usage of ScopedContext. Change-Id: I84a6a7478065de3398fd0b21596ca1308e78ceb3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Cleanup usage of ExecutionEngine::currentContextLars Knoll2015-09-151-1/+1
| | | | | | | | | | Change-Id: Ic79d6da162375928ec25871cd0341daeab6483d2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Store the stack of executioncontext's on the JS stackLars Knoll2015-09-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This saves one pointer per allocated execution context. Now every execution context that is pushed, allocates two Values on the js stack. One contains the context itself, the other one the offset to the parent context. Things are a bit tricky for with and catch scopes, as those are called from the generated code, and can't open a Scope anymore. In addition, all methods iterating over the js stack frames need to work with ExecutionContext pointers, not ScopedContext's. Change-Id: I6f3013749d4e73d2fac37973b976ba6029686b82 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Explicitly push/pop ExecutionContextsLars Knoll2015-09-151-6/+2
| | | | | | | | | | | | | | | | Avoid the implicit push inside the execution context constructor and rather make this explicit in the code. Change-Id: I1bb0fb523fddbb273fc666370d619f55f49cd40a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove qml context related methods from QQmlV4FunctionLars Knoll2015-09-151-2/+0
| | | | | | | | | | | | | | | | They were only used in one place, where we can directly call the right method on the ExecutionEngine instead. Change-Id: I02bb16b07ef55ef66bbebb5a572cfbe27bcfcf7f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove unused variableLars Knoll2015-09-091-7/+1
| | | | | | | | | | Change-Id: Iccdb69f7c0d24cc9ef03119092f86e711a3206af Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Smaller cleanupLars Knoll2015-09-091-3/+2
| | | | | | | | | | | | | | Move the takeContextOwnership method over to the QmlContext. Change-Id: I9330b31a0cb079b1c7e68a00236a69e25ed2c5af Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Pass a QmlContext to QV4::Script instead of a contextwrapperLars Knoll2015-09-092-8/+9
| | | | | | | | | | Change-Id: Ia8db166aacbbe6e8f588179dffa04e2dce9566cb Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Don't push new QML contexts onto the context stackLars Knoll2015-09-081-1/+0
| | | | | | | | | | | | | | | | | | | | When creating new QML contexts, these are not used directly, but rather as scopes for other functions. Change the behavior, so that newQmlContext doesn't push the new context onto the context stack. Change-Id: I8254da3f660c4791941835c925b9892274ea51b0 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Refactor the way we declare signal parameter namesLars Knoll2015-09-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Qml Connection objects where using an awkward way to make the parameter names of signals available to the signal handler. This now uses an approach that is equivalent to what we do with other functions. The main difference is that we can't know the parameter names at type compile time, so we have to rewrite the internal class of the QV4::Function at connect time. Change-Id: I5e538ac840b5a46ccb14ff71684404d947948324 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Move createQmlCallableForFunction out of the binding wrapperLars Knoll2015-09-083-3/+3
| | | | | | | | | | | | | | | | | | It's now QV4::FunctionObject::createQmlFunction, which I believe is a better place and name for the method, esp. as it has no real connnection to the binding wrapper anymore. Change-Id: I59e20e120db72e53735b3a986e0b91bc7c3347d7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Allocate QML defined properties without extra roomFrank Meerkoetter2015-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | QV4::MemberData is used to allocate storage for QML defined properties. QV4::MemberData::reallocate() is multiplying each allocation by two as a growth strategy. This is a waste of memory for QML defined properties. This commits extends the QV4::MemberData with an additional method to allow exactly sized allocations. Change-Id: I5c0a3a5a3852d39af9e1afb512380fb1400d2448 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Simon Hausmann2015-09-022-1/+12
|\| | | | | | | Change-Id: Ibc7a47f7ce6d15dff79fdc59f8ded297d1b8d50d
| * Don't consider QLocale a value type.Mitch Curtis2015-09-021-1/+2
| | | | | | | | | | | | | | | | | | | | This fixes a regression where all of the properties of Qt.inputMethod.locale were undefined. Change-Id: Id33890a78296709baad6aeda96d74ca8cb39c61d Task-number: QTBUG-47916 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Doc: broken links and missing doc for functionsNico Vertriest2015-09-021-0/+10
| | | | | | | | | | | | | | Task-number. QTBUG-43810 Change-Id: I14e03317d7470f33a899ba05b62b3d68fdb03734 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
* | XHR: Server side errors are not network errorsJulien Brianceau2015-08-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | XMLHttpRequest specs state that only 'network errors' should result in a request error, and a server side error like HTTP 500 Internal Server Error (which results in QNetworkReply::InternalServerError) is an indication of the HTTP server response rather than a network error. Change-Id: I94bf678a8487e3d31007dc5119d6fb4e87ea3102 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Valery Kotov <kotov.valery@gmail.com>
* | Create less BindingWrappersLars Knoll2015-08-252-13/+14
| | | | | | | | | | | | | | | | Instead create QmlContext's directly as they are the only thing used from the binding wrapper. Change-Id: If3a987134dee9e85b6a76ed74aacd76b19279117 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove this piece of codeLars Knoll2015-08-251-11/+2
| | | | | | | | | | | | | | | | | | | | This was required with the old v8 engine, but removing the lines doesn't seem to cause any regressions in our tests, so let's get rid of them, and have proper JS scoping rules in place. Change-Id: Ib22b4e820bceff9fe26291dae1bf7b55b12a5cde Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Fix profiling of QML/JS compilationUlf Hermann2015-08-241-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compilation of .js resources was missed and the compile times were underestimated because the dependency resolution and error checking wasn't factored in. In particular we only profiled the done() step for QQmlTypeData. However, JavaScript compilation also occurs in the dataReceived() step of QQmlScriptBlob and QQmlTypeData will already parse the program into an AST at that step. Compile steps can be nested now, but considering the fact that significant time may be spent before and after compiling dependencies for a parent module, this seems to be the best way to model them. Furthermore, in order to not needlessly convert QUrl to QString at runtime, the compilation profiler saves the files now as QUrl. Change-Id: I215a87787f9117c069ecd77b2d913cc0b0ff3c89 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Cleanup qmlcontextwrapper usage in XHRLars Knoll2015-08-203-113/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of the static getContext overload and simplify the signature of the dispatchCallback method in XHR. Get rid of the m_me object, and instead store a pointer to the thisObject and the context data directly. Turn all internal errors into assertions. Change-Id: I5427b2009c64f54b67cce1c130eace47201624bd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Move the qmlSingletonWrapper method out of the contextwrapperLars Knoll2015-08-202-23/+0
| | | | | | | | | | | | | | One more step towards removing the class alltogether. Change-Id: Ic9f6794eb3c5c6605ee43ad23a6d432ebbf321a1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Move the registerQmlDependencies method into QQmlPropertyCaptureLars Knoll2015-08-204-45/+46
| | | | | | | | | | | | | | | | This is where the method logically belongs, and removes one more thing from the context wrapper. Change-Id: Ibc076c9b31903a484ad4517402eca2a3b7f0d660 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Use the QmlContext as the scope for QQmlV4Function callsLars Knoll2015-08-201-7/+6
| | | | | | | | | | | | | | | | This further reduces our dependency on the QQmlContextWrapper and reduces storage requirements in the QObjectMethod. Change-Id: I2c12d0a8818d81d45139f482caac8510ad8dfddc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Cleanup code in the VMEMOLars Knoll2015-08-193-45/+44
| | | | | | | | | | Change-Id: Idc1da41586161f1c824c608198e232ba52a0d9d7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Hold a pointer to the QV4::ExecutionEngine in the property cacheLars Knoll2015-08-194-15/+15
| | | | | | | | | | | | | | This makes more sense than a pointer to the QQmlEngine. Change-Id: Ic6037b0df63b6cf1585539bc3ac78822f0e69d02 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Switch to the non compat metacall overloadLars Knoll2015-08-192-2/+5
| | | | | | | | | | | | | | | | | | This one passes in the qobject that the metacall is being applied to. The long term goal is to make the vme meta object independent of the QObject instance. Change-Id: Ide34b8637b9963bdb5e87e4aa6e9c2ee825293f7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Fix performance of ListModel::get()Simon Hausmann2015-08-192-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When called, the function would return a full-fledged QObject that maps the list element addressed. It would contain a _copy_ of all values in the list item and it would create a new meta-object for each list element. This function exists for the JavaScript API, and therefore we now return a much more lightweight object. For compatbility reasons it still has to be a QObject, but the meta-object of it is created on-demand, i.e. only when accessing properties from the C++ side or when connecting to the changed signal of a property. Otherwise the JavaScript wrapper will return the live values from the model without copying them. Change-Id: Iabf3ca22192d2aee06ae9d4b4cfb2fcde2a021b1 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Spencer Schumann <spencer.schumann@echostar.com>
* | Get rid of special handling of var propertiesLars Knoll2015-08-182-60/+30
| | | | | | | | | | | | | | | | | | | | | | | | These can be handled in a simple way now by using a special propertyType value indicating that we have a var property. Also remove the additional write calls in the different readProperty implementations. If the stored data doesn't match, we can simply return the default value directly. Change-Id: I3823a971df24bd78f0acdc4c0042776277b3c55f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Properly initialize the memberdata to undefinedLars Knoll2015-08-181-1/+4
| | | | | | | | | | | | | | This avoids running into assertions in other places. Change-Id: Ia7f9dbdccdd6d3a338845754801e881d44efebb7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Use the proper static ValueTypeProvider as intendedFrank Meerkoetter2015-08-181-1/+1
| | | | | | | | | | | | | | | | This was triggering an assertion while running the unit tests. Change-Id: I53a0216a6861a7ab7e3ec89a2b8bda0605b38aaa Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove special case for var propertiesFrank Meerkoetter2015-08-182-9/+7
| | | | | | | | | | | | | | | | In the new world order all the properties are QV4::Values. Therefore this special handling can be removed. Change-Id: Ia4d703256db7330936cd16a835d16d140adfe20e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Allocate a JS wrapper if there are any propertiesFrank Meerkoetter2015-08-181-2/+2
| | | | | | | | | | | | | | Properties are now stored as QV4::Values. Change-Id: I586ccacbeb3c131ff4af2e5913c484dc4f4b7462 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Use QV4::MemberData for property storageFrank Meerkoetter2015-08-182-194/+129
| | | | | | | | | | | | | | | | Unlike the Array type the QV4::MemberData can be sized exactly so no memory is wasted. Change-Id: Ia7b9b846a7b8017787324e5243ccf6233568d41c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Update copyright notice.Frank Meerkoetter2015-08-182-0/+2
| | | | | | | | | | | | | | Update the copyright notice on files containing larger changes from me. Change-Id: I46cb83161331ef2f49a6ec92c078d6dc8019081e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Also remove the QQmlValueTypeProvider::destroyValueType interfaceFrank Meerkoetter2015-08-182-16/+0
| | | | | | | | | | | | | | After the removeal of the QQmlVMEVariant there is no user left. Change-Id: I97224127aac57aba9a80827f9292018d03609b85 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove the QQmlVMEVariant implementationFrank Meerkoetter2015-08-181-363/+0
| | | | | | | | | | | | | | This code is now obsolete. Change-Id: Id34e8663d0398286e8ce34db7d83c6957e779c30 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove the QQmlVMEVariant array memberFrank Meerkoetter2015-08-182-5/+1
| | | | | | | | | | | | | | All properties have been move into the varProperties JS array. Change-Id: Ib39a603d43ab5ef23aad3e6ccbdbc9b981c9da18 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Adapt the ValueTypeProvider interface and port its typesFrank Meerkoetter2015-08-183-30/+50
| | | | | | | | | | | | | | | | | | The ValueTypeProvider system allows non-QML modules to add new basic QML types. It needs to be changed when porting away from QQmlVmeVariant as underlying type of properties. Change-Id: I2b52d7e6f578647a39832896c28553404b9a679f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Port QVariant away from QQmlVMEVariantFrank Meerkoetter2015-08-181-6/+23
| | | | | | | | | | | | | | | | QVariants are now stored as QV4::VariantObject inside a javascript array. Change-Id: Idcc65eed6845b561038e224d74e5efdf0c9e1c28 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Port QObject* away from QQmlVMEVariantFrank Meerkoetter2015-08-182-20/+54
| | | | | | | | | | | | | | | | | | QObjects are now stored as QV4::QObjectWrapper in a javascript array. This is part of a series of patches slimming down the memory usage of QML properties. Change-Id: I270831d0f0f7bc17842cd2f8d2eb9661e09a3364 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove QQmlValueTypeProvider::copyValueTypeFrank Meerkoetter2015-08-182-17/+0
| | | | | | | | | | | | | | | | While reworking the QQmlValueTypeProvider interface I noticed that this code isn't used. Change-Id: I30a279ffabf3a1c70eaa1327e69b774f5e5981f0 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Port list properties away from QQmlVmeVariantFrank Meerkoetter2015-08-181-2/+2
| | | | | | | | | | | | | | | | The index into the list of list properties (an int) is now also stored as a QV4::Value. Change-Id: I16809c5027ed3c4264aab6dfed8b4519adf83e2a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Port QDate/QDateTime/QRectF away from QQmlVmeVariantFrank Meerkoetter2015-08-182-9/+96
| | | | | | | | | | | | | | | | | | Store QDate/QDateTime/QRectF in a javascript array. The values are wrapped inside a QV4::Variant. This is part of a series sliming down the memory usage of properties. Change-Id: I1b5c4e24c1e46d19c5c861941655efb7a972a6a5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Port QUrl/QSizeF away from QQmlVmeVariantFrank Meerkoetter2015-08-182-6/+65
| | | | | | | | | | | | | | | | | | Store QUrl/QSizeF in a javascript array. The values are wrapped inside a QV4::Variant. This is part of a series sliming down the memory usage of properties. Change-Id: I62338fe7fe101496340a8d89f33030d0df5121b7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Store all properties in one Javascript arrayFrank Meerkoetter2015-08-182-61/+28
| | | | | | | | | | | | | | | | | | Store both "normal" properties and var properties in the same js array. The second array which is removed by this patch was scaffolding for the initial brinup. Change-Id: I24f72a1d880a54f68f5562e5077dbc26e7db864a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Store int/bool/double/string and sizef as QV4::Value in a Javascript arrayFrank Meerkoetter2015-08-182-16/+189
| | | | | | | | | | | | | | | | | | | | This is the first patch in a series of patches removing the QQmlVMEVariant used for the storage of non-var properties. The overall goal is to reduce the memory usage of QML. The QQmlVMEVariant has a size of 8*sizeof(void*) + sizeof(int) which is quite an overhead for types such as int/bool or double. Change-Id: I301661d134724300942911a3d75258fe45356a7a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-1818-124/+116
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356