aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/util
Commit message (Collapse)AuthorAgeFilesLines
* QQmlAdaptorModel: include qqmlglobal_p.h in header fileShawn Rutledge2018-08-171-1/+1
| | | | | | | | | | | | | | | | | | In other places where qqmladaptormodel_p.h is included, there are lots of other includes which eventually result in qqmlglobal_p.h being seen. In the new qqmldelegatecomponent.cpp, there aren't so many, so this missing dependency became clear, at least on Windows: c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.12.0\qtqml\private\../../../../../src/qml/qml/qqmlguard_p.h(119): error C3861: 'QQml_setParent_noEvent': identifier not found c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.12.0\qtqml\private\../../../../../src/qml/qml/qqmlguard_p.h(113): note: while compiling class template member function 'void TestNamespace::QQmlStrongJSQObjectReference<TestNamespace::QObject>::setObject(T *,TestNamespace::QObject *)' c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.12.0\qtqml\private\../../../../../src/qml/util/qqmladaptormodel_p.h(72): note: see reference to class template instantiation 'TestNamespace::QQmlStrongJSQObjectReference<TestNamespace::QObject>' being compiled c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.12.0\qtqml\private\../../../../../src/qml/qml/qqmlguard_p.h(125): error C3861: 'QQml_setParent_noEvent': identifier not found The error was because QQml_setParent_noEvent(QObject*, QObject*) was not defined, but it is defined inline in qqmlglobal_p.h. Change-Id: I972e2795d5a705e1170ef50b2ef7f9b124a28472 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Allow DelegateModel-based views to support multiple delegate typesPaolo Angelelli2018-08-172-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a specific abstract QQmlComponent subclass, QQmlAbstractDelegateComponent, and a default implementation, DelegateChooser, that, together with the type DelegateChoice allows determining the delegate type by role and/or index. The patch also adds QQmlAbstractDelegateComponent support to QQmlTableInstanceModel, that is a simplified version of the delegate model, currently only used in the new table view. DelegateChoosers are intended to behave just like Components in the context of the view. This means that they can be declared outside of the view, and also in separate files, and the same delegate component can be used at the same time in multiple views. [ChangeLog][QtQuick][Item Views] Added a DelegateChooser Component to host DelegateChoice instances to choose different delegates in an Item View (e.g. TableView) depending on model roles. Done-with: Michael Brasser <michael.brasser@live.com> Task-number: QTBUG-26681 Change-Id: Ibe24a31daf9142c8a9ff45ef6c65da0aec8a14dc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQmlAdaptorModel: prepare js list models for recycling supportRichard Moe Gustavsen2018-07-301-4/+19
| | | | | | | | | | | | | | | | | | | | | | This patch will enable delegate item recycling for js list models. So if you e.g set "model: [1, 2, 3, 4]" on a TableView, the delegates can be recycled. The patch will override the notify function. This function is called from QQmlDelegateModel whenever the modelData that the delegate item depends on, changes. This again is needed to trigger all the modelData bindings in the item to update. Note that this function will only be used for recycling items. The model classes don't listen for changes done to js list models, meaning that the function will otherwise never be called (which is why it was never implemented, I guess). Auto testing this will be included with the patches that implements delegate recycling for TableView. Change-Id: I49185bdbaaacc3ccbd94c99cc66d9a1998452f68 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQmlAdaptorModel: prepare QQmlListProperty for delegate recyclingRichard Moe Gustavsen2018-07-301-1/+27
| | | | | | | | | | | | | | | | | | | | | | This patch will enable delegate item recycling for QQmlListProperty. So if you e.g set "model: someItem.children" on a TableView, the delegates can be recycled. The patch will override the notify function. This function is called from QQmlDelegateModel whenever the modelData that the delegate item depends on, changes. This again is needed to trigger all the modelData bindings in the item to update. Note that this function will only be used for recycling items. The model classes don't listen for changes done to a QQmlListProperty, meaning that the function will otherwise never be called (which is why it was never implemented, I guess). Auto testing this will be included with the patches that enables delegate recycling for TableView. Change-Id: I34161a998a4581798b692da69164ef29032d6e4f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Revert "QQmlAdaptorModel: support dataChanged signals from multi-column models"Richard Moe Gustavsen2018-07-182-6/+0
| | | | | | | | | 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>
* QQmlAdaptorModel: move connection set-up code to QQmlDelegateModelRichard Moe Gustavsen2018-07-102-50/+17
| | | | | | | | | | | | 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-23/+21
| | | | | | | | | | | | | 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>
* 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>
* QQmlDelegateModelItem: move row and column up to the base classRichard Moe Gustavsen2018-06-091-30/+0
| | | | | | | | | | | | | | | | 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>
* Fix JS ownership of model and delegate properties in QtQuick item viewsSimon Hausmann2018-05-112-5/+5
| | | | | | | | | | | | | | | | 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-111-2/+2
| | | | | | | | | | | | | | | | 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>
* Disambiguate different allocation functions in the memory managerLars Knoll2018-04-121-4/+4
| | | | | | | | | | | 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-122-7/+1
| | | | | | | | | | | | | | 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-122-0/+6
| | | | | | | | | | | 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-222-2/+10
|\ | | | | | | | | | | | | | | | | | | 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-212-2/+10
| | | | | | | | | | Change-Id: Ia24767b33a20bd70096bbb8b4f27729c788eb331 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-031-1/+1
|\| | | | | | | Change-Id: I308b964d86ca01916f6af7d6e3f71557e3624eca
| * use the override keyword consistently and correctly (clang-tidy)Shawn Rutledge2018-02-271-1/+1
| | | | | | | | | | Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-02-278-57/+56
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4internalclass.cpp src/qml/parser/qqmljslexer.cpp src/qml/qml/v8/qv8engine.cpp src/qml/util/qqmladaptormodel_p.h src/quick/items/qquickanimatedsprite.cpp tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp Change-Id: I16702b7a0da29c2a332afee47728d6a6ebf4fb3f
| * init variables where they are declared when possible (clang-tidy)Shawn Rutledge2018-02-262-14/+13
| | | | | | | | | | | | | | | | clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-268-45/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQmlDMCachedModelData: don't emit indexChanged twiceRichard Moe Gustavsen2018-02-191-2/+1
| | | | | | | | | | | | | | | | The call to setIndex will both set the index and emit the signal. So don't do it again in the line after. Change-Id: Ice38d88b28bdaf391fcf12a4095c345b0135adb6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-131-1/+1
|\| | | | | | | Change-Id: Ib297817e2fd9b6790d9bc8ee522c32f5b3422574
| * doc: Fix qdoc warnings for templates and staticsMartin Smith2018-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | Several \fn commands needed template parameters added, and several static functions that were not accessible were documented but should not have been documented. The template texts were added and the qdoc comments of the static functions were changed to non-qdoc comments. Change-Id: Icc44e243fbec2023865f47b7c73dc15d241d5b4d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | QQmlDMAbstractItemModelData: add support for row and columnRichard Moe Gustavsen2018-02-091-4/+35
| | | | | | | | | | | | | | | | | | This will give item view delegates access to which row and column they belong to. Change-Id: I5c008504d30695319e5b149987af750f860043dd Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQmlAdaptorModel::Accessors: remove unused function 'count()'Richard Moe Gustavsen2018-02-092-16/+0
| | | | | | | | | | | | | | | | QQmlAdaptorModel now uses rowCount() and columnCount() instead of count(). So this function is no longer needed. Change-Id: I4e72be756b82f1a250f325cb9533144c15098d1d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | VDMAbstractItemModelDataType: use column instead of 0 when accessing modelRichard Moe Gustavsen2018-02-091-3/+3
| | | | | | | | | | | | | | | | Since a QQmlAdaptorModel now supports both row and column, we should use this information when retrieving data from an QAbstractItemModel. Change-Id: I1e73c026695637981e72f680ec61828c944740b6 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQmlAdaptorModel: add support for row and columnRichard Moe Gustavsen2018-02-092-2/+40
| | | | | | | | | | | | | | | | | | | | | | QQmlAdaptorModel is a helper class used by QQmlDelegateModel for proxying many different models, including QAbstractItemModel, QQuickListModel etc. This patch will add support for using both row and column, and not just an index. Change-Id: I403f4dfc2797ea6af4248485e83a1f0fdf8a90f9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | QQmlAdaptorModel::Accessors: add support for row and columnRichard Moe Gustavsen2018-02-092-0/+32
|/ | | | | | | | | | Accessors wraps the different models used by a QQmlAdaptorModel. This patch will add support for accessing row and column information from those models. Change-Id: Ie4b1870c70750444bc4f288f5f85a20dcad603ff Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Convert more builtin functions to use the new calling conventionLars Knoll2018-01-121-19/+19
| | | | | | | | Convert most of the methods used QML objects to the new calling convention. Converted IndexedBuiltinFunction to do the same. Change-Id: I41b26042c2f56f24988485b06e8ccd214e2573c0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/dev' into HEADLars Knoll2017-10-221-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4compileddata.cpp src/qml/compiler/qv4compileddata_p.h src/qml/compiler/qv4isel_moth_p.h src/qml/compiler/qv4ssa.cpp src/qml/jit/qv4assembler_p.h src/qml/jit/qv4isel_masm_p.h src/qml/jit/qv4regalloc.cpp src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4qmlcontext_p.h src/qml/jsruntime/qv4regexp.cpp src/qml/jsruntime/qv4regexp_p.h src/qml/jsruntime/qv4regexpobject.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/qml/v8/qqmlbuiltinfunctions.cpp tests/auto/qml/qml.pro tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp tools/qmlcachegen/qmlcachegen.cpp Change-Id: I1577e195c736f3414089036b957a01cb91a3ca23
| * Replace Q_NULLPTR with nullptrKevin Funk2017-09-271-1/+1
| | | | | | | | | | Change-Id: I0c01862dbb475494c84e39c695cb563df8cbcfa8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Change CallData::argc to be a QV4::ValueErik Verbruggen2017-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | Instead of mimicking a Value. This makes sure that argc now stays correct even when anything on Value changes. Most of the change is mechanical: replace callData->argc by callData->argc(). Change-Id: I521831ae1ffb3966bad6589c18d7a373e13439d7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/new-backendLars Knoll2017-08-224-22/+10
|\| | | | | | | Change-Id: Iff06429f948ac6cdec77a9e5bb8c5375c56fe705
| * Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-08-182-9/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/qml/qqmlcustomparser.cpp src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmlmetatype_p.h src/qml/qml/qqmltypenamecache.cpp src/qml/qml/qqmltypenamecache_p.h src/qml/qml/qqmltypewrapper.cpp src/qml/qml/qqmltypewrapper_p.h src/qml/qml/qqmlvmemetaobject.cpp src/qml/util/qqmladaptormodel.cpp Change-Id: Ic959d03e6f9c328fb02710d9abbb0f27cddde131
| | * Move the engine pointer from the property cache to the VME meta objectLars Knoll2017-08-022-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is where it belongs, and it makes the PropertyCache independent of the engine used. Task-number: QTBUG-61536 Change-Id: I21c2674ee3e2895abd2418764d140b154b47b868 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Fix linking if apps using QQmlPropertyMap when using version scriptsSimon Hausmann2017-07-182-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid the use of the QObject constructor that takes a QObjectPrivate in the inline QQmlPropertyMap constructor. Task-number: QTBUG-46433 Change-Id: I62e3c80e28334ce5a4c3d2249abfada45a8dccb3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Unify IndexedBuiltinFunction with BuiltinFunctionLars Knoll2017-08-081-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we pass the function object to the runtime method, we can retrieve the index from there, and don't need a different calling convention for the indexed version anymore. Change-Id: I6c7d747ddb0c217b23fe9ba06435afb4ec0ee24a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove Scope::result and convert calling convention for builtinsLars Knoll2017-08-081-12/+16
|/ / | | | | | | | | | | | | | | Allow for faster calling of builtins, and completely avoid scope creation in many cases. Change-Id: I0f1681e19e9908db10def85a74e134a87fc2e44c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-061-24/+20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4argumentsobject.cpp src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4errorobject.cpp src/qml/jsruntime/qv4functionobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/qml/jsruntime/qv4lookup.cpp src/qml/jsruntime/qv4managed.cpp src/qml/jsruntime/qv4managed_p.h src/qml/jsruntime/qv4object.cpp src/qml/jsruntime/qv4object_p.h src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/memory/qv4heap_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/memory/qv4mmdefs_p.h src/quick/scenegraph/util/qsgdistancefieldutil.cpp src/quick/scenegraph/util/qsgdistancefieldutil_p.h tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I7ed925d4f5d308f872a58ddf51fdce0c8494ec9c
| * Get rid of the old way of defining builtin functionsLars Knoll2017-05-191-24/+20
| | | | | | | | | | | | | | | | | | | | The old calling convention used for builtin functions is very inefficient. It was still being used in a few places. Clean those up and convert them to the new and much more effiecient calling convention. Change-Id: I6b769c6185df7e9be1e80709330fc1ca868576c1 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | sources: Add missing override and remove redundant virtualAlexander Volkov2017-02-231-30/+30
|/ | | | | | | Change-Id: I48e26b1491024d41ebf75d40f0d1a7e9a1b20f22 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* headers: Add missing override and remove redundant virtualAlexander Volkov2016-12-071-1/+1
| | | | | | Change-Id: Ifa816ebcd79372afca42dbd0dc0ecde006bb688a Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-181-5/+20
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4variantobject.cpp src/qml/types/qquickworkerscript.cpp src/quick/scenegraph/util/qsgdefaultpainternode_p.h tools/qmljs/qmljs.cpp Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
| * QML: Make Heap::Object and all subclasses trivialErik Verbruggen2016-10-061-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | GCC6 might dead-store-eliminate out our secret write to Base::mmdata, because it expects all memory content to be "undefined" before constructor calls. Clang might take the same approach if the constructor of Heap::Object is removed. By making these structs trivial, it also makes them memcpy-able. Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Qml: add missing 'override'Anton Kudryavtsev2016-10-071-4/+4
| | | | | | | | | | | | | | ... and drop redundant 'virtual' Change-Id: Ib1f68c1ebd0468cb4a77eecc986bbf718f6bf789 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Qml utils: replace 'foreach' with 'range for'Anton Kudryavtsev2016-09-123-7/+13
|/ | | | | Change-Id: I7ac19305ffa1f7e8cd98419f4700aa34f53b24dc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix performance issues when handling layout changed in Quick item views.Milian Wolff2016-04-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the layout changes, we mark all rows as changed but do not track where the individual rows get moved. The only reason why one would want to track the moves is to persist the current item selection across a layout change. But even the previous code did not achieve that. I'll create a follow up patch to this one that also implements this behavior as seen in Qt Widget item views. Note that removing this code brings a tremendous performance win on larger models. The repeated calls to _q_itemsMoved triggered O(n^2) behavior in the number of top items in the model. Even with "only" tens of thousands of items in the model, a layout change became very costly and took seconds on a beefy modern desktop machine. Calling _q_itemsMoved in a loop is bad because it: - leads to O(N^2) behavior within QQmlChangeSet when merging the small moves into the item view's current change set - potentially triggers tons of binding/property updates when the cached model indices are updated in _q_itemsMoved Removing this slow path, I did not yet find a behavior change to the previous code. Instead, it just does it all much faster. Change-Id: I67fa99a1c5d8e05d17497d29391da9458bd9bdd0 Task-number: QTBUG-51638 Reviewed-by: Daniel Vrátil <daniel.vratil@kdab.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-071-1/+1
|\ | | | | | | Change-Id: Icfa1d61fcc286c3418d4a625de11d2191336fa60
| * Make public headers compile with -Wzero-as-null-pointer-constantMarc Mutz2016-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | ... or equivalent. QtBase 5.6 headers already compile that way, so let the other modules follow suit. Task-number: QTBUG-45291 Change-Id: Ied526fb2d7adc3a68946d6843a6bd6f475ebf864 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>