aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Use localPos for windowPos when passing mouse events to QQuickWidgetv5.9.4Ulf Hermann2018-01-172-0/+47
| | | | | | | | | | | | QQuickWidget thinks of itself as a toplevel window, so it cannot process the offsets in a parent window. Amends 41293196b4db1aa7a0c616af312875c484639644. Task-number: QTBUG-65800 Change-Id: I8c5dcb8f44a6cbdb58bcc956d8263e68d8180bec Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Blacklist test_move() in tst_qquickcustomaffector on win/gccUlf Hermann2018-01-172-7/+10
| | | | | | | | | | | The test is unstable. Also, print the actual numbers if the fuzzyCompare QVERIFYs fail again. This way we can see better what is going on. Task-number: QTBUG-65819 Change-Id: I65368300498382f7bfebb25299280aa15e3a56ef Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Fix holistic benchmarkErik Verbruggen2018-01-021-3/+10
| | | | | | | | | | | Each test now uses its own QQmlEngine, instead of using a single instance across all benchmarks. The effect is that peak heap usage (on macos) is now about 77MB, where it previously peaked at 770MB. This benchmark would actually crash on some platforms due to excessive malloc/mmap usage. Change-Id: I214f7b9b3d8c5565c0578b82c9c144ec87ed0f2b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix animation benchmarkErik Verbruggen2018-01-021-3/+3
| | | | | | | This was broken by 49a11e882059ee1729f776722e085dd21d378c36. Change-Id: Ic7f261bce5e35b3dbcbdaf0b8718e08c56e55b39 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove extra addrefMichael Brasser2017-12-293-0/+44
| | | | | | | | | The code was previously updated to use QQmlRefPointer, so we shouldn't explicitly addref. This allows more components to be correctly trimmed when needed. Change-Id: I15a961cfc456eeab5c791c8a282cc7e2852912cb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use potentially intercepted URL as ID for compilation unitsUlf Hermann2017-12-212-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | We generally have to pass a URL and a file name everywhere because the logical URL might be something else than the actual file being loaded. For example a QQmlFileSelector might modify the URL to be loaded for a specific file. This resulting URL, however, should not be used to resolve further URLs defined in the file loaded that way. As we need to access QQmlTypeLoader::m_url as string more often now, cache it and avoid frequent translations between QUrl and QString. Furthermore, QQmlDataBlob's URLs are changed to follow the same semantics. The finalUrl is the one that should be used to resolve further URLs, the url is the one used to load the content, and subject to any redirects or interceptions. This changes the semantics of URL redirects. Previously a redirected URL was used as the base URL for furher URL resolution. This doesn't work because redirection occurs after interception and interception should not influence the resolution of further URLs. We now use the original URL as base URL for resolution of further URLs and rely on the server to redirect those, too. Task-number: QTBUG-61209 Change-Id: I93822f820bed2515995de3cb118099218b510ca4 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Add test to QQuickShortcut when render window is usedKari Hautamäki2017-12-193-0/+181
| | | | | | | | | Add auto test for shortcuts when render window is used to draw QQuickShortcut. Task-number: QTBUG-64548 Change-Id: If2eb1f5618ae5f21477cc239acb42bc73ca7ec99 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickItemView: Clear pending changes when refillingUlf Hermann2017-12-182-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | | Generally the bufferedChanges are an "extension" of the currentChanges, which can just not be applied at the moment because we are in a layout phase. If we regenerate or clear the whole view in the mean time, the bufferedChanges become just as invalid as the currentChanges. On top of that, refilling can trigger further changes, part of which will be applied during the refilling. As that leaves us in an inconsistent state, we need to loop the refilling until no further changes are generated. As the changes might affect items that are already visible, and therefore not subject to refilling, we need to clear all the items before refilling in this case. In QTBUG-46488 things are added in the onCompleted callback of the delegates (by expanding the tree view, which translates into adding rows to the list view). Depending on where you add the new items, the list view might pick them up when iterating the model on refill() or it might create delegates for the same model entry twice. So, if that happens we need to discard the result and refill again. Task-number: QTBUG-46488 Change-Id: Ie4e0a731f7feda6aa962b6cb9a6cd5c3bf90486e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickList/GridViewPrivate::fixupPosition: don't set moveReasonShawn Rutledge2017-12-161-1/+14
| | | | | | | | | | | | | | | In QQuickItemViewPrivate::applyModelChanges(), if moveReason = QQuickItemViewPrivate::Other, then QQuickItemView::trackedPositionChanged() will fail to call d->setPosition(pos), which is normally what keeps the Flickable moving for a while. Leave the reason as-is (it will be SetIndex in this case), so as not to forget that we were actually trying to move down when the sequence window->polishItems() -> QQIV::updatePolish() -> layout() -> fixupPosition() did its part of the work of moving down. Task-number: QTBUG-62864 Change-Id: I1021e2ea39265de9e1285e2ee17c5733189ab939 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add the source directory as import paths in tst_qqmlimportUlf Hermann2017-12-111-3/+3
| | | | | | | | On shadow builds the QML components won't be found in the build directory. Change-Id: I0f524063537669f68e64fc6c04a6756ed1d130fd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Pass the source directory in the plugindump testUlf Hermann2017-12-112-1/+2
| | | | | | | | On shadow builds this fails when just passing ".", because "." is the build directory. Change-Id: Iee84b73f2c4e5c8663d84d53b31f658501244dc9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* grabMouse() and QQWPriv::removeGrabber(): be clear whether mouse or touchShawn Rutledge2017-12-052-0/+102
| | | | | | | | | | | | | | | | | | | | | | | The bug was that a MouseArea could be stuck in pressed state if a touch tap occurred simultaneously on a second MouseArea while the first was held pressed by the actual mouse. QQuickWindowPrivate::setMouseGrabber(QQuickItem *) had too little information to make the right choice in case the given item argument is null. It should not mean ungrab everything: in this use case, the mouse and the touchpoint can be pressing two different MouseAreas, and releasing either one should ungrab only the MouseArea that is being released. However the only place it was called with nullptr was in removeGrabber(), and in that context we are given all the information: which item to ungrab and whether we want to ungrab mouse, touch or both. It's better to have a little code duplication between QQuickItem::grabMouse() and QQuickWindowPrivate::removeGrabber() than to lose this information about which device(s) and Item to ungrab. Task-number: QTBUG-64249 Change-Id: I0710534a05f3ceeb66105a03ab0f32a61df8a522 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Add a means to unregister custom qml typesAndy Shaw2017-12-013-0/+209
| | | | | | | | | | | | | | | In cases where Qt is used in a plugin it is possible that a plugin will be unloaded while Qt itself is still loaded and as a result there is a chance that there will be conflicting types registered. Therefore, to ensure that plugins correctly clean up after themselves cleanly, we need to add a means to unregister qml types. This is intended to only be used when the user knows what they are doing. Task-number: QTBUG-56521 Task-number: QTBUG-56532 Change-Id: Ie396e522385004e6e9f3841e04f8072ff29cb15b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickListView/GridView: load items that results from model changes ↵Richard Moe Gustavsen2017-11-302-0/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | synchronously The current implementation created new items with default incubation mode, which is AsynchronousIfNested. But from reading the code, it seems like changes to the model were really expected to be handled synchronously, since there aren't any sections in the code that will recover from situations were requested items ends up incubating async. This is also backed by the fact that the second argument used to be a bool set to 'synchronous'. The fact that this was translated to AsynchronousIfNested later down the chain didn't seems to be taken into account. A bug with this is found in ListView when it's embedded inside an async Loader. In that case, all list items will be incubating async at startup, which is normally expected and fine. But if the model assigned to the ListView is modified before the loader has finished, async loading will also happen to the items created because of the change. And then the situation described above will occur. This patch will force any items loaded because of a model change to be synchronous. This seems to be in line with the synchronous logic that already exists. And its also quite acceptable, since changing the model before everything is completed is a corner case, and can naturally lead to some stuttering in the list view anyway. A potential for improvement on this logic is to try to recover whenever creating an item fails. But this takes a lot of work because of the way model changes are structured and stored, and can easily cause regressions. Since this is a corner case, it is probably not worth it. [ChangeLog][QtQml][ListView] Fixed a bug in ListView that sometimes make items end up with wrong geometry when changes to its model happens while the ListView is being loaded async (e.g if wrapped inside an async Loader). Task-number: QTBUG-61537 Change-Id: I8d6857beaf8ef98b02bb46282a1312749b0fb801 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQmlIntanceModel: use QQmlIncubator::IncubationMode instead of bool to ↵Richard Moe Gustavsen2017-11-301-9/+9
| | | | | | | | | | | | | | | | | | | | | | specify incubation mode The current implementation would pass a boolean to signal if asynchronous or synchronous incubation should be used to create an item. The problem with this approach is that passing 'synchronous" would translate to QQmlIncubation::AsynchronousIfNested later down the chain. This meant that even if the caller requested synchronous incubation, it could end up with asynchronous incubation anyway, e.g if an async parent incubator was active at the time of the call. And this can easily come as an unhandled supprise for the caller, and as such, cause unforseen bugs. This patch is a first of a set of patches that is done to fix the bug reported in the task below. It will not change any behavior, it is written to preserve the logic exactly as it were, just as a preparation for subsequent patches. It makes it explicit at the call location what incubation mode will be used, and especially make it clear whenever the AsynchronousIfNested flag is in play. Task-number: QTBUG-61537 Change-Id: I8b3ba5438ebb2cd59983a098bd8ceeeb844da87b Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix crash when moving items during asynchronous creationJoni Poikelin2017-11-282-0/+76
| | | | | | | | | | | | | | | In complicated cases where the model moves rows around while the view is running slow (perhaps during high CPU load), there were cases when Repeater would call movedItem->stackBefore(deleteableItem), but deleteable items can be null, so there was often an error QQuickItem::stackBefore: Cannot stack before 0x0, which must be a sibling and occasionally a crash. Now we check both the callee and the parameter to stackBefore to make sure neither of them are null. Task-number: QTBUG-54859 Change-Id: I45a8b2939c16b9bbe3a802ddd348dc55f51061a7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* More fine-grained deferred property executionJ-P Nurmi2017-11-251-0/+152
| | | | | | | | | | | | | | | | This allows Qt Quick Controls 2 to defer the execution of certain building blocks until needed. For example, a button control can defer its background item so that the default background is not executed at all when replaced by a custom background. First of all, this gives a massive performance boost for customized controls. Secondly, this avoids the most burning issue in QQC2, problems with asynchronous incubation ("Object destroyed during incubation"). Task-number: QTBUG-50992 Change-Id: If3616c9dac70e3a474a20070ad0452874d267164 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Re-enable QML memory profilingUlf Hermann2017-11-233-1/+40
| | | | | | Task-number: QTBUG-64674 Change-Id: I48ed1a51f66ef8d55cc026f140d270baaca04fbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Don't reject plugin-only qmldir filesUlf Hermann2017-11-222-12/+41
| | | | | | | | | | | | On QQmlImportsPrivate::updateQmldirContent we need to check if the new module has actually been established after figuring out that it doesn't have any components or scripts. If it has, then we shouldn't fail, as obviously a plugin has been loaded. We don't need to check the component and script versions in that case, as plugins don't have separate versions. Change-Id: Ie328b59038fe65c3f6a2eeecfe969927bba6cd68 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix URL interception for qmldir filesUlf Hermann2017-11-223-0/+262
| | | | | | | | | | | | | | | | | We need to intercept the URL when it is created. This relieves us of the need to hack around in it when actually retrieving the content of the qmldir file and prevents the futile attempt to load remote qmldir files via the code path that should load local ones (or vice versa). The back and forth conversion between URLs and strings is unfortunate, but can only be solved by using QUrl rather than QString where we actually mean URL. This would be a bigger change which is unsuitable for 5.9. Mind that nothing changes for code that doesn't use URL interceptors. Task-number: QTBUG-36773 Change-Id: I6bff3ae352009fdc0a17ec209691c7b390367f11 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Blacklist tst_qquickwidget::enterLeave() on MacJ-P Nurmi2017-11-091-0/+2
| | | | | | Task-number: QTBUG-64397 Change-Id: I28268ea87b81dd1f7dbf8bb5a8eb421962cc5f31 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Make tst_qquickframebufferobject pass on macOSJ-P Nurmi2017-11-091-2/+4
| | | | | | | | | The test has not been run in the CI, so the problem went unnoticed for a long time. Change-Id: I42a44a5fb89c0bd78e8997d4841e85672c73acdb Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix tests/auto/quick/quick.proJ-P Nurmi2017-11-091-1/+1
| | | | | | | | | | | | The following auto tests have not been run in the CI at all: - tst_qquickanimatedsprite - tst_qquickframebufferobject - tst_qquickopenglinfo - tst_qquickspritesequence - tst_qquickshadereffect Change-Id: Iacc832563fd2c002eef480fa4d42469d852adc0f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Fix tst_qquickshadereffectJ-P Nurmi2017-11-091-4/+4
| | | | | | | | | The expected signal counts were not matching. Since the test has not been run in the CI, it went unnoticed. Furthermore, the test crashed due to a missing null pointer check. Change-Id: Iff80a2ea17832eb7bc531ac9eb2fc482f2c69e38 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* stabilize and optimize tst_QQuickListView::QTBUG_34576_velocityZeroShawn Rutledge2017-11-081-8/+9
| | | | | | | | | | | | | | | | | - don't use QTRY_VERIFY or QTRY_COMPARE if there's nothing to wait for, because it will always wait a short time and add needless delay to the test - QVERIFY(QSignalSpy::wait())'s should perhaps not be done in sequence, in case the second signal already happened while we were waiting for the first. QTRY_VERIFY(QSignalSpy::count() > 0) should be more reliable in such a case, as long as we are sure the count started at zero before the behavior which was supposed to make the signal be emitted. - 1000ms is probably not long enough to wait for ListView velocity change on a slow CI system. - according to the comment "verify that currentIndexChanged is triggered" we need another spy for that signal. Change-Id: I99d93a849b674ce6c81acbe91639f03933025117 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix ListView::positionViewAtIndex with ListView.Contain modeJoni Poikelin2017-11-072-0/+75
| | | | | | | | | Sticky headers and footers weren't accounted for when calculating new view position causing the requested item to be left behind them. Task-number: QTBUG-63974 Change-Id: Id69579643a942e8558960b2c8b0fee980fa86947 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickWidget: pass enter and leave events to the offscreen windowAndy Shaw2017-11-062-0/+37
| | | | | | | | | | By passing the enter and leave events to the offscreen window it will enable mouse areas inside a QQuickWidget to know when the mouse has actually entered or left the area if it is covering the whole item. Task-number: QTBUG-45557 Change-Id: I670ebe30e367e919c73fed449bf2bed7ca42b5fd Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* QQmlEngineDebugService: Check QML contexts for validityUlf Hermann2017-11-051-0/+39
| | | | | | | | | We should not operate on invalid QML contexts and once we have established a context to be valid we don't have to check the result of QQmlContextData::get anymore. Change-Id: I9106115ddf925c3572048f1fd334bdfd9a9cfca7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* stabilize tst_QQuickListView::incrementalModelShawn Rutledge2017-11-031-9/+4
| | | | | | Task-number: QTBUG-30716 Change-Id: I0c6829ae496850d6a2cdcc349c496dfbf4e8adbb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Add benchmark for event deliveryFrederik Gladhorn2017-11-036-1/+255
| | | | | | | Change-Id: Ic433a832190ff3e89fae696e1eabf0c7dfa57cec Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix providing correct velocity when using index based scrollingPasi Petäjäjärvi2017-11-032-0/+152
| | | | | | | | | Index based scrolling does not enable moving and flicking properties. Task-number: QTBUG-34576 Change-Id: Ief06d37115ca389027670c97ce6c0457a74d4872 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickItemView: always honor the removeDisplaced animationAlberto Mardegan2017-11-032-3/+34
| | | | | | | | | | | | | | | The animation was not being performed if the delayRemove attached property was changed by the handler of the remove() attached signal. We need to run the delayed transitions not only if we have an animation for the target item, but also if we have an animation for the items being displaced. (The flag variables can safely be obtained outside of the for loop, given that their value should not change during the loop iteration) Task-number: QTBUG-57225 Change-Id: I8c138677d7dcdf63e0932ec5cf7738c0caeb2ab8 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* ListView: don't stop moving the highlight because of model updatesShawn Rutledge2017-11-032-0/+60
| | | | | | | | | | | | | | | | | In QQuickItemViewPrivate::applyModelChanges(), if moveReason = QQuickItemViewPrivate::Other, then QQuickItemView::trackedPositionChanged() will fail to call d->setPosition(pos), which is normally what keeps the Flickable moving for a while. Leave the reason as-is (it will be SetIndex in this case), so as not to forget that we were actually trying to move down. Updating the model was just a side-effect of that: either because some QML code was trying to append to the model or because fetchMore() was called. Task-number: QTBUG-61269 Task-number: QTBUG-62864 Change-Id: I3fd402469950d6c12e6a8d6e42be83ea4f54776a Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickFlickable: Use QQuickItem::setSize() in resizeContent()Alexandr Akulich2017-11-031-0/+8
| | | | | | | | Sequential call of setWidth() and setHeight() results in outdated height on widthChanged() signal. Use setSize() to set width and height at once. Change-Id: I013f5e1fcfc65a8606f9596ddc196b633873dc98 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickItemView: avoid wrong repositioning of removed itemsAlberto Mardegan2017-11-032-0/+125
| | | | | | | | | | | | | If all the items currently in the view are being removed, lastVisibleIndex will be -1. This caused an unwanted repositioning of all the deleted items, which got moved to a wrong location. Therefore, when all visible items are removed, we should avoid recomputing any item's position. Task-number: QTBUG-57225 Change-Id: I9909748a9cccb5e6a3726306e250921ce69fcba9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickAnimatorProxyJob: Disconnect from window when unsetting itUlf Hermann2017-10-241-0/+18
| | | | | | | | | | Otherwise we may get called back when the window's scene graph is ready, but we don't have a controller anymore then. This leads to a crash. Change-Id: I8075619e1fd3c69ca0f7d0b1d72952b8cc5040f8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* skip part of tst_qquickwindow::testWindowVisibilityOrder on UnityShawn Rutledge2017-10-231-4/+9
| | | | | | | | | | | | | | It's flaky: on the CI machines, the first three windows are shown stacked on top of each other, and none of them has focus, because the terminal which is running the tests continues to have focus. If this happened to a user, he would just click in whichever window he wants to have focus. (Good thing it's visible, at least.) So this looks like broken window manager behavior. Ubuntu will switch to Gnome soon anyway; then maybe the behavior will be different. Task-number: QTBUG-62604 Change-Id: Id0db8a61e8335e7f591a38e07c488c055b236239 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Fix outdated BSD license header in tests to use GPL-EXCEPTKai Koehne2017-10-231-29/+17
| | | | | Change-Id: I64a7b7cb7fa6c5fe53019ed42b19989a0f8a0da2 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* QQmlTypeLoader: Drain events before shutting down the threadUlf Hermann2017-10-203-0/+52
| | | | | | | | | | We take references to types when sending events to the other thread. If we don't process the events, the references are kept, which leads to memory leaks. Therefore, when shutting down a QML engine, we have to make sure the event queues are emptied. Change-Id: Id8b0440029cfd7d03a9e540747eaedbcaa7c9ff3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQuickLoader: Use setSize() to resize itemAlexandr Akulich2017-10-202-4/+12
| | | | | | | | | Sequential call of setWidth() and setHeight() results in outdated height on widthChanged() signal. Use setSize() to set width and height at once. Change-Id: I86ff5cef2da912a8855c66a614d5d7d2e71f1de8 Reviewed-by: Risto Avila <risto.avila@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Extract QSizeChangeListener from tst_quickview to shared test utilsAlexandr Akulich2017-10-205-24/+97
| | | | | | | The class is useful for other tests Change-Id: Iea287ee7659a7504800763c45ae5dc744360eaa0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Update the cursor rectangle when select all is triggeredAndy Shaw2017-10-201-1/+1
| | | | | | | | | | | | | | | | | | When select all is triggered then the cursor rectangle should be updated to ensure that the selection handles are visible if they are displayed on a given platform. For instance, on iOS the loupe handles should appear in this case. This also has the added effect that when using Backspace on the iOS keyboard, it will delete the selected text as opposed to just a single character as it will handle that situation correctly. The tst_qquicktextedit::inputMethodUpdate() test is modified to account for the extra event sent now when selectAll() is called. Task-number: QTBUG-63835 Change-Id: I94fb0576b286c006dd12c65d0b322d712ed2a96f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Tell QQmlImportInstance::resolveType what kind of type we wantUlf Hermann2017-10-192-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | In QQmlTypeData::resolveTypes() we know if we're looking at a reference to a composite singleton type, or some other type reference. When we call resolveType() we expect the correct type to be returned, not only based on URL, but also based on its singleton property. QQmlTypeData::resolveType() eventually invokes QQmlImportInstance::resolveType() which will call fetchOrCreateTypeForUrl(), passing a parameter on whether the result should be a composite singleton. When operating on a qmldir component the component itself encodes this. When fetching a type from a local file without qmldir, we currently assume that it isn't a singleton, no matter QQmlTypeData::resolveTypes() has determined. This means that actual singletons loaded this way later get refused by the sanity check. In order to fix this, pass the information about the expected singleton property on to QQmlImportInstance. This is done using QQmlType::RegistrationType, which gets another entry for "any type". If the expected type is CompositeSingletonType QQmlTypeData::resolveType() will not create a non-singleton type. If it is any specific other type, it will not create a composite singleton. And if it is AnyRegistrationType, it will behave as it previously did. Change-Id: I6b7e082b63582e0aed946bb3d19077b94c7a45f7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix execution of deferred propertiesJ-P Nurmi2017-10-185-0/+102
| | | | | | | | | | | When deferred properties were assigned in multiple contexts, only the outermost context was executed. Any deferred property assignments in other inner contexts were never executed. Collect the deferred data to a container to be able to execute them all. Task-number: QTBUG-63200 Change-Id: I88fab27c1f81b5188430ada086dcc19842507e99 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix outdated BSD license headerKai Koehne2017-10-1777-216/+986
| | | | | Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* ObjectModel: provide unique move IDsJ-P Nurmi2017-09-261-5/+5
| | | | | | | | | | | | QQuickItemViewPrivate::removeItem() uses a QHash to store items that were removed due to a move. If the move IDs are not unique, multiple buffered moves end up overriding each other. This results to leaked items that are never released. Task-number: QTBUG-62607 Change-Id: I7e7e7fcd6b1b0aa50ed55643ba5674e98536f89f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Fix behaviors not working when sub-types declare propertiesSimon Hausmann2017-09-223-0/+33
| | | | | | | | | | | | | Since commit 81867dfbf9c16d4300727a08eed9b5c6c979e0ba we have an optimization in place to avoid the virtual meta-call when writing properties that cannot be intercepted. Unfortunately that check did not take parent VME meta-objects into account, which triggered the bug. Test case by Harald Hvaal <hhvaal@cisco.com> Task-number: QTBUG-63365 Change-Id: I66cb2967da2c09ca5e38cebd9db2ee6e3ee78f5f Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix qmlClearTypeRegistrations() not dropping all registrationsSimon Hausmann2017-09-192-9/+52
| | | | | | | | | | | | | In commit 48c09a85ce397979c7e706e3694c879ffe456e09 we added the undeletableTypes container to hold a reference on C++ registered types to keep the indices returned by the public qmlRegisterType() API stable. Since qmlClearTypeRegistrations() is API that also resets those indices, we must also clear the undeletableTypes container to avoid leaking memory. Change-Id: I2038c00913f894d58aca3714d64d497493585326 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fall back to the ObjectWrapper for model advanceIteratorAndy Shaw2017-09-151-0/+23
| | | | | | | | | | | | When falling back to the QObjectWrapper it will add in the extra parts added when the roles were added to the object created by the model to hold the data being returned. This was causing the last entry to be duplicated and causing extra work too. Task-number: QTBUG-54285 Task-number: QTBUG-62156 Change-Id: I2907477277df8d16db4491a4999f004433e4205c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickTextEdit: call implicitWidth() even if requireImplicitWidth is trueTim Jenssen2017-09-141-0/+13
| | | | | | | | | | | | | | Before once requireImplicitWidth was set to true by requesting the implicit width, the implicit (and width) was never updated again, even if the text was updated/changed. Adding also a test Task-number: QTBUG-63153 Change-Id: Ie3bac4baeb14c2e69acc43d11a351ac91d5400da Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>