aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.11' into 5.12.0Liang Qi2018-10-303-1/+151
|\ | | | | | | | | | | | | | | | | Conflicts: src/imports/settings/qqmlsettings.cpp src/quick/items/qquickwindow.cpp tools/qmlplugindump/main.cpp Change-Id: I3e5dae4de25b2da961a572b3a4bd151181d211c9
| * Accessible: Return StaticText if there is no explicit role setAndy Shaw2018-10-191-1/+69
| | | | | | | | | | | | | | | | | | | | Before, it would assume that StaticText was the role if the item could be cast to a QQuickText. It should only do this if the role is not explicitly set, in case it is not really StaticText in the attached property. Change-Id: I800810f1347fc9aa412c4ca5d180f78d27a89b38 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
| * Warn, don't crash during nested delivery of mouse or touch pressesShawn Rutledge2018-10-132-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | If during delivery of a mouse press, user code calls qApp->sendEvent() with another mouse press, then when delivery of the nested event is finished, we call QQuickPointerMouseEvent::reset(nullptr). Then when delivery of the original mouse press resumes, crashes are possible because most of the code assumes that QQuickPointerEvent::m_event is not null during delivery. Change-Id: Id65b1f2f64351e40d03bcd4f4d16693d616729da Fixes: QTBUG-70898 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Add test for the duplicate state name warningAlbert Astals Cid2018-10-252-0/+25
| | | | | | | | | | Change-Id: Id5524d7553ef37fbbc84157a4a4c7251e477f215 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Make sectionsSnap test more robustMichael Brasser2018-10-221-1/+1
| | | | | | | | | | | | Change-Id: I24beb0bb98f7e67abc4d5c3295376d863bb44892 Task-number: QTBUG-71239 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Improve interaction between snapping and sectionsMichael Brasser2018-10-172-0/+107
| | | | | | | | | | | | | | | | | | | | * Use velocity to prefer snapping in the active direction. * Calculate snap based on where the item is, rather than where the section is. Change-Id: I2531501dbe0a58f26f20bc3e719e435185e047a5 Task-number: QTBUG-67051 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | TableView: connect to 'layoutChanged' signal from the modelRichard Moe Gustavsen2018-10-172-2/+51
| | | | | | | | | | | | | | | | Ensure we rebuild the table when the model emits 'layoutChanged'. Fixes: QTBUG-71140 Change-Id: I70dac897830bf5a12ae6987920e388743fd358a1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQmlAdaptorModel: return correct column count from the modelRichard Moe Gustavsen2018-10-172-0/+2
| | | | | | | | | | | | | | | | | | | | | | There is no reason for QQmlAdaptorModel to return the wrong column count to the view. For models that are not QAIM, the accessor that wraps the model will report the column count to be 1 anyway. The same is also true for QAbstractListModel. Change-Id: Ia259b044201d76743e5f43d9f0999d3848912075 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Remove old 'Getting started with Qt Quick' exampleKai Koehne2018-10-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | The example is actually not very easy to build, and arguably too complex for a 'getting started' example. qtdoc commit 1df7011858 therefore replaced it by the alarms example in the documentation. Task-number: QTBUG-66064 Change-Id: I2f2776c649410575aef71948f64b358d60233022 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-081-38/+66
|\| | | | | | | | | | | | | | | Conflicts: src/3rdparty/masm/yarr/YarrJIT.h src/quick/items/qquickwindow.cpp Change-Id: I551404e1558d56c0b0626346ad1c86406bff0ec7
| * Amend TouchMouse::buttonOnDelayedPressFlickable to test delayed tapShawn Rutledge2018-10-031-38/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is for Flickable with pressDelay set to a testable timeout value. For some reason it only checked trying to flick before the press delay is over, or holding and waiting for the press delay to expire. But if the user taps a child MouseArea before the press delay expires (neither moving nor waiting), at the moment of release it's supposed to send the delayed press and then the release, so that the MouseArea gets "clicked" almost as if there was no delay. Lack of test coverage allowed a regression in this functionality for 2 minor versions: 5.10 and 5.11. Task-number: QTBUG-61144 Task-number: QTBUG-69059 Change-Id: I0d8867587e6877359c41ec5fc3a5cdd17447d0b8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Replace obsolete VisualDataModel, *Group and VisualItemModel in testsShawn Rutledge2018-10-0538-233/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | VisualDataModel, VisualDataGroup, and VisualItemModel are replaced with DelegateModel, DelegateModelGroup, and ObjectModel respectively (since 7cad0e52c5a020bd29635e9912fd8946a6b48124). git grep -l 'VisualDataModel' | xargs sed -i 's/VisualDataModel/DelegateModel/g' git grep -l 'VisualDataGroup' | xargs sed -i 's/VisualDataGroup/DelegateModelGroup/g' git grep -l 'VisualItemModel' | xargs sed -i 's/VisualItemModel/ObjectModel/g' Change-Id: Ie91b37b204f08a5d1f1f38594fb22ed70a6e2080 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | PathView autotest: fix "value is not defined" errorShawn Rutledge2018-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | removePath.qml:9: ReferenceError: value is not defined I'm not sure whether value was ever defined, but I've always used modelData in ListView when the model has no other roles. Change-Id: I4fb75057cd3746c0701452c0cf77dda7be35f184 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QQuickGridView: Respect marginsUlf Hermann2018-10-042-0/+97
| | | | | | | | | | | | | | | | | | | | The margin has to be taken into account when calculating the positions for the dimension we are not scrolling and when calculating the number of columns available. Fixes: QTBUG-69863 Change-Id: Id2a53ced263c8926a8bfaf658376be293af3e8c9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-011-0/+55
|\| | | | | | | | | | | | | Conflicts: src/quick/items/qquickevents_p_p.h Change-Id: I8c699aeb46903e2ea80a97a346cb5af460859a98
| * Prevent PathView's parent stealing mouse grab during double-flickChris Adams2018-09-241-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes an issue where mouse events could be stolen by the parent of a PathView due to the PathView not correctly setting the keep-mouse-grab flag in handleMousePressEvent(). This commit ensures that the flag is correctly set, so that the second flick in a double flick is handled by the PathView rather than being stolen by the parent. Task-number: QTBUG-59620 Change-Id: Iccdfe16e7e80e6d1d31f95c3dba9c8839b20f30f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickTableView: improve performance when scrolling with scrollbarsRichard Moe Gustavsen2018-09-291-2/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When flicking, the current implementation would load and unload edges around the table until the new viewport was covered. The downside of that strategy is that you if you move the viewport a long distance in one go, you will need to load and unload edges hidden outside the viewport until it catches up with the new viewport. It gets even worse if you flick with a scrollbar, since then you can end up flicking thousands of rows in one go. And this will keep tableview busy loading and unloading edges for a "long" time. This patch will fix this issue by checking how much the viewport changes during a flick, and select a strategy based on that. So if the viewport moves more than a page (which is the size of the viewport), it will schedule a rebuild of the table from the viewports new location, rather than trying to load and unload edges until it catches up. Fixes: QTBUG-70704 Change-Id: I88909e118ec0759a7b7a305c19ccc6670af6263b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Disable GL_NV_path_rendering unless explicitly requestedLaszlo Agocs2018-09-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flip the default value of enableVendorExtensions, so that we use the generic Shape backend (triangulating + QSGGeometryNode) by default, even on NVIDIA systems. The Nvpr backend is only tried when enableVendorExtensions is set to true by the application. This makes the offering more stable over all since applications will not run into confusing glitches that only reproduce on certain systems while behaving differently on others. [ChangeLog][QtQuick] The Shape item is changed not to try using GL_NV_path_rendering by default, unless explicitly requested. Thus the default value of enableVendorExtensions is now false. Task-number: QTBUG-66843 Task-number: QTBUG-66457 Change-Id: I564708b672bd08a8e760af689d64349aab4ead82 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | QQuickItemView: Don't change the viewport while in layoutUlf Hermann2018-09-272-0/+104
| | | | | | | | | | | | | | | | | | Moving the viewport in the middle of a layout operation is a bad idea as it causes the visible items to change. Task-number: QTBUG-49224 Change-Id: I45a214560e00b65ed53b9385e7a539bb4304b7d9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Limit the repeater model size for integer modelsErik Verbruggen2018-09-241-0/+6
| | | | | | | | | | | | | | | | | | Otherwise you might be able to put INT_MAX in, which would cause problems with things like memory allocations. Task-number: QTBUG-54752 Change-Id: I758d04af65049181c0c741ff42e92a6450963201 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | QQuickTableView: build the table when the component is finalizedRichard Moe Gustavsen2018-09-173-4/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | componentComplete() is called on us after all static values have been assigned, but before bindings to any ancestors have been evaluated. Especially this means that if our size is bound to the parents size, it will not be ready at that point. Since we cannot build the table without knowing our own size, we waited for the updatePolish() call before we started to build the table. The problem with that strategy, is that any asynchronous loaders that TableView might be inside would already be finished by the time we received the updatePolish() call. The result would be that we ended up loading all the delegate items synchronously instead of asynchronously. (As soon as a loader has finished loading the initial item, async loading will no longer be used). This patch will therefore add a componentFinalized function that gets called after all bindings have been evaluated, but before the loader has finished. When receiving this call, we load the delegate items (and build the table). A nice side effect is that the table will also be ready by the time Component.onCompeted is emitted to the QML app. This means that e.g contentWidth/Height has valid values. Change-Id: Ief92d2fecfaea54f6191da116ed4ba79cc673b01 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Stabilize nestedSliderUsingTouch:keepNeither test on UbuntuShawn Rutledge2018-09-132-20/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For whatever reason, it seems we have to be less strict about the exact number of touchpoint movements that the TouchDragArea will see while being dragged 8 times. Counting those is really far from the main point of this test anyway. Also removed blacklisting of macOS 10.10 tests since we don't even support 10.11 anymore. Task-number: QTBUG-36804 Task-number: QTBUG-59840 Fixes: QTBUG-68867 Change-Id: I8f856c5b29de08f55dcd0273cd99dcda77cdf2c3 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | QQuickTableView: sync model and delegate when ready to do soRichard Moe Gustavsen2018-09-132-0/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing (silly) things in the delegate, like: Component.onCompleted: TableView.view.delegate = null will lead to a crash. The same if you change the model. The reason is that you end up changing the model while e.g a row is half-way loaded. Information needed for building the row, like model size, will then be invalid. To protect against this, we insert a "sync" phase to the code that takes any such changes into effect at a time when we know it's safe to do so. Change-Id: I85a992dfc0e04ec6635b10c9768a8ddc140e09da Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: override fixup() to preserve contentX/Y at start-upRichard Moe Gustavsen2018-09-112-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flickable::fixup() will be called from Flickable::componentComplete(). fixup() is a virtual function that subclasses can override to e.g ensure that cells snap to grid etc (which is not yet supported by TableView). The default implementation will check if the assigned contentX/Y is within the current content item size, and adjust it back to 0,0 if not. The problem is that during componentComplete(), the table has not yet been built. And we don't want Flickable to reset any assignments to contentX/Y until that has happened. So override the function and block it from doing any adjustments before the table has been built. Change-Id: Id6c5a3b5f053f71bf1854573cd5b9dc3ecc9f246 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: don't rebuild table upon querying content sizeRichard Moe Gustavsen2018-09-111-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overriding contentWidth/Height was done to be able to force build the table early if the app needed to know the size of the table already at Component.onCompleted (to e.g center the viewport on the center of the table). But now that we have a forceLayout() function, it's better to require that that function should be called before querying contentWidth/Height at this stage. By not building the table on the fly, we allow the application to bind expressions directly to contentWidth/Height, without being concerned about potential binding loops that can occur as a result of us rebuilding the whole table behind his back. The benefit of this overshadows the need to call forceLayout() explicit for some corner cases. Note that we still redefine the contentWidth/Height properties in TableView so that we can catch if the application sets an explicit contentWidth/Height (which is tested by checkExplicitContentWidthAndHeight()). Change-Id: Ic4499b3939af1cb3a543e4c006023d0d6f12fd3b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: don't set contentX/Y to zero when building the tableRichard Moe Gustavsen2018-09-102-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | Don't reset the content item to 0,0 when we do a rebuild of the table, since that will overwrite whatever the user has set to contentX/Y explicitly. Doing the latter can be handy if he needs to flick the table to a start position upon construction. If the user want's to move the content item back to origin when changing the model, he can instead do so manually. Change-Id: Ic7bc424312569e49115dea5037dd1109261a3aff Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: don't override margins API in TableViewRichard Moe Gustavsen2018-09-101-99/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flickable has a margins API with the exact same naming as the margins API in TableView. This means that overriding those properties in TableView was an oversight, and a mistake. This patch will therefore remove the margins API from TableView. However, since the API already exists is in Flickable, the resulting API remains unchanged. But it will ease the TableView implementation a bit, since we can then remove code that takes margins into account (since Flickable does this automatically for us). The only real difference that will take effect from this change, is that any overlay or underlay items inside the flickable will need to have negative coordinates if you want to position them on top of the margins (e.g to create a header on top of the table). Change-Id: I43af66e49f5ddff90739a1c789aacb77ed18b4ce Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: remove focus for the delegate item itself, not only for the ↵Richard Moe Gustavsen2018-09-072-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | child "isAncestorOf" will not include itself as an ancestor. So we need to check if the delegate item has focus as well, since we also want to remove focus for that case. This can e.g happen if the delegate is a TextInput directly. Change-Id: I5a5f5a7ec262eacdac64d72b0f41bca991dbab73 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: clear focus when delegate item with focus is flicked outRichard Moe Gustavsen2018-09-062-0/+108
| | | | | | | | | | | | | | | | | | If we flick out a cell that has keyboard focus, we should clear that focus. Otherwise, the item will be focused also when it is later reused. Change-Id: I0fb79b6d906c1907a352de4ec52e3b488064b55a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQmlTableInstanceModel: don't fall back to use DelegateChooser as delegateRichard Moe Gustavsen2018-09-062-0/+76
| | | | | | | | | | | | | | | | | | | | | | If the application uses a DelegateChooser, but the chooser fails to resolve a delegate for a certain index, it should not use itself as the delegate instead. This will cause the application to crash. Instead, we just print a warning, and return nullptr, which will let TableView handle the situation gracefully. Change-Id: Ibaf9da09fd11149362f5b674fc61db47593de10c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: add anchor check for delegateRichard Moe Gustavsen2018-09-062-0/+78
| | | | | | | | | | | | | | | | | | If a delegate is using anchors, TableView will not be able to layout the item. So issue a warning if that is the case. Change-Id: I358d981067c23fdab2fc486003afc8bd685f940d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | tst_qquicktableview: reuse the same QQuickView for all test casesRichard Moe Gustavsen2018-09-061-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | Instead of creating a new view for every test (which will open a new window), it's better to reuse the same view. Especially since there is a bug in AppKit (which has been reported by Tor-Arne, but I could not find the rdar id) that can sometimes be hit when closing a window, causing it to crash. So creating and closing almost 100 windows in this test will sometimes trigger that bug. Change-Id: If4d962e4b9aeea154d4cd764a5bc414bcd2995b7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQmlDelegateModel: don't fall back to use DelegateChooser as delegateRichard Moe Gustavsen2018-09-062-0/+74
| | | | | | | | | | | | | | | | | | | | | | If the application uses a DelegateChooser, but the chooser fails to resolve a delegate for a certain index, it should not use itself as the delegate instead. This will cause the application to crash. Instead, return nullptr (like we do in the function guard), which will let the item views handle the situation gracefully. Change-Id: I9b3b4aa2626d1f8521b4395096300ac12150c63f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickTableView: allow negative marginsRichard Moe Gustavsen2018-09-031-17/+31
| | | | | | | | | | | | | | | | | | | | | | Currently TableView will hang when using negative margins. This patch will fix this so that negative margins will work as expected. An alternative implementations would be to only allow positive margins, but from an implementation point of view, there is really no reason to add such a restriction. Change-Id: Iea89212eb9d7f9d467955e27c70d9b7583a80d2e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Rename QQEventPoint::GrabState to GrabTransitionShawn Rutledge2018-08-312-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enum represents a transient state transition, and only sometimes corresponds to the current grab state of an event point. For example after exclusive grab has been canceled, the current state is that there is no exclusive grab: it doesn't make sense to remember that the way it got there was by cancellation. There was an idea to add a grabState property, but not all values would be eligible. An EventPoint can be exclusively grabbed by one item or handler at a time, and by multiple passive grabbers at the same time, so even a Q_FLAG would not fully express all possible states. Besides, there is already an exclusiveGrabber property, and we could add a passiveGrabbers list property if we had a real need. So adding a grabState property seems unlikely, and therefore is not a good enough reason to keep this enum named as GrabState. Change-Id: Ie37742b4bd431a7e51910d79a7223fba9a6bd848 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | MultiPointTouchArea: capture the mouse position on pressShawn Rutledge2018-08-302-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTouchEvent::TouchPoint already remembers the start position from where the touch point was pressed. But when MPTA handles mouse events, it populates a synthetic touchpoint (the _mouseQpaTouchPoint variable). So to be fully consistent, it needs to store the mouse press position there too. Since this was not done, gestureStarted was emitted for almost any mouse movement (while pressed) because the stored startPos was 0,0, so MPTA would nearly always think the drag threshold had already been exceeded. In a QML onGestureStarted callback gesture.touchPoints[0].startX and startY were always zero too. Amends fe2de633f9b9454ec8a9c2a5874ad85f49d8d54d Fixes: QTBUG-70258 Change-Id: I5bc0abbe0cb52c1aa02d60a76c52ec26bb0683e6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | QQuickTableView: handle RebuildOption::ViewportOnlyRichard Moe Gustavsen2018-08-271-0/+54
| | | | | | | | | | | | | | | | | | | | | | When rebuildOptions have ViewportOnly set, we now let the top-left item be the same as before (and at the same position as before), and start rebuilding from there. This will greatly increase performance if e.g the table has been flicked far down to row 1000 when the rebuild needs to happen (e.g because the model got a new row). Change-Id: I30beb34a7beccedff8dc406f9a524119a2893eb3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickTableView: only preload to pool if reuseItems is trueRichard Moe Gustavsen2018-08-271-4/+19
| | | | | | | | | | | | | | | | We move preloaded items into the pool. But this is pointless if we're not reusing items in the first place. Change-Id: I2274b0d29c98162da5fa4859c810c42093875836 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Prevent ListView from jumping horizontally with flick(0,<number>)Michael Brasser2018-08-232-0/+37
| | | | | | | | | | | | | | | | The internal flick functions were not written to handle empty flicks in invalid directions. Guard our calls accordingly. Change-Id: I34801a7e548160ce4895dd8a2f6c0b17172cd02e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: don't overwrite rebuildStateRichard Moe Gustavsen2018-08-233-0/+131
| | | | | | | | | | | | | | | | | | | | Since it's fully possible to end up calling invalidateTable() while in the process of rebuilding the table, we need to ensure that we don't mess with the current rebuildState. Instead, just schedule that we need to rebuild once more later. Change-Id: If27bb14f0bc9f72c53eb47e6115d7ad580cdb516 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add a HoverHandler autotestShawn Rutledge2018-08-234-3/+416
| | | | | | | | | | Change-Id: I223bad4f8117af76ad2a5079ecc0b73c2eba94bc Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | QQmlDelegateModelItem: ensure that we emit changes to row and columnRichard Moe Gustavsen2018-08-222-0/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | As it stood, we would only emit changes to row and column if index changed as well. But when removing rows and columns from the model, it can happen that we reuse an item that by accident has the same index as the one we change it to, but belonging to a different row and column. So we need to check for changes to the index the same way we do for row and column. Change-Id: I9d507a74aa5dcb0fe7630e7af1e949bd2db7fb47 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView: drain pool upon setting reuseItems to falseRichard Moe Gustavsen2018-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | As (soon to be) documented, drain the pool immediately when setting reuseItems to false. This will give developers a way to clear the pool if e.g running low on memory. Besides, there is no reason to keep items in the pool if we're not reusing them. Change-Id: I49f0283721a63c6a6b92631f00c7ad711a262978 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Ensure that SinglePointHandler handles touch pointsShawn Rutledge2018-08-221-0/+54
| | | | | | | | | | | | | | | | | | | | | | A QQuickPointerTouchEvent's button and buttons properties are not currently set (although we had some uncertainty in the past about whether it would be appropriate for a touch press to simulate a left button press). So it seems that f2ba3bd9792500b4d3fcfd23b03098a32641ef4f broke the behavior of PointHandler on touchscreens. Change-Id: I890cc9889e847636c8f385753e47a078ec582195 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | MultiPointHandler: ensure centroid properties are reset after releaseShawn Rutledge2018-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | ...and verify the centroid changes in the DragHandler autotest. It was observable in manual tests that draw velocity vectors that they weren't getting reset to zero after the release, after ca7cdd71ee33f0d77eb6bf1367d2532e26155cb2. Change-Id: I16186d36d51a567b0d653307421147264a5e6326 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | QQuickTableView: move TableView from Qt.labs to QtQuickRichard Moe Gustavsen2018-08-2210-10/+0
| | | | | | | | | | | | | | | | | | | | | | TableView is now ready for Qt-5.12. The only thing missing is documentation, which is currently being written, and on the way. So remove the temporary labs plugin that used to register TableView, and register it together with the other QtQuick items. Change-Id: I7f360eac3934d228904a4133363e336afe0c451a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickTableView: check if the providers are undefined, not nullRichard Moe Gustavsen2018-08-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Checking if QJSValue isNull() will just check if it contains the js value "null". But we want to check if the application has assigned anything at all to the providers. Any value other than a function will not be accepted (which we check for at the time we try to call them (from resolveColumnWidth() and resolveColumnHeight()). Change-Id: I24717b67e99dd1ad6684a83125d2a4c7826dd501 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickTableView: set the stacking order of delegate items to 1Richard Moe Gustavsen2018-08-211-0/+1
| | | | | | | | | | | | | | | | | | Let all delegate items have a stackin order (z) equal to 1. This is how ListView does it, so do the same in TableView to make them behave as similar as possible. Change-Id: I5d4629e8b116cd62c84e4fe9aefdb087e3c6e325 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Protect tab focus chain from infinite loops when item is invisibleFrederik Gladhorn2018-08-152-0/+30
| | | | | | | | | | | | | | | | | | | | Make sure to start the search for a potential focus item on an item that will be visited again later, otherwise we'll loop for ever. Fixes: QTBUG-68271 Change-Id: Icb330e4e726132511810027a33b9fb346c7fa131 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | QQuickTableView: preload one extra row and column at start-upRichard Moe Gustavsen2018-08-141-9/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a TableView initially loads as many rows and columns it can fit inside the viewport, it will always be one less than the number it will show while flicking. The reason is that, as soon as you flick half a column out on the left, half a column will move in on the right. And this will increase the number of visible columns by 1 (but without reusing any items from the pool, since the first column is not out). Since this is always the case, it makes sense to preload one extra row and column at start-up, so that they're ready when the flicking starts. Note that this doesn't load more items in the background than what we need (like the cache buffer would). The viewport will fit _all_ the loaded items into the viewport once you start flicking. But the extra items loaded at start-up will instead be moved direcly to the pool for reuse, and the application will be informed about it (using the onPooled signal). Change-Id: Icea85c1d44f74ab54f1b96325489e8d6d1c0889e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>