aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktableview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Show a tableview even if the syncView has an empty modelAndy Shaw2020-12-091-5/+2
| | | | | | | | | | | By showing the tableview, we can be sure that headerviews will be visible even in the syncView has an empty model. Fixes: QTBUG-87526 Change-Id: I68c8b119122a2d2f88c2afbeb2d6c71a83a3ce33 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 27c254203b3e7dd6d3a4445feb205fbe98c32d30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix documentation warnings for Qt QuickTopi Reinio2020-11-051-29/+26
| | | | | | | | | | | - Remove links to modules and examples that are not part of Qt 6. - Remove links to entities marked as \internal - Add missing enum value and QML property docs where it's trivial to do so. Task-number: QTBUG-88156 Change-Id: I10a1c7bcc5fe0e2354ea69eaf24930362edb7415 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* TableView: ensure we rebuild the sync view, even when flicking on a sync ↵Richard Moe Gustavsen2020-10-231-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | view child When two table views are connect through the syncView property, both views will flick when you flick on either of them. This also means that if you fast-flick more than a page on the sync view child, the sync view needs to rebuild, like if you did the fast-flick directly on the sync view. Because we updated the sync view's viewportRect too soon while fast-flicking on the the sync child, we didn't detect that it was a fast-flick, and that a rebuild was needed. The result is that you could sometimes end up with the views getting out-of-sync. This patch will allow TableView to only move the viewport without updating the internal viewportRect while flicking. The viewportRect will instead be sync-ed at a later point, like we do when you flick on the sync view directly. This will ensure that we rebuild if needed, also while fast-flicking on the child view. Task-number: QTBUG-87821 Pick-to: 5.15 Change-Id: Ifc74473eb43406acaa8e24880066fb4ca89d3a4e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TableView: ensure we update content size upon model changesRichard Moe Gustavsen2020-10-211-28/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For tables of non-trivial sizes, we usually don't know what the content size will be unless we load all rows and columns, which we simply cannot do. Because of this, we have up till now chosen a strategy where we normally just calculate a predicted content size up-front, when we table is built, and afterwards just stick to that prediction. This strategy works for big tables that fills more than one size of the viewport, and if the number of rows and column in the model stays around the same. But for tables that start off smaller than the viewport, and later expands to grow out of it, it simply fails. And the failure is such that the tableview can get stuck, with no way way for the user to flick around to see the rest of the contents. An example is TreeView that might only show the root node at start-up, but as you start to expand the tree, it will quickly add more rows than what fits inside the viewport. And in that case, the contentHeight will be totally off, and in turn, make the scrollbar be based on wrong values, and sometimes not work at all (e.g if it has the flag Flickable::StopAtBounds). This patch will change the implementation so that we recalculate the content size whenever it should logially change. That is, if e.g the model add or remove rows and columns, or if you change spacing. This still doesn't mean that contentWidth/Height reports the correct size of the table, but at least it will be a better guestimate for smaller tables, and at the same time, work together with Flickable and ScrollBars. Pick-to: 5.15 Fixes: QTBUG-87680 Change-Id: Ie2d2e7c1f1519dc7a5d5269a6d25e34cf441b3fe Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Fix qdoc warningsPaul Wicking2020-09-111-2/+2
| | | | | | | | | | * Use correct qdoc markup commands. * Add replacement snippet to make up for snippet file removal in a7a88483c61150f7b7d78dc97f4a521ef9f04899. * Correct file name capitalization in snippet. Change-Id: I1fe30834292f8536c97b2bc4df0a654649431675 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: Fix minor typosSze Howe Koh2020-08-301-1/+1
| | | | | | Pick-to: 5.15 Change-Id: I4c51c40697e410d56b6a2d2446ed9f8ae218576d Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* TableView: during layout, set item width before heightRichard Moe Gustavsen2020-05-081-9/+22
| | | | | | | | | | | | | | | | Text items like TextEdit will calculate their implicit height based on the assigned width (because of word-wrap). It's therefore better to set the width of delegate items first during a layout than after, since then we also get the correct height in such (special) cases. The result is that a rows height will show all the text in a TextEdit, and not clip it. Pick-to: 5.14 5.15 Task-number: QTBUG-84046 Change-Id: I1893187027b45649568347ffc3ed5d4d84beaa95 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TableView: allow negative spacingRichard Moe Gustavsen2020-05-071-2/+2
| | | | | | | | | | | There is no apparent reason why negative spacing should not be allowed. And in fact, you can use negative spacing to eliminate double edges in the grid when the delegate is e.g a rectangle with a border. Fixes: QTBUG-83956 Pick-to: 5.15 Change-Id: I3be9d58ac8c43142e26e75165274e41872e878f4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickItem: rename geometryChanged to geometryChangeMitch Curtis2020-04-231-2/+2
| | | | | | | | | | | | | | | | | | This brings it in line with the existing convention in this and other modules, where virtual handlers are named "nounChange"; e.g. itemChange. Signals are named "nounChanged". This also allows adding a geometryChanged signal, which would enable users to listen to one signal for all changes to x/y/width/height. [ChangeLog][QQuickItem] Renamed geometryChanged to geometryChange in order to follow existing naming conventions and have consistency with existing API, such as itemChange. Task-number: QTBUG-82994 Change-Id: I0547358c796a0047982ccfbf2c38bab952e7a634 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickTableView: redirect all positioning functions to positionViewAtCellRichard Moe Gustavsen2020-04-141-91/+61
| | | | | | | | | | Refactor both horizontal and vertical positioning into positionViewAtCell, and let the other functions just forward the call to it. Update the docs to inform about this, and include the same warning as found in ListView's positionViewAtIndex. Change-Id: I8143df7f8efb78d7dbecdcfca95cf3e5fc078b86 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickTableView: add functions to get current rows and columnsRichard Moe Gustavsen2020-04-091-8/+114
| | | | | | | | | | | | This API can be used to query and iterate the currently loaded rows and columns inside the view. [ChangeLog][QtQuick][TableView] Added the properties leftColumn, rightColumn, topRow, and bottomRow, which can be used to query which part of the model is currently visible inside the view. Change-Id: I06f99cc1e8da1004dc8614977f149192e1880ba4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickTableView: add cellAtPos() functionsRichard Moe Gustavsen2020-04-091-0/+76
| | | | | | | | [ChangeLog][QtQuick][TableView] cellAtPos(x, y) has been added to query which cell is under the given position. Change-Id: I69523868158b589ea3bb9facba815000d2a058d7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-091-6/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4executablecompilationunit.cpp src/qml/jsruntime/qv4executablecompilationunit_p.h src/qml/qml/qqmlobjectcreator.cpp src/qml/qml/qqmlpropertycachecreator_p.h src/qml/qml/qqmltypecompiler.cpp src/qml/qml/qqmltypedata.cpp tests/auto/qml/qmlformat/tst_qmlformat.cpp tools/qmllint/scopetree.cpp src/qml/qml/qqmlapplicationengine_p.h Adjusted tools/qmllint/findunqualified.cpp to use newer API Change-Id: Ibfb4678ca39d626d47527265e3c96e43313873d4
| * QQuickTableView: fix crash in tableLayoutToString()Richard Moe Gustavsen2020-04-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The function QQuickTableViewPrivate::tableLayoutToString() returns a string used for debugging the loaded table. If the table is empty, it will crash/assert while trying to read data out of an empty vector. This patch will check for this case before creating the string. Change-Id: I47c01b3c8447ccc7424fe475f38e22ff70c681d8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * TableView: Clarify the rows/columns docs about inserting/removingAndy Shaw2020-04-031-6/+11
| | | | | | | | | | | | | | Fixes: QTBUG-82904 Change-Id: Ib44122fd0c2e5fc83cfef1368ed4ec0f3b1951af Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: add function: itemAtCell(const QPoint)Richard Moe Gustavsen2020-04-081-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | Add a function to the API to let the application get the item loaded for a specific cell. [ChangeLog][TableView] A function 'itemAtCell()' has now been added to let the application get the delegate item loaded for a specific cell. Change-Id: Ie84ef44ea2a0a901487812c4d611b98d4c86ee22 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickTableView: add positionViewAtRow()/Column()Richard Moe Gustavsen2020-04-081-14/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add functions to let the application scroll the table to a specific row or column using a specific mode. This API partially mirrors the API found in ListView. [ChangeLog][QtQuick][TableView] positionViewAtCell(), positionViewAtRow(), and positionViewAtColumn() have been added to enable the application to position the contents to show a specific cell. Fixes: QTBUG-83215 Change-Id: I321588041977f9ded40f84fc0499ea1c5f6ac801 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-241-13/+28
|\| | | | | | | Change-Id: I9f0d5adf1ba7d3246b1107a20d145e7aac2c7a77
| * QQuickTableView: add private support for transposing the viewRichard Moe Gustavsen2020-03-231-13/+28
| | | | | | | | | | | | | | | | This is needed by HorizontalHeaderView when assigning it one dimensional models. Change-Id: I183f0d35b8f3a97853fc7496dc68b0e13e9be990 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-091-2/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmlirbuilder_p.h src/qml/qml/qqmlpropertycachecreator_p.h src/qmltyperegistrar/qmltypesclassdescription.cpp src/qmltyperegistrar/qmltypesclassdescription.h src/qmltyperegistrar/qmltypescreator.cpp src/quick/items/qquicktext_p.h src/quick/util/qquickvaluetypes_p.h Change-Id: Ic209741592e7b85820bf3845722023a190ebc1c5
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-031-1/+10
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qmlmodels/qqmltableinstancemodel.cpp src/qmlmodels/qqmltableinstancemodel_p.h Change-Id: I89339b1cb41ba27fe30c79530859a1c2bfbecc69
| | * QQuickTableView: Immediately delete delegates when possibleUlf Hermann2020-02-281-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the dtor we don't need to care about any side effects a direct delete may have. Rather, any deleteLater() may not take effect anymore as the event loop may be gone already. Task-number: QTBUG-82000 Change-Id: I97935dc47fbbfd0c050e80c333c36a05f685c45d Reviewed-by: Joni Poikelin <joni.poikelin@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | Doc: Fix QQuickTableView snippetUlf Hermann2020-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use static registration, provide a .pro file, and make it load and show the right file. Change-Id: I949831a399ce00cd8b3d012d8bd4e95a1efcdeb5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-171-13/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/qtqml/plugin.cpp src/qml/qml/qqml.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmlmetatype_p.h src/qml/qml/qqmltypeloader.cpp src/qml/types/qqmlbind.cpp src/quick/items/qquickitemsmodule.cpp tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp Change-Id: I52548938a582cb6510271ed4bc3a9aa0c3c11df6
| * | QQmlInstanceModel: refactor recycling signals to base classRichard Moe Gustavsen2020-02-051-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that QQmlDelegateModel has an API that handles reusing delegate items (*), we should also move the related signals inside it to be consistent. This will also remove the need to cast the model type in the views before connecting. This patch will also remove warnings that stems from QQuickListView trying to connect to the reuse signals when the model is not a QQmlDelegateModel. *: E.g: virtual ReleaseFlags release(QObject *object, ReusableFlag reusableFlag = NotReusable) = 0; Fixes: QTBUG-81257 Change-Id: Ia8a8f0d68e6ef7edc6c45b414121aaa77632bcd3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Use QTypeRevision for all versions and revisionsUlf Hermann2020-02-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In many places we carry major and minor versions or revisions that are loosely coupled to minor versions. As the Qt minor version resets now, we need to handle these things more systematically. In particular, we need to add a "major" part to revisions. QTypeRevision can express the current major/minor pairs more efficiently and can also be used to add a major version to revisions. This change does not change the semantics, yet, but only replaces the types. Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-211-8/+17
|\| | | | | | | | | | | Change-Id: Ic2cea85917751b89c34768fd80d8b11f5706dd62
| * | QQuickTableView: make syncView/syncDirection/model private implementation ↵Yulong Bai2020-01-201-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | virtual For usage in HeaderView, moving getters/setters/sych-ers in private implementation virtual, keep public APIs clean and also make private implementations overridable. Change-Id: I4ad04665b7268354a49dc9711944ee0c6fd2738f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Use QFlatMap in QQuickTableViewShawn Rutledge2020-01-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFlatMap is implemented to use two containers internally, one for keys and one for values. This improves locality of reference for the purpose of doing binary search to find a key quickly, and also makes the keys() (and values()) accessor really fast. Change-Id: I87bbb06371aeb44c5bcf971d72ae9cd59920f800 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-141-5/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/folderlistmodel/plugin.cpp src/imports/layouts/plugin.cpp src/imports/localstorage/plugin.cpp src/imports/models/plugin.cpp src/imports/particles/plugin.cpp src/imports/qtqml/plugin.cpp src/imports/qtquick2/plugin.cpp src/imports/shapes/plugin.cpp src/imports/statemachine/plugin.cpp src/imports/testlib/main.cpp src/imports/wavefrontmesh/plugin.cpp src/imports/window/plugin.cpp src/imports/workerscript/plugin.cpp src/qml/jsruntime/qv4sequenceobject.cpp src/qml/qml/qqmlengine.cpp src/qmlmodels/qqmlmodelsmodule.cpp src/qmlmodels/qqmlmodelsmodule_p.h src/qmlworkerscript/qqmlworkerscriptmodule.cpp src/qmlworkerscript/qqmlworkerscriptmodule_p.h src/quick/items/qquickitemsmodule.cpp Change-Id: I5f1fbc3d00e8f583d2c89afc5389de84d68633a7
| * | QQuickTableView: reuse items also when using QQmlInstanceModelRichard Moe Gustavsen2019-12-191-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that QQmlInstanceModel has an API that supports delegate recycling, remove the special case from TableView. What this means in practice is that a TableView can now also reuse items when the model assigned is a DelegateModel. The recycling API in QQuickInstanceModel is already tested by the QQuickListView test. Change-Id: I08c9fe2ce230c2b41b40fe97efdfca78eb5dd296 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Fix crash in tst_qquicktableviewSimon Hausmann2020-01-131-1/+2
|/ / | | | | | | | | | | | | | | | | Avoid a range-for over a list that's sometimes modified during the iteration. Change-Id: I4888ace4ebb86bfaa9f92d7e6272114c0af01421 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-101-13/+34
|\| | | | | | | Change-Id: Iadbdd0fb63ca2a9e0b186343f8b730e4114cd71b
| * QQuickTableView: set empty content size when table is emptyRichard Moe Gustavsen2019-12-091-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From before we would bail out early from the rebuild process if we detected an empty table. A result from this is that we left both contentWidth and contentHeight unchanged. This patch will set an empty content size when the table is empty. The effect will be that the user cannot flick the view around based on the old size. Fixes: QTBUG-80505 Change-Id: I3ac080476269fd5906ce79fa007eabb59b5ff4b1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * QQuickTableView: ensure we release items in the old model and not the newRichard Moe Gustavsen2019-12-091-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it stood, we would wait to release loaded items until we started the rebuild process, if the old model was a DelegateModel. But at that time, the model would alread have been changed, so we would release the items by calling out to the wrong model. This patch will ensure that we always release the items immediately when syncing the model, which will also cover the case when the model is a DelegateModel. Fixes: QTBUG-80570 Change-Id: I1b06011f4795727d04d9cd8c20381f65552b8fe8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * QQuickTableView: support assigning a DelegateModelRichard Moe Gustavsen2019-12-091-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally you either assign a model to TableView that already has a delegate (or don't need one), like DelegateModel or ObjectModel. Or instead you assign a QAIM model and a delegate directly. But if you assign both a delegate and an ObjectModel, TableView would be confused, and ignore the assigned model and instead create an internal wrapper model that ends up empty. This patch will ensure that we don't create a wrapper model in such cases, but instead forward the delegate to whichever model is assigned, even if it ends up as a no-op for models that don't use one. Task-number: QTBUG-80534 Change-Id: Idd220df08617c379dc7808ee1f41c862b78cc201 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-051-2/+3
|\| | | | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicklistview/tst_qquicklistview.cpp tests/auto/quick/qquicktableview/tst_qquicktableview.cpp Change-Id: Ib46bc1c717cf524eea2fb3d876810c8d55747c91
| * QQuickTableView: Clear items before deleting the modelUlf Hermann2019-12-041-0/+1
| | | | | | | | | | | | Fixes: QTBUG-71374 Change-Id: I534b7612268bb9407844961267865f490d7ff7b2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QQuickTableView: fix warning messageRichard Moe Gustavsen2019-12-041-2/+2
| | | | | | | | | | | | | | Fix up small copy/paste bug. Change-Id: I0f6c648679c025af9dcebf9459116c6cd6452a14 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-291-0/+35
|\| | | | | | | Change-Id: Ic754916ddc223c6ce20f0298eec02a3513fc0222
| * TableView: add doc for syncView and syncDirection propertiesYulong Bai2019-11-271-0/+35
| | | | | | | | | | Change-Id: I4a50087b07e6dfe37c9b48d1e3bb73ea50ea64a7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQmlInstanceModel::ReleaseFlags: add enum value 'Pooled'Richard Moe Gustavsen2019-11-281-4/+1
|/ | | | | | | | | | | | | Now that we're about to add support for delegate item recycling in ListView, we need to add an extra enum value to the ReleaseFlags. This will be needed later so that ListView can distinguish between items that are still referenced and visible in the viewport, and items that not referenced, but at the same time, still alive in the pool. Change-Id: I4a1110b6b43ba109ccd160d22010569dd5410829 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TableView: use fetchMore() when scrolling to the end of the tableKari Hormi2019-11-201-0/+13
| | | | | | | | | | | QQmlTableInstanceModel implements canFetchMore and fetchMore functions, but these are not called at any point in QQuickTableView. This change checks if additional data can be fetched when atYEndChanged signal is emitted. Fixes: QTBUG-78273 Change-Id: I49b41b09d9a218826b34f32cd9fe4724a6097b52 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickTableView::forceLayout(): rebuild table if the size of the model has ↵Richard Moe Gustavsen2019-11-121-16/+39
| | | | | | | | | | | | | | | | | | changed An assert will trigger if forceLayout() is called while the model is being reset. The reason is that the forceLayout() schedules a relayout which assumes that the size of the model hasn't changed. But while layouting, it will try to fetch data from the model according to the old size, which will trigger an assert. This patch will add an extra path to forceLayout() that checks if the size of the model has changed, and if so, schedule a complete rebuild instead of just a relayout. Fixes: QTBUG-79395 Change-Id: If61658912d9e90c1a5aef9bc28083da20fa6ec76 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Small performance improvements suggested by clang-tidyAlbert Astals Cid2019-10-071-2/+2
| | | | | | | | | mostly add const &, a few std::move and in particular case, remove const so the std::move being done over the variable actually has effect Change-Id: Id611cd31bc012f219d7a17d4626b1c2a5fbddd66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-09-271-0/+1
|\ | | | | | | Change-Id: I73d9e896c05f7d944f3092b51a3a95c7e6e284b8
| * Doc: add TableView \since versionMitch Curtis2019-09-171-0/+1
| | | | | | | | | | | | Task-number: QTBUG-78307 Change-Id: I71bc58ba5e4d930167f56a264e20b352244502a3 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-121-12/+3
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine.cpp src/quick/handlers/qquicktaphandler.cpp src/quick/items/qquicktableview.cpp Done-With: Richard Moe Gustavsen <richard.gustavsen@qt.io> Done-With: Ulf Hermann <ulf.hermann@qt.io> Done-With: Shawn Rutledge <shawn.rutledge@qt.io> Change-Id: If9558a33f01693ce96420c094e0b57dfff0626cd
| * QQuickTableView: always relayout after a rebuildRichard Moe Gustavsen2019-08-281-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current logic was based on the idea that if both rowHeight-, and columnWidthProveders were set, we didn't have to relayout the items at the end of a rebuild. Because in that case, the row and column sizes would already be correct after the initial load. This assumption turns out to be false, because the providers are allowed to return -1 to signal that the size of a row or column should use default values (meaning, calculated by TableView). And for those cases, we need to do a relayout at the end of a rebuild. Fixes: QTBUG-77074 Change-Id: I0e0f2fdca1cfa9e98f2a0a2b227c3715c16a70f9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: Add usage of QQuickTableSectionSizeProviderYulong Bai2019-06-281-0/+12
| | | | | | | | | | Change-Id: Ib8417729d439cf0c638dae7a43025aa315406793 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>