aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
Commit message (Collapse)AuthorAgeFilesLines
* Clean up QQmlCustomParser APISimon Hausmann2018-07-304-23/+23
| | | | | | | | Consistently provide a smart pointer to the compilation unit in the two virtual functions. Change-Id: I2f43d4d17102082577f2502424d288d40eb7479d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix unused variableJesus Fernandez2018-07-231-1/+0
| | | | | | | | | | | Coverity was complaining about an uninitialized variable, but it was not being used then we can remove it instead. Amends commit 3d9a59b4329cd6f4af6f5e65bc59f8ff28180eec. Coverity-Id: 191020 Change-Id: I98cb0bac9d9985555fda2bc0d2682bd7f1bcc301 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Revert "QQmlAdaptorModel: support dataChanged signals from multi-column models"Richard Moe Gustavsen2018-07-181-9/+2
| | | | | | | | | No longer needed since TableView will switch to use QQmlTableInstanceModel. This reverts commit a5d2fb468cabff8dc0702c7ddcd9f5b08993b827. Change-Id: I10c6217627a77beebd99cfa5668db05bbbe4ed15 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQmlDelegateModel: remove rows and columns propertiesRichard Moe Gustavsen2018-07-183-37/+0
| | | | | | | | | | | | | This change reverts 59a9c7c3d9ed. Adding support for rows and columns to a QQmlDelegateModel is no longer needed now that TableView will use QQmlTableInstanceModel. Besides, QQmlDelegateModel was designed from the ground up to only support list models, so just adding those properties was a bit half-baked. Change-Id: I1d58355d98999dc6a2a0b88ea64852c9eb918447 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQmlDelegateModel: remove unused m_useFirstColumnOnlyRichard Moe Gustavsen2018-07-181-2/+4
| | | | | | | | This variable will no longer be used once QQuickTableView starts to use the new QQmlTableInstanceModel. Change-Id: I0a4df2b3ce16868105426dac79a8f506fe353cea Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devSimon Hausmann2018-07-171-0/+41
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/demos/photoviewer/i18n/qml_de.ts examples/quick/demos/photoviewer/i18n/qml_fr.ts examples/quick/demos/photoviewer/photoviewer.pro examples/quick/demos/photoviewer/qml.qrc src/qml/compiler/qv4instr_moth_p.h tests/auto/quick/qquickanimations/tst_qquickanimations.cpp Change-Id: Ibea76b468577c2a68bd305cee82ae6444d0f8073
| * Doc: Extend documentation for ItemSelectionModelPaul Wicking2018-07-161-0/+41
| | | | | | | | | | | | | | | | | | | | | | Add documentation for setCurrentIndex() and the select() methods. Include SelectionFlag enum values in select(index, command) description. Task-number: QTBUG-56320 Change-Id: Ia43fa2903656d89a1e80bef6097500d329df0c59 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | QQmlTableInstanceModel: add new TableView helper classRichard Moe Gustavsen2018-07-164-5/+480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch will add a new model class: QQmlTableInstanceModel. It will be used by QQuickTableView to communicate with the data model, instead of using QQmlDelegateModel. The reason we abandon QQmlDelegateModel for QQuickTableView, is because QQmlDelegateModel was written from the start to only support list models, not table models. And to work around this, we proxy table models as a list models, and combine all columns to form one big list. This as some disadvantages. First and foremost because QQmlDelegateModel is using QQmlListCompositor internally. QQmlListCompositor can combine many different list models into one big list model, and divide them into groups. Any change done to a list model will also be mirrored in the list compositor. The compositor will further create QQmlChangeSets describing such model changes, which will then be emitted by QQmlDelegateModel so that the view can transition in the same changes. This flow is especially bad when adding/removing a new row in a table. In that case, since the table looks like as a list, the list compositor will need to update its own internal structures for each item in the new row. So if you have 1000 columns, 1000 updates will be processed. Even worse, since the list compositor create QQmlChangeSets for each item in the row, the view will end up receiving 1000 signals about the change. Combine this with the fact that QQmlDelegateModel contains a lot of undocumented complex code for dealing with groups, which is not needed or used by TableView (or ListView for that sake *), adding a new QQmlTableInstanceModel that understands table models, is the right solution. Auto testing the new class will be done from QQuickTableView, once it takes it into use. * Note: The fact that TableView/ListView is using QQmlDelegateModel internally to communicate with the data model is a private implementation detail. The application will never have access to this model (and can therefore not create any groups on it etc). The application can, however, create its own DelegateModel and assigns it to TableView/ListView. But this is a different issue, and will continue to work as before. Change-Id: If1c35c27e75f236161df84ecb1d919aa3050f5a0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQmlDelegateModel: check if the delegate model adapts an AIMRichard Moe Gustavsen2018-07-131-1/+2
| | | | | | | | | | | | | | | | | | The aim() function doesn't check if the model inside QQmlAdaptorModel is a actually a QAbstractItemModel (it just does a static cast). So we need to guard it. Change-Id: I397280ea7e6f81939d4030d0512a3a67877ad94c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQmlAdaptorModel: move connection set-up code to QQmlDelegateModelRichard Moe Gustavsen2018-07-102-2/+61
| | | | | | | | | | | | | | | | | | | | | | | | There is no need that QQmlAdaptorModel sets up the connection between QQmlDelegateModel and QAIM. QQmlDelegateModel can do this internally. This removes more of the dependency to QQmlDelegateModel, and will make it easier to reuse the class also for other models as well (first and foremost the upcoming QQmlTableInstanceModel). Change-Id: I957ac7bf85c6976ac79df0500a3c1ec3f8be42e2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQmlDelegateModelItem: set row and column explicitRichard Moe Gustavsen2018-07-092-21/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | Whenever we set a model index on a model item, set row and column explicit as well. We used to calculate row and column by calling out to QQmlDelegateModel from within QQmlDelegateModelItem. But we want to remove the dependency to QQmlDelegateModel as much as possible, to be able to reuse QQmlDelegateModelItem also from other model classes (first and foremost the upcoming QQmlTableInstanceModel). Change-Id: Ib80b31250010b2611ba1715d3324145117add865 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Prefix vtable methods with virtualLars Knoll2018-07-033-14/+15
| | | | | | | | | | | | | | | | | | Turns out that the overloading of vtable methods and regular ones is problematic in some cases. So let's rather make it explicit which methods are part of the vtable, and which aren't. Change-Id: Ifee32a26104d30f3c82bca8b5a9cdea2d4f4f526 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Clean up the property key API in StringOrSymbolLars Knoll2018-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of makeIdentifier(), as toPropertyKey() will take care of it. Rename identifier() to propertyKey() and check that the key is valid. Remove String/StringOrSymbol::asArrayIndex(), we don't need it anymore. Change-Id: I3c490fabc1475c9ea288b49b1638b6fa1bc237b7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Replace Identifier by PropertyKeyLars Knoll2018-07-023-5/+5
| | | | | | | | | | | | | | | | Change all uses of Identifier to use the new PropertyKey class and get rid of Identifier. Change-Id: Ib7e83b06a3c923235e145b6e083fe980dc240452 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Cleanups in the Identifier APILars Knoll2018-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | Rename from/asHeapObject to from/asStringOrSymbol and fix the signature. Add a isStringOrSymbol() method and redefine isValid() to also include array indices. Change-Id: Ic8272bfbe84d15421e2ebe86ddda7fdaa8db4f3e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Unify the get and getIndexed vtable functions of QV4::ObjectLars Knoll2018-07-023-37/+37
| | | | | | | | | | | | | | | | This finalizes the refactoring of Object's vtable API. Also added the receiver argument to the method as required by the ES7 spec. Change-Id: I36f9989211c47458788fe9f7e929862bcfe7b845 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Unify put and putIndexedLars Knoll2018-07-022-7/+6
| | | | | | | | | | | | | | | | | | | | Pass an Identifier through those virtual methods to unify the string and integer based versions. Also add the receiver that's required in ES7 Change-Id: I4e7f01b4c97cc80bcb3c485f6343f28213dc9e6b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Internal naming cleanupSimon Hausmann2018-06-291-2/+2
| | | | | | | | | | | | | | | | | | Rename QV4::CompiledData::Binding::containsTranslations() to isTranslationBinding() in an attempt to improve the readability of the code. Change-Id: I73898298c4295d0def812c0526d908254d73c243 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | QQmlInstanceModel: add virtual function to get abstractItemModelRichard Moe Gustavsen2018-06-273-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new virtual function to query the model if it's backed by a QAbstractItemModel. This will be needed later when we create another model (QQmlTableInstanceModel) that also inherits QQmlInstanceModel. By having this virtual function, we don't have to check and special case what kind of model is assigned to QQuickTableView, as long as it has a QAIM. Change-Id: I4080fd601ca1988c5fe448d68bdd156740403c60 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Liang Qi2018-06-258-13/+13
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.11' into devUlf Hermann2018-06-258-13/+13
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp src/quick/handlers/qquickhandlerpoint.cpp src/quick/handlers/qquicksinglepointhandler.cpp tests/auto/qml/ecmascripttests/test262 Change-Id: I8908ec8c6116ca626fbd269af7625d4c429429ca
| | * Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-198-13/+13
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Add Proxy support for prototype handlingLars Knoll2018-06-251-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup get/setPrototypeOf and fix some smaller incompatibilities in the default implementation for Object. Add the methods to the vtable and reimplement them according to spec for ProxyObjects. Clean up the Object.prototype.get/setPrototypeOf/__proto__ methods and fix a smaller bug in the Reflect API for those methods. Change-Id: I6e438753332ec4db963d6cdcf86f340ff212777a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQmlDelegateModel: even for QAIM, only use first column by defaultRichard Moe Gustavsen2018-06-212-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2f9afadd5d9b4899397dca, we introduced a change in QQmlAdaptorModel so that a QAIM model report that it contains "rows * cols" number of model items, and not just "rows". This was needed, otherwise TableView would only display the first column of such models. It turns out, however, that also ListView will now detect that a QAIM contain more items than just the items in the first column. The result will be that it ends up adding all the other columns underneath the first column in the view. To avoid this unforseen change, this patch will revert this logic, and instead add a private variable that can be set if the new behavior is wanted (e.g by TableView). Change-Id: I8c13da99f05e2f922362e498d1fa1779cdbd0d72 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQmlDelegateModelItem: move row and column up to the base classRichard Moe Gustavsen2018-06-092-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 8c33c70 injected row and column (alongside index) into the QML context of a delegate when the view had a QAbstractItemModel as model. Rather than only inject those properties when using QAIM, this patch will move the code to the base class. This way, if a view uses e.g a javascript list as model, row and column is still be available. This is useful, since then the delegate can bind to both row and column regardless of what kind of model the view uses. In the case of a list model, the column property will always be 0. Change-Id: I1d9f11c0b7d7a5beb83198184ba12cc1e48cd100 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQmlDelegateModelPrivate: refactor release()Richard Moe Gustavsen2018-06-091-17/+16
| | | | | | | | | | | | | | | | | | | | | | Change the structure a bit, so it becomes a little less nested, and to make some "clean" space for the patch that handles recycling if items, which will add an extra section into this function in a subsequent patch. Change-Id: Ib94142827373d6894b508718f58e9f5e61e8c8e1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | QQmlDelegateModelAttached: factor out resetCurrentIndex()Richard Moe Gustavsen2018-06-042-8/+16
| | | | | | | | | | | | | | | | | | | | When we in subsequent patches start to recycle items, we'll somtimes need to reset m_currentIndex after construction time. This patch will not change any logic, but just move the code that calculates m_currentIndex into a separate function. Change-Id: Ic61825e9cf4b6c0fdb2dfcab1ad9b582ef4413ac Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQmlDelegateModel: factor out addCacheItem()Richard Moe Gustavsen2018-06-042-4/+9
| | | | | | | | | | | | | | | | | | | | | | The code for adding an item to the cache will also be needed in subsequent patches for recycling items, so factor it out into a function alongside removeCacheItem(). This patch will not change any logic, it will just move the code out into a separate function. Change-Id: I199a4e1c823ded29c576afba12cddfa27a543431 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Fix language change support for qsTr in ListElementSimon Hausmann2018-05-283-21/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We must store translations by binding reference in order to support translation changes. This is similar to commit db15c3455971f47b86078a44a30e0f0a13b54204. [ChangeLog][QtQml] Fix QQmlEngine::retranslate() with ListElement objects that use translation functions such as qsTr. Task-number: QTBUG-68350 Change-Id: Ie5b4d5beb0505a260b524da820c0ce1142893d54 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-261-2/+2
|\| | | | | | | Change-Id: I626068886d4440b569dbeb1789b1ebfa480000c5
| * Fix crash when modifying list model in worker threadSimon Hausmann2018-05-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we call get() on a model in a worker thread, we may end up creating a ModelNodeMetaObject (aka cacheObject). Subsequent mutation of properties may make us end up in emitDirectNotifies(). However since we can't have bindings in there, we should shortcut/suppress the notify emission, which we can do by checking ddata->context via qmlEngine(). The previous code crashed when qmlEngine() return a null pointer but QQmlEnginePrivate::get(const QQmlEngine *) would attempt to dereference the parameter. Started-by: Slava Monich<slava.monich@jolla.com> Change-Id: I880619c686436c053692faafa5dba2c96c2ace96 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Slava Monich <slava.monich@jolla.com>
* | Fix JS ownership of model and delegate properties in QtQuick item viewsSimon Hausmann2018-05-112-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When assigning a JS owned model or delegate to an item view, we must ensure that they stay alive as long as the item view. This happens easily for example when doing something like delegate: Qt.createComponent(...) This patch takes the minimally invasive approach by changing the QObject parent of such objects. Task-number: QTBUG-50319 Task-number: QTBUG-51620 Change-Id: Ie6384b8dd93dcdc62d49f64b38173b3fc4ffd3b3 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Clean up QQmlOpenMetaObject property data structureSimon Hausmann2018-05-112-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a vector instead of a list for a more compact storage - random access is a more frequent operation than appending/removal. Also use a struct instead of a QPair for increased readability of the code and encapsulate read and write operations. Clean up the internal API to avoid unnecessary mutable property extraction. This also helps to ensure that in all cases but intended mutation we end up using the property getter that returns a QVariant by value, something that will allow returning a null variant when QObject tracking gets fixed in the next patch. Change-Id: I563a930fe959b7636f9e9dc88a28cdcefc196707 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix crash when using repeaters with packagesErik Verbruggen2018-05-092-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When receiving the modelUpdated signal from the delegate model, the repeater - unlike other views - queries for the objects right away. That may result in instant incubation and when using Packages, we will end up delivering the initItem signal emission for the parts models via QQmlDelegateModelGroupPrivate::initPackage for _both_ repeaters immediately. For the first repeater that's expected, but for the second repeater that means initItem is received before modelUpdated was called. That is very confusing for the repeater as d->deletables is not set up yet. While it's possible to make the repeater more "robust" towards such behaving models, it seems cleaner to make the model behave well, by ensuring that we emit initItem after modelUpdated. Task-number: QTBUG-50349 Change-Id: Id2f3ba135e34d0111c8896bb4ecdfe51c8c649da Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-05-041-3/+4
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmltypeloader.cpp src/qml/qml/qqmltypeloader_p.h Done-with: Simon Hausmann <simon.hausmann@qt.io> Task-number: QTBUG-68091 Change-Id: I7c0ab3c9446ac50da07b58f54e24eb4587f7f28c
| * Fix QML context leak with visual data model and list property modelsSimon Hausmann2018-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the VDM or QML list properties as models, the delegate model injects an intermediate QQmlContext that provides access to the properties of the exposed QObject as context properties. Before commit e22b624d9ab1f36021adb9cdbfa9b37054282bb8, that context was marked to be owned by the parent QQmlContext. When the reference counting was introduced, that parent became referenced from the cacheItem (DelegateModelItem), but that intermediate QQmlContext became floating and was leaked. This can be observed by running the objectListModel test of tst_qquickvisualdatamodel with detect_leaks=1 in ASAN_OPTIONS. The leak is fixed by re-introducing the exceptional case of a parent holding a strong reference to the child, in just this one case. Change-Id: Iabc26990d39757b0abe0cddf69e76e88e40fba40 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
| * QQmlDelegateModel: include QQDMIncubationTask errors with our errorsMitch Curtis2018-04-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the snippet in the referenced bug report (and the parent patch applied), the output is: qrc:/main.qml:19:19: QML ListView: Error creating delegate There should be more errors after this line, but since the delegate itself didn't have any errors, we need to also check with the incubation task. After doing so, the output becomes: qrc:/main.qml:19:19: QML ListView: Error creating delegate: qrc:/main.qml: Object destroyed during incubation This adds important context (for developers and for users reporting issues in the future) that was previously missing. Task-number: QTBUG-49224 Change-Id: Ic7ac1a06c7dbdf3746f960d28908cc10f6ae86f5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QQmlDelegateModel: provide better warningsMitch Curtis2018-04-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, QQmlDelegateModel errors look like this: <Unknown File>: QML VisualDataModel: Error creating delegate This patch uses the delegate as the QQmlInfo object so that we get errors with actual file names and line numbers: qrc:/main.qml:19:19: QML Component: Error creating delegate This has several benefits: - It's obvious which file is causing the issue - A clickable link in Creator's application output pane Task-number: QTBUG-49224 Change-Id: I0df0d1a9e898aff5f83131ca62a47cc7f1c74c6e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Cleanup creation code for builtin functionsLars Knoll2018-05-021-2/+1
| | | | | | | | | | | | | | | | Centralize the code in FunctionObject::createBuiltinFunction and setup function names and length properties there. Change-Id: I21f1d42b475070ee091d96d97387149af1dc47f2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Change Objects vtable methods to take a StringOrSymbolLars Knoll2018-05-023-6/+15
| | | | | | | | | | | | | | This is needed for symbol support. Change-Id: I83db21f232168710d18999fd97d912016e86d630 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Rename the CompilationMode enum to ContextTypeLars Knoll2018-05-021-2/+2
| | | | | | | | | | | | | | | | | | And make it an enum class. The new name fits better, as it's mainly used to determine the type of the context when parsing. Also already added the 'Block' value that will be needed. Change-Id: I70d963b6a0b22db1a3c607cce6bdd2054b29e000 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Disambiguate different allocation functions in the memory managerLars Knoll2018-04-122-5/+5
| | | | | | | | | | | | | | | | | | | | | | Some compilers (in this case MingW 5.3) don't manage to properly disambiguate the template overloads, and try to instantiate the wrong template function. Solve this by renaming the one of the template functions. Change-Id: I3574e617fe96c4bd52920a0127a1dfe39cc3d302 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQmlAdaptorModel: make a models row/column count read-onlyRichard Moe Gustavsen2018-04-123-100/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change partly revert 59a9c7c3d9edeb9, since we no longer make use of the introduced API. Being able to override the row/column count for a delegate model was a wrong step. If a view needs to operate on a row/column count that is different from what the model offers, then the mapping should be done in the view (or in a proxy model), and not in the delegate model. Change-Id: I32b0dfa977dd7cae33c399e138aac847e49aa94a Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQmlAdaptorModel: support dataChanged signals from multi-column modelsRichard Moe Gustavsen2018-04-121-2/+9
| | | | | | | | | | | | | | | | | | | | | | When receiving a signal that model items have changed, the current implementation assumed that the underlying QAIM only had one column. This patch will check how many columns actually changed, and make sure we call itemsChanged for them all. Change-Id: I05f301dee604f2675ec7e89dfbca28b6f956d483 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-03-227-15/+43
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/configure.json src/qml/qml/qqmlengine.cpp src/qml/types/qqmlmodelsmodule.cpp src/qml/types/types.pri Change-Id: I390112f8178c99b36741d3c40901e544c6daafaa
| * Add a feature for DelegateModelUlf Hermann2018-03-216-8/+43
| | | | | | | | | | Change-Id: Ia24767b33a20bd70096bbb8b4f27729c788eb331 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Simplify handling of function expressions as signal handlersMichael Brasser2018-03-211-7/+0
| | | | | | | | | | Change-Id: I4bfa05b4619c248119c78d05e64270e6627f6065 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-03-213-16/+27
|\| | | | | | | | | | | | | Conflicts: tests/auto/qml/qjsengine/tst_qjsengine.cpp Change-Id: I25e264df273c01832f64dbd31923d8529f1d1900
| * Fix QQmlListModel crash when appending an empty array in debug modeDaniel Vrátil2018-03-201-11/+12
| | | | | | | | | | | | | | | | | | Calling QQmlListModel::append() with an empty JS array triggers an assert in QAbstractItemModel::beginInsertRows() because it's called with negative "last" parameter. Change-Id: I202da260d79f2e6677c663c5785ff754c715fef8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix QML data structure version checking for ahead-of-time generated filesSimon Hausmann2018-03-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We must also do version checking for QML and JS files that were compiled ahead of time and are embedded in resources. If the lookup for the original source code fails, then we must generate an appropriate error message. As an upside we get better error reporting when trying to load an empty file and Qt.include() now reports the error message in the statusText field. The error reporting for imported scripts was not changed as importing an empty script is (oddly) allowed. Task-number: QTBUG-66986 Change-Id: Ie0ef81af371a51ecf8c66ae7954d43f5cc6c12de Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>