aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.14.2' into 5.14Qt Forward Merge Bot2020-04-212-0/+157
|\ | | | | | | Change-Id: Icc410df82e57ed370ab0b80253074d495fc8c135
| * Merge 5.14 into 5.14.2Kari Oikarinen2020-03-108-25/+54
| |\ | | | | | | | | | Change-Id: I294cb27a59754f7090f9bc1a500faf0423571549
| * | TableModel: Allow a double to be added to a field seen as int previouslyAndy Shaw2020-02-282-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the type for a TableModelColumn can be seen as an int when it is in the first row, it is still possible that it is representing a double value in other rows. Therefore it should be allowed to add/change a row that would display a double for that column. Change-Id: I994a8ead595f836a20a4e82fbf94953b1aa4b7da Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | OpacityAnimator: apply opacity animation to the first frame in SGWang Chuan2020-04-072-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using OpacityAnimator, an opacity node will be created and inserted into nodes tree to perform opacity animation. However, since the default value of opacity node is 1, the opacity animation will start from 1 even if we set it from 0 to 1. Fixes this issue by updating the value of opacity just after creating a new opacity node. Fixes: QTBUG-79199 Change-Id: I2e462f0c56892fda040836ffde6685145769e60c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Fix QQuickMouseArea getting stuck in pressed state when hiding in pressFrederik Gladhorn2020-03-312-0/+74
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 78c1fcbc49f56463064eef738a475d9018357b24 we stopped giving the exclusive grab to hidden or disabled items with is good. But the change did not take into consideration how mouse area handles its internal state. As a simple example: A mouse area that would set itself hiddin in the press handler, would continue to have d->pressed == true, which means it would not react to any future press events. The fix is to let mouse area check in its change handler whether it has become invisible. The test also checks that enabled behaves the same way. There is no action needed, since mouse area does completely custom handling of enabled (maybe something to fix in Qt 6), disabling a mouse area doesn't disable its children for example, it doesn't invoke QQuickItem::setEnabled at all. Due to this circumventing the common behavior, by chance disabling a mouse area in the on pressed handler works. Fixes: QTBUG-74987 Change-Id: Idb8499b3e5bcb744fbba203fdea5c46695bd5077 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Make tst_qquickcanvasitem significant again; fix image size roundingShawn Rutledge2020-03-055-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - the test items must be visible, so that waitForRendering() works - arcTo::test_paint tried to render an out-of-bounds arc, which resulted in rendering nothing. Now renders within the 100x100 canvas. - painted() is not emitted the first time the Canvas is rendered. - Canvas.save() saves relative to the directory from which the test is run, while Canvas.loadImage() loads relative to the test data directory in this autotest (other tests are loading red.png for example). So we need to use absolute paths to test loading and saving in the directory where the executable is. - canvas.getContext('2d').getImageData(8.5, 8.5, 8.5, 8.5) now triggers different rounding behavior in QRectF::toRect(), after qtbase 88e56d0932a3615231adf40d5ae033e742d72c33: it becomes QRect(9,9 8x8). The assert in qt_create_image_data() needs to accommodate that. - Fixed another pedantic warning in qt_create_image_data a few lines above: if it creates the image itself, it needs to round the qreal width and height values. This reverts commit a23ee5c0de0d91859e1e76e64073861347dd9861 and amends 424cfef3cc3c140df51905713fa3849562bc494d and d142b2d212ea09a7919a0a2761ee9c04d5c9bda8. Task-number: QTBUG-41043 Change-Id: I825c2c5a2bbc8d5324c3ba41a681aa68bc25a159 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Blacklist a few more canvas testsShawn Rutledge2020-03-051-2/+8
| | | | | | | | | | | | Task-number: QTBUG-41043 Change-Id: I3a48439d30d9ec1cd908197c8d63984c95d336e3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickItem: prevent endless loop in focus tab chainWang Chuan2020-03-032-2/+25
|/ | | | | | | | | | | | | | Since the commit a18ab2a3822e0d, we promote the [startItem] in focus tab chain when it is invisible to prevent endless loop. However the problem still happen if the [startItem] is equal to [firstFromItem] Fixes it by compare the [current] item with the original start item Fixes: QTBUG-81510 Change-Id: Iae0207f39e2b8c4fc6ed0cf36f0a855668accfba Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Escape url.toString() before passing it to QRegularExpressionDmitry Shachnev2020-02-201-1/+2
| | | | | | | Otherwise the test fails when path contains special characters like ‘+’. Change-Id: I461d9755436148ce979284be31ef8d204235c8a4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Blacklist tst_qquickmousearea::pressOneAndTapAnother on OpenSuseUlf Hermann2020-02-181-0/+4
| | | | | | Task-number: QTBUG-82282 Change-Id: I4794bea023f45b3bdac2f19a68550c7116a49fa2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuickLoader: store statusFabian Kosmale2020-02-122-0/+30
| | | | | | | | | | This allows us to emit the change signal only when the status has actually changed. Due to alignment restrictions, this does not even change the size of the class. Fixes: QTBUG-82002 Change-Id: I2192bf80e72b92108046780811c3acdab39af518 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix a bug where a layout could crash or become non-responsiveJan Arve Sæther2020-02-121-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This happened because of that QQuickText is ill-behaving: When the width on a QQuickText with word wrap enabled is changed to something less than its implicitWidth, its implicitHeight is changed to reflect the height it needs in order to fit all lines. This will cause the layout to be invalidated, and rearranged again. However, at the same time it will also change its implicitWidth actually become wider than its initial implicitWidth (this seems to be a bug). So the next time it is rearranged it will actually be wide enough so that it doesn't need to wrap. This again will cause its implicitWidth and implicitHeight to change to reflect that only one line is needed, which again will cause it to rearrange, but since the item has a too small width for that it will again change the implicitHeight to reflect that it needs more lines..... This went on forever until there was a stack overflow. In addition it also caused an endless (that is, if it didn't stack overflow) updatePolish()/polish() loop (basically polish() was called from within updatePolish() continuously). To make the layout more robust for such "ill-behaving" items we have to add one recursion guard, and one polish-loop guard. Change-Id: I9f752ed320a100c8d0f0fd340347a556e63318e5 Task-number: QTBUG-73683 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix QQmlProperty and Connections for properties starting with '_'Fabian Kosmale2020-02-113-0/+49
| | | | | | | | | We do a weird renaming for the change handler of properties starting with '_', now we do it at least in a consistent way. Fixes: QTBUG-82017 Change-Id: I1535a5ee462f3a344c972461f1fb954f039aa854 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QV4Engine: Do not construct invalid QVariantFabian Kosmale2020-02-071-1/+6
| | | | | | | | | If the provided typeHint is -1, it does not make sense to construct a QVariant of this type and to check whether it is appendable. Fixes: QTBUG-81945 Change-Id: I32cbb9e70e210a7eca8d55801c1783338d1173b7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Blacklist tst_qquickmousearea::nestedStopAtBounds on opensuse 15.0Ulf Hermann2020-02-031-0/+4
| | | | | | | | | This partially reverts commit 51e02fdc02c3cc2dbf9d2ba0b3fb709a6cd4e32e. Task-number: QTBUG-78153 Change-Id: I421fdc3acefd11cabfc192eb06c3cd92c0e76149 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Enable conversion from QJSValues containing arrays to container typesFabian Kosmale2020-01-314-6/+39
| | | | | | | | | | | | We started to convert containers to QJSValues, so that we could use them as JavaScript arrays. Unfortunately, this would then lead to a type missmatch when those same values where to be stored in a property of the container type. This commit fixes this by converting them back to the original type. Fixes: QTBUG-80916 Change-Id: I30a3b03e17c34b171d4a6881dfd7801c13e94d80 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix some ListView bugs related to snapping when it had a headerJan Arve Sæther2020-01-302-0/+668
| | | | | | | | | | | | | | | Most bugs were related to the PullBackHeader header positining mode, for instance the old code did not take into consideration that for the PullBackHeader it was sometimes not sufficient to scroll the view. The header also had to be scrolled independently from the view: We achieve this by hooking on to the same timeline that is used for scrolling the view. (This way, both animations are synchronized, and they start and end at the same time). Change-Id: I75708c0fd8d4741032c04ad9ee144d7a49cf3359 Fixes: QTBUG-76362 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickFlickable: fix division by zeroMitch Curtis2020-01-292-0/+49
| | | | | | | | | | | | | | | | | | | | The issue could be seen when enabling exceptions and running the following QML code: Flickable { id: flickable anchors.fill: parent contentWidth: 1000 contentHeight: 1000 Text { text: flickable.visibleArea.xPosition } } Change-Id: I615f9f9dc84903fb3a902f416a55e3ce3fece64c Fixes: QTBUG-81098 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Blacklist tst_QQuickWidget::enterLeave on macOSTor Arne Vestbø2020-01-231-0/+2
| | | | | Change-Id: Ie5437ad18fdfdba95c87adb68345b43dc1003155 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* ArrayPrototype::method_filter: Check for exception after callbackUlf Hermann2020-01-231-4/+0
| | | | | | | | | If there was an exception we cannot assume the returned value holds anything sensible. Also, we should immediately return. Fixes: QTBUG-81581 Change-Id: I822c204c476e05d6de78124b66ab2f939ca38ffd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Blacklist two failing ecmascripttests on macOSMorten Johan Sørvig2020-01-221-0/+4
| | | | | | Task-number: QTBUG-81581 Change-Id: I1c117383776bc498f0c8a6a94322259df79f4e8f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Blacklist failing quickcanvasitem tests for macOSMorten Johan Sørvig2020-01-221-0/+14
| | | | | | | | Failures can be reproduced locally on macOS 10.14, except for the “ci”-marked entries. Change-Id: I927b70f4a143b7741ac0d18588d32bfb637dd14c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Flatten version-specific blacklisting on macOS to all macOS versionsTor Arne Vestbø2020-01-224-6/+6
| | | | | | | | | | | We don't know which versions these blacklistings actually apply on unless we actually get macOS 10.14 and 10.15 into the CI and running tests, so let's start with that, and then granularize the blacklists after that. Task-number: QTBUG-75786 Change-Id: I166f845ae3701b1ff528a0c5bfe5fd23c018483e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Blacklist tst_TouchMouse::touchButtonOnFlickable() on mingwUlf Hermann2020-01-151-0/+4
| | | | | | | Task-number: QTBUG-74517 Change-Id: I9733fe53f65d107c830b2fe47a475b2159a70540 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuickItemView: fix crash when changing modelWang Chuan2020-01-152-0/+50
| | | | | | | | | | | | | | When visible items become invisible, ListView will try to cache them and redisplay these items if necessary. However, we can't cache items when changing to a new model, since the old one will be deleted later Fix by adding a flag to let ListView know we are clearing items and prevent cache unnecessary items Fixes: QTBUG-80203 Change-Id: I50dcd3f0586c93496b143bdad0e59751360501a8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Blacklist touchAndDragHandlerOnFlickable() on OpenSuse 15.0Ulf Hermann2020-01-101-0/+1
| | | | | | | Task-number: QTBUG-81290 Change-Id: I58f64f5eabdb72f2f01bf72e988941521a89d331 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* On QQmlEngine destruction drop singletons before type loaderUlf Hermann2020-01-102-0/+37
| | | | | | | | The singleton destruction can trigger additional types to be loaded. Fixes: QTBUG-80840 Change-Id: Ifa406b2a1cfd3b9e9b36e8005dfc0808eebf15cf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4: Avoid integer overflow on typed array length checkUlf Hermann2020-01-081-0/+36
| | | | | Change-Id: I370b4c4bd0d7962878849ca7c5edef6cb36eca25 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Check stack limit in FunctionPrototype::method_apply()Ulf Hermann2020-01-081-0/+13
| | | | | | | | | We could just crash there, assuming unlimited memory, but as this particular place seems to be a very attractive target for various mischief, let's just plug it. Change-Id: I3b0369ceb34dafd12ce8dc1f189fc5f9ee82c169 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4: Don't crash when iterating invalid Proxy objectsUlf Hermann2020-01-081-0/+15
| | | | | | Fixes: QTBUG-81109 Change-Id: I97f37c68d33f414d7bffa9b66e0aaed93370dc68 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4: Don't crash when sorting arrays with non-stringifyable entriesUlf Hermann2020-01-081-0/+12
| | | | | | Fixes: QTBUG-81108 Change-Id: I7e121776a2416b5338c4c1309ec7cc31c703ad28 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Stabilize QQuickItemParticleLouis du Verdier2020-01-072-0/+102
| | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes two crashes and a memory leak in QQuickItemParticle. The first crash was caused by the list m_loadables that kept pointers on QQuickParticleData, that could in the meantime become dangling pointers if the associated particle expired or got deleted by a call to the reset() method of the particle system. Its role was to keep a list of particles that did not have a delegate instantiated yet, in order to create them in the tick() method. This list is removed and the list of particles to handle is directly deduced in the tick() method. The second crash was caused by the list m_deletables that could in some situations (generally due to a reset()) contain multiple times the same delegate, and therefore cause a double delete in processDeletables(). This list is changed to a set to avoid this situation with a minimum impact on the rest of the code. The memory leak was caused by the m_managed list of delegates that was not freed when QQuickItemParticle gets deleted. Task-number: QTBUG-71193 Change-Id: I6fe30ee59a9a0bb90c14c62c7a48a50f465a9e0c Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
* QV4: Support printing arrays with circular referencesFabian Kosmale2020-01-071-0/+13
| | | | | | Fixes: QTBUG-81105 Change-Id: Iaf0597cea3a5572f020c5f87a843774f33cc01fd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QV4: Array.includes: Support large arraysFabian Kosmale2020-01-071-0/+12
| | | | | | | | | Creating new ScopedValues in the loop was quite wasteful, and would trigger a crash. We now simply reuse the ScopedValue. Fixes: QTBUG-81104 Change-Id: Ie1efd144886861a21c8f6827d7fd23699a1e0dcc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QV4: Check recursion limit in toStringFabian Kosmale2020-01-071-0/+22
| | | | | Change-Id: I18b7a4e00150f6c47c991a5164901159b7f946b9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QV4MM: Fix crash caused by MarkStack overflowFabian Kosmale2020-01-071-0/+49
| | | | | | | | | | | | | | MemoryManager::collectFromJSStack did push to the mark stack without checking if there is actually still space available. To fix this, we now drain the stack once we hit the limit. The test case is a slightly modified version compared to the reported one, removing one loop. This was required as our regular expression does not throw an exception when there are too many capture groups. However, to trigger the bug, looping was not actually necessary. Change-Id: I4d00865f25a989c380f4f5b221f4068c80b71d2b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* V4: Catch error when compiling broken RegExpsUlf Hermann2020-01-071-0/+17
| | | | | | | Otherwise we try to assign an invalid RegExp object, which crashes. Change-Id: I85478406524a2a9d7542758caaa1b42b4090bb93 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4: Fix sorting of sparse arraysUlf Hermann2020-01-061-0/+21
| | | | | | | setArrayData() needs to handle a nullptr argument. Change-Id: I1ea05d9db9beb1fede6d3c068cfcf700702e8aa6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Avoid oob access on Array.concatUlf Hermann2020-01-061-0/+21
| | | | | | | | | | As we have already determined that we're past the end of the allocated space on the source object by checking os->values.alloc, we should conclude that all the remaining values are undefined. Fixes: QTBUG-81037 Change-Id: I664f22b7eb37c26061e8a9e2f88bcf2a7b6e09f3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Emit QQmlEngine::warnings when load failsFabian Kosmale2020-01-062-0/+21
| | | | | | | | | This uses the existing infrastructure for reporting QML errors, instead of simply using qWarning. Fixes: QTBUG-81093 Change-Id: Ie18656a57f28fa9dfe922936fd05b44ebe1281e2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QV4::ExecutionEngine: provide QNAM accessorFabian Kosmale2020-01-033-0/+30
| | | | | | | | | | | In XMLHttpRequest, we need to get the QNetworkAccessManager from the engine. However, if the request originates from a WorkerScript, there exists no qmlEngine. We therefore add a new indirection to access the QNAM, and set it up accordinly in registerWorkerScript. Fixes: QTBUG-81055 Change-Id: I8915202b6d6b7139c8386304b3d1d7a22a82045e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QV4Engine: support conversion of QJSValue to SequenceTypeFabian Kosmale2019-12-202-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | 8704c640946ac852668638e2980d3e2b78aa27ae introduced new conversions via sequentialIterableToJS. Due to that, QVariant properties which formerly stored e.g. std::vector<QObject*> now would store a QJSValue. Those would still claim to support a conversion to QVariantList, but -contrary to what our documentation says-, we were not able to do a conversion to QSequentialIterable. The default constructed QSequentialIterable would then crash when calling begin(), as that function pointer was null. This patch fixes this by adding the necessary support to convert a QJSValue containing an array. Non-array QJSValues will still return an "empty" QSequentialIterable. Note that this changes what happens when a QJSValue is converted to a QVariantList, as QVariantValueHelperInterface<QVariantList> will check first if there is a converter to QSequentialIterableImpl before attempting to call any directly installed converter to QVariantList. In order to not change the existing behavior, the QSequentialIterable returns the QVariant corresponding to the QJSValue at a given array position, intead of a QVariant containing the QJSValue. Fixes: QTBUG-80609 Change-Id: I8101229c0d2043b3f2d618ed035b279844802dd8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.14.0' into 5.14Qt Forward Merge Bot2019-12-132-0/+26
|\ | | | | | | Change-Id: Ibd935bf31aa2bcb2e4051c865ab946daeeeecddb
| * QQuickPixmapCache: Don't dereference nullptrv5.14.0-rc2v5.14.0Fabian Kosmale2019-12-052-0/+26
| | | | | | | | | | | | | | | | | | | | Consistently check that job->data is not null before derefencing it. Fixes: QTBUG-80510 Fixes: QTBUG-79937 Change-Id: I894503ddd2254814463073cc12f8365641efc689 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * mouseDrag(): ensure that intermediate moves are done for all dragsMitch Curtis2019-11-261-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code checking if the intermediate move distance was less than the drag threshold, but without accounting for negative distances. Since the negative distances were naturally less than the drag threshold, the intermediate distances were set to zero and the intermediate moves were never done. In practice, this means that mouseDrag() never did intermediate moves (i.e. what happens during a drag in real life) for drags that go from right to left or upwards. Task-number: QTBUG-80152 Change-Id: Ic27021f5ce5ba2937e95fb2dfb532bd2136f4205 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit fad8ef3e4133538e3785d7067c35c652bc894711) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Add binary compatibility files for qtdeclarative 5.14 branchMilla Pohjanheimo2019-12-134-0/+60209
| | | | | | | | | | | | | | BC files built against 5.14.0 added. Change-Id: I4904ad2bbe57ca5e0bef40b349dcceaee1803f74 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QQuickTableView: set empty content size when table is emptyRichard Moe Gustavsen2019-12-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-092-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-092-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | tst_qquicktableview: ensure test checks for correct error messageRichard Moe Gustavsen2019-12-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Change 631ef67458 fixed a bug that wrote a wrong error message to the console. But there is a test that checks for that message that was also wrong (but for some reason the test passed in the CI, but it has started to fail locally). This patch will ensure that the test don't fail because we check for a wrong error message. Change-Id: I27e16b0f4aa6a0ffeb8c42f846c344436a41ad3c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>