aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Cull removed items from QQuickItemViewFabian Kosmale2020-06-153-2/+63
| | | | | | | | | | | | | Amends a20132c326f6d2c5fec848efb98dd86afb320e2a, which fixed a crash, but also prevented the item from being culled. This is fixed by narrowing the scope of the condition to affect only the caching related part. Fixes: QTBUG-84604 Change-Id: I9b8a1a148d6538a18280475d89b87a4049ff3465 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit ab03621516630991c7cc0fea3be79879efed23a8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Get rid of preprocess in QQuickTextEskil Abrahamsen Blomfeldt2020-06-156-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preprocessing in the scene graph is actually pretty expensive, so we want to avoid using it for something like text, where you can often have a lot of nodes in a UI. For text it was previously used for two purposes: 1. To make sure the distance field glyph cache was updated with potential new glyphs before the frame was rendered, but *after* all new glyph nodes had been created (this is an optimization to avoid having to resize the cache multiple times in one frame, but rather wait until we know the exact amount of new glyphs that need to be added) 2. Update the coordinates of the glyph based on their position in the glyph cache if the glyph cache says they have moved (or if they have just been added for the first time). Point #1 can actually be handled a lot simpler, by having a separate loop for the existing glyph caches where we ask them to preprocess. There is typically only a few glyph caches, but can be hundreds of glyph nodes in a scene, so in the previous code we would be calling the update() functions on the same glyph cache over and over again every frame. Point #2 does not need preprocessing every frame, but can be reduced to only preprocess when the geometry is marked as dirty. We then do a pass on the glyph node in question to update its geometry and turn the flag off again so that we don't pay the cost every frame. Fixes: QTBUG-84351 Change-Id: If8c492acaef9c512c2db61b64bcab2103db2d997 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 1f3dd3f5db16892739963168c2a76df6354b178c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Improve documentation for DateKai Koehne2020-06-121-12/+36
| | | | | | | | | | | | | | | | Structure the overview more by adding section titles. Also be more elaborate on what the enum's mean for the different parts/methods. Finally, make it explicit that NarrowFormat for date and time is the same as ShortFormat. Fixes: QTBUG-83841 Change-Id: I0a93361fcc8e30f1080938976d8e0b2d5a55e563 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 864f9b79fba25b38a1139d67a7b299b63149c470) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QQuickKeyNavigationAttached issueValery Volgutov2020-06-123-6/+60
| | | | | | | | | | | | | | | | | | | | | When Repeater used for Item creation, we have following issue: When Repeater creates a new item and this item tries to set keyboard.left or keyboard.right to another Repeater-created sibling, these items haven't been created yet, and we have issue with navigation keys. Set rightSet to true if right really changed. When object calls KeyboardNavigation::setRight(null), rightSet = true, but right field did not change (null). After that, navigation keys work incorrectly. The same for other cases. Task-number: QTBUG-83356 Change-Id: I9ea6d6a7d13ff989aac3d9e2d22467b48080de13 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit f07641b47a7c479894472e933d202bfcec0e222e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Update example of QML int valueYuya Nishihara2020-06-121-1/+1
| | | | | | | | | | Item width and height are real numbers. Let's pick other property of int type. Change-Id: I43e74e4005681d570047648e2c141994a075150e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit d373fcab7a2beac1addc04a6bbe0b4d1f9770f23) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove quality evaluation in test stringEskil Abrahamsen Blomfeldt2020-06-102-2/+2
| | | | | | | | | | | | | | | It is not the test's place to evaluate the quality of the outline shader (which also looks perfectly fine unless you don't really like outlined text). And it looks unprofessional to use rude words to describe our code in manual tests. Strings in lancelot tests are also inefficient ways of reporting and tracking bugs if that was the intended use of this. Change-Id: Ib9fdb4e56539b9b02f8b3f1d06eb3e3beb51f8ef Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit facf085fbcf614a25c6cfdff39ad80a46180a322) Change-Id: Icc62114702265e9e1b247624370a78999e564d5f Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Consider margins in xflick/yflickNicolas Fella2020-06-101-4/+6
| | | | | | | | | | | | | | | AutoFlickDirection and AutoFlickIfNeeded compare the size of the flickable with the size of the content item. We need to take margins into account since they might cause the need for scrolling when the content would otherwise fit. Fixes: QTBUG-31905 Change-Id: I18d073af4c6ffb1b703f5e2b33f616b61e816e56 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Marco Martin <mart@kde.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 583a99ae6688f526bb4f1877d2f253523903c9ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix race condition in QQmlData::createPropertyCacheFabian Kosmale2020-06-097-16/+41
| | | | | | | | | | | | | | As noted in QJSEnginePrivate::cache, there can be a race between calling addRef on the QQmlPropertyCache and another thread derefing and consequently deleting it. To avoid this, we introduce a doRef flag in QQmlMetaTypeData::propertyCache, which tells it to ref the the cache. This fixes the issue, as the QQmlMetaTypeDataPtr in propertyCache() acts as a mutex. Fixes: QTBUG-84692 Change-Id: I962d28cfd22696aad89a660e41c55f63a8791b44 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 90d24b807373f7b4c10d1a88ffdb5d4ebed08de8)
* qtdeclarative: Disable movingItemWithHoverHandler on macOSMaximilian Goldstein2020-06-091-0/+3
| | | | | | | | | | | | The cursor cannot be moved on macOS >= 10.14. Task-number: QTBUG-75786 Task-number: QTBUG-76312 Task-number: QTBUG-81884 Change-Id: Iec73d572d2ccc0a4be8cc6c2c0b445329a200609 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit f73dad1c991aa5adff14e42812da70db9ac52018) Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Blacklist tst_QQuickTextEdit::linkHover() on macOSFabian Kosmale2020-06-091-0/+5
| | | | | | | | | Task-number: QTBUG-75786 Task-number: QTBUG-82052 Change-Id: I2718ab6004ba7a278b1917a6164566d6e541fbdc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 5b203bc4647e8e9d8d3c1091ba791c9589243420) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Blacklist tst_QQuickTextInput::setInputMask() on macOsFabian Kosmale2020-06-091-0/+4
| | | | | | | | | Task-number: QTBUG-75786 Task-number: QTBUG-82058 Change-Id: Ida2a546044d4c85f3ec8037ff7e8f1fd2bd1f424 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit df075ee964fa41f95a0dd1f691c1547dc0b018dc) Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Avoid duplicate call to destroyFabian Kosmale2020-06-081-1/+1
| | | | | | | | | | | | | | Fixing the lifetime issue in emitDestruction led to a new issue: Setting linkedContext to nullptr before refCount has been incremented and invalidate has run can lead to calling destroy twice on the same pointer, and as a result to a use-after-free crash. Amends 0c8e51705ac0bb86c4b123ecd30a11b41fd50b24 Task-number: QTBUG-84095 Pick-to: 5.12.9 Change-Id: Ib2ce76a45977217d0fb0f0e3ce06b24858b90468 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix for possible crash in QSGDefaultLayer::grabValery Volgutov2020-06-082-0/+9
| | | | | | | | | | | | When QQuickItem::setParentItem set to NULL, derefWindow can be called. And for it item QSGNode will be destroyed. If this item used for QQuickEffectShaderSource we will have access to invalid QSGNode when "live" flag is enabled. Change-Id: If785e5328a044ec9d2564a82361470f1b8091fc5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 1c5de027d0c31d1d6697bd0557128d92207763d8)
* Make Binding restoreMode qmlWarning follow a logging categoryAlbert Astals Cid2020-06-081-2/+3
| | | | | | | | | | | | | | | | Binding{} emits a warning if restoreMode is not specified Unfortunately that syntax is only available in Qt >= 5.14. Projects need to support Qt 5.15 and also older (5.12), which means we have code constantly hitting this warning. We can't even #ifdef the QML code. By introducing a logging category we can still have the warning but provides some option for downstream to temporarily disable through an existing mechanism until older Qt is not supported. Change-Id: I47190b7216b776d9db6fbece63332e993fce7203 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Prevent premature child destructionFabian Kosmale2020-06-051-2/+3
| | | | | | | | | | | | | | | QQmlContextData::emitDestruction suffers from the fact that code can delete objects while emitDestruction is ongoing. Notably, the sequence child->emitDestruction can trigger a call to a->destruction (of one of child's attached components), which then can indirectly delete both child and child->nextChild (for instance, when a StackView gets cleared). We prevent this by using QQmlContextDataRef when iterating over the children, which keeps the child alive for the duration of the loop. Fixes: QTBUG-84095 Change-Id: I03a4e817904ba2735e1ffc15d509db95a1a4729e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQuickTextNodeEngine: prevent renderring transparent selection colorWang Chuan2020-06-053-2/+46
| | | | | | | | | | | It is not necessary to render selection color which is transparent. Fixes: QTBUG-83819 Change-Id: I45c086652e194192619aad025121e6064ab37a58 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit bf8b45e33af960c03c7dccf56e90e76eda1f510e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add drag.smoothed property to the listVenugopal Shivashankar2020-06-041-0/+1
| | | | | | | | | | | | Although this attached property was documented, it was not listed as one of the properties that can be used. Fixes: QTBUG-83753 Change-Id: Ia2a1130d825c9da792c39fac71ceeb0fba857157 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 331fca0bb06492c270116de24b528e6b80b39c97) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build issue in generating RegExpJitTables.h on WindowsKai Koehne2020-06-031-1/+1
| | | | | | | | | | | | | | | | Do make sure to use backslashes in the absolute path on Windows, otherwise nmake will silently ignore the command. This fixes a regression in Qt 5.15.0, introduced in commit 1c6a70e1880a8 . [ChangeLog][Building] Fixed build issue on Windows when using nmake (RegExpJitTables.h was not generated correctly). Fixes: QTBUG-84497 Change-Id: I5acd66b0efb8be13d96edd5e30b692c47ce20fc5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit de4ea4ebefa5e779a4878a1e9bb05cf3ead58a9e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Examples: Fix double installation of .qml filesKai Koehne2020-06-025-25/+5
| | | | | | | | | | | qt_example_installs.prf already generates install rules for all example sources, including content of .qrc files. Fixes: QTBUG-84301 Change-Id: I3454b19849af489c5819c51867781cc97f1eb285 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 1f0b3a54ffa2ab0dc0cdff1345980ea68d749d24) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove whitespace for file names generated from TARGETKai Koehne2020-06-021-3/+6
| | | | | | | | Task-number: QTBUG-84492 Change-Id: Ieeec677634fb6d2f43ba1aeb3432a60cd5502894 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit baff6585c0a3f3aeec4f076d04d5b300a08ca5f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix deprecation attribute in QSGAbstractRendererLaszlo Agocs2020-06-021-0/+2
| | | | | | | Do not warn when building Qt Quick itself. Change-Id: I33cf71506729bf545a6b4533fb0bb1135bf7188f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Rephrase Chunk::sortIntoBins() for more clarityUlf Hermann2020-06-021-4/+7
| | | | | | | | | | | | | | Assigning -1 to a quintptr so that it later overflows in another place when adding 1 warrants a comment. Also, assert against i overflowing the bitmaps. This way coverity might also understand what we are doing. Coverity-Id: 175402 Change-Id: I212110cbb784f89b1865bd0c0cc775c08cd40c04 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 1c928f65ab9c7a495f84943ba1264acb4dbca0b8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't return a pointer to a local in QObjectWrapper::getQmlProperty()Ulf Hermann2020-06-021-1/+1
| | | | | | | | | | | | | findProperty() can optionally create the property on the fly. We store the result on the stack. In that case we can figure out that the property exists, but we cannot return its value. This is OK, as we do the same in the default case below. Coverity-Id: 193545 Change-Id: I3a87fc6f577807e2daf74eeacd2aab61f40aefc8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7645c8e0f88a83d021f0a327617189b7772b14eb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Prettify QV4_SHOW_BYTECODE output for JS classesUlf Hermann2020-06-021-11/+12
| | | | | | | | | | | Drop all the double spaces, force a line break after each class, and avoid converting empty strings to utf8. Coverity-Id: 190711 Change-Id: I789291e257aeac97c2a931bfc604f453c39906eb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 512fde525ea5972bbae2796d6b2054fd370a5275) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix test to not depend on internal roundingAllan Sandfeld Jensen2020-05-291-1/+6
| | | | | | | Change-Id: I3c66cb52b435a891d88a5e1c9d1db155d63e2481 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7ac67ff82586cb9dd1afdf4c8030ace760b2a132) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix offset on native text rendering with high-dpi scalingEskil Abrahamsen Blomfeldt2020-05-291-3/+4
| | | | | | | | | | | | | | | | | | | | The glyph positions are scaled *after* they have been positioned, so when we subtracted the margin unmodified, we would actually offset by the scaled margin (so for scale factor=2 it would be 2 pixels off, and for scale factor=4 it would be 6 pixels off, etc.) We have to also prescale the margin by the inverse of the scale we will apply later. [ChangeLog][Text] Fixed an offset on text position when combining NativeRendering with high-dpi scaling. Task-number: QTBUG-84454 Change-Id: I703aeb7fbd717bee5d88cc61e9a56c6422558889 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 8a4dec618fc7e8176f1ba402a9e4d5ed342b1cf9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix a clipping bug in software-rendered textEskil Abrahamsen Blomfeldt2020-05-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | ac179e235ba0c01fff6dd5f4ad2cc9696fe78822 fixed a clipping issue with software rendering and text by using the actual bounding rect of the alpha map (which may be extended to allow for margins around the glyph). But it did not account for the margins on the top and left sides of the glyph, causing QTBUG-84042. By a coincidence, this issue was not reproducible with the DirectWrite engine in Qt 5.15 at the time because of 318a991907b6c08f52786160bafea1e30d3ad9bd in Qt Base, which baked the margins into the top and left positions of the returned bounding rect. But this is not what the other font engines are doing, and caused issues where the margin would be accounted for twice in the output. So 318a991907b6c08f52786160bafea1e30d3ad9bd was reverted. This change shifts the bounding rect by the margins (if any), avoiding clipping on the left and top sides. Task-number: QTBUG-80180 Fixes: QTBUG-84042 Change-Id: I942f05f0e8c8eb8c5b3071a73406e3e744b7d5a0 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 5ce2d540be875041b38b481e3caef295071c79ee) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Particles: reduce memory allocations by flattening a setGiuseppe D'Angelo2020-05-275-3/+151
| | | | | | | | | | | | | | | | | | | | When an affector acts on a particle, it will add it to a set of "seen" particles. This means an allocation, per particle, per frame. In Qt 6 the problem is less dramatic due to the new QHash implementation, which uses "wider" buckets, but in Qt 5 this is hundreds of memory allocations (and deallocations) per frame. Just reimplement a minimal flat-set API for this use case, and replace the QSet usages with it. On a testcase with 200 active particles, this reduces memory allocations from ~20'000 per second to 0 when the scene is "stable". Change-Id: I4be1e12a23b8dffca91955148532db243e383a4c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 27c0034d6bb0df50d4479e42fc82fcd74b03d810)
* Revert "Text: Fix kerning when horizontalAlignment is set to center"Eskil Abrahamsen Blomfeldt2020-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c8bba05dc54231dbc5dc859f125d64b640e25a41. The original commit was working around a kerning issue when text was subpixel positioned. Since anchor centering is already pixel aligned, it was regarded as an improvement regardless, but the main goal was to fix the kerning issue. But in an attempt at matching the anchor centering, we rounded the center of the text item and instead of the left edge (my request / mistake), and the result was that some cases were still broken and upon closer investigation, the positioning still did not match the anchors alignment exactly. The original kerning issue has now been fixed in e807f9d1d80559b8ff91f1c3cfdd755b3da56a6d, so this change is no longer needed. Since it also does not correctly match the alignment of the anchors, it does not have any additional purpose. Task-number: QTBUG-84021 Task-number: QTBUG-49646 Change-Id: Icf6d90c27b18a43d729007164f4e0058c51fb930 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit bb45fbe77d6547143434c7f5807475c40c913ae4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve performance when dynamically adding items to a layoutJan Arve Sæther2020-05-269-123/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was especially noticeable when a Repeater was populating the children of a layout, and its model was dynamically changed: When the model was changed, the repeater removed one item at a time until all items were removed, then applied the new model and then added all the new items for the new model. The layout reacted to that by doing a full sync of the QML layout into the internal gridlayout engine each time an item got removed or added. For very large layouts (or layouts that have complex size hints to calculate), this caused a major slowdown. This patch fixes that by postponing the sync until we get a updatePolish(), basically replacing most calls to updateLayoutItems() (which does the sync) with a call to invalidate() (which schedules a polish). It will also get rid of some binding loop warnings due to this change. This means that there is a small change in behavior: impicitWidth, implicitHeight and Layout.{min,max}imum{Width,Height} might in some cases be incorrect until the updatePolish() have been done. (This is however consistent with how Row/Column/Grid behaves) The creation test in qmlbench was quite simple, so it did not suffer from the most severe performance issues, but we did not regress: > compareresults: auto/creation/layouts/delegates_rowlayout.qml: improvement by 3.91% auto/creation/layouts/delegates_columnlayout.qml: improvement by 6.59% auto/creation/layouts/delegates_gridlayout.qml: improvement by 1.83% Overall average of differences: 4.11% And for the gridlayout_large.qml (Repeater with 1000 dynamically changing items): > compareresults: auto/layouts/gridlayout_large.qml: improvement by 66477.78% Overall average of differences: 66477.78% [ChangeLog][Qt Quick Layouts] Performance improvements to Qt Quick Layouts. This has the small side-effect that size hints (implicitWidth/implicithHeight etc) changes are not immediately emitted after a layout has been modified (e.g item added) Fixes: QTBUG-71839 Fixes: QTBUG-65121 Fixes: QTBUG-66017 Change-Id: I6922efe449134246df66b177992e4442747bc8fb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit cc77a0bc549ce8f0b218661e7ae0e82e5b89e0da) Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Increase the timeout for tst_qmlminJan Arve Sæther2020-05-261-0/+3
| | | | | | | | | | | | This test has been flaky during CI runs (on macOS) because sometimes it takes more time to execute than the default 5 minutes limit. Probably not the ideal fix, but since this will be deprecated for Qt 6 there is no point in investing too much time into fixing it. Task-number: QTBUG-84339 Change-Id: Iab53a05a68c32a1fae56cafdeeb6aa74900ac9fc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qmllint: Fix evaluation of type assertionsUlf Hermann2020-05-263-7/+9
| | | | | | | | | | Previously, type assertions were ignored. The test case didn't fail because simple type casts were automatically detected when the derived objects were instantiated and assigned to base type properties. Change-Id: I437e77ff38b7d570451cf27ca84e9897b519413f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 36ac9ab322d00ad8a2139bcf463275e3121bfb1f)
* PropertyCache: Fix resolution of forbidden QObject methodsUlf Hermann2020-05-263-1/+90
| | | | | | | | | | | Despite best intentions the code still hid methods of gadgets when those were derived from other gadgets. Fixes: QTBUG-84447 Change-Id: I787300b2a22d6557608772d218e73b9af6f79652 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 1029b2b9f3d0ff88c0900fbfec2fac873aa6bcd4) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Lancelot test for ShaderEffect atlas texturesPaul Olav Tvete2020-05-2513-0/+107
| | | | | | | | | Task-number: QTBUG-83975 Change-Id: Icfff2aa9172bf10a1918be5364f27ed6faf94575 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 5188167e633af743548be90db4fdcd2791dd9637) Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix Clang 10 warning about creating copies in range-forUlf Hermann2020-05-252-2/+2
| | | | | | | | | | We should not copy the loop variables. Fixes: QTBUG-83989 Change-Id: Ic94710a2c08aa19656c5e1853c40b10b203bca0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 95ece56efa0b2a3b480ee3a5761d85b348c01377) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix the pinchHandler manual testShawn Rutledge2020-05-221-2/+2
| | | | | | | | | | | | minimum/maximum X and Y were deprecated and replaced with separate axis objects in ea195452e80e4b5a70e8c8cdf96a30581a8dd456; this test should have been fixed then. Now that the deprecated properties were removed in 98d088d6e31c6c1bafea5674c9003d846b572680, this test didn't work. Change-Id: I05cc1f58651f0774b74fda48a4ab87be30f30894 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 277d6b16eca117918457d284586dfded41724496) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clarify argument types for QML's Qt.point, Qt.rect, and Qt.sizeSebastian Hartte2020-05-221-3/+3
| | | | | | | | | | The documentation incorrectly states that the method arguments are integers, but the methods actually use floating point arguments. Change-Id: Ib55d2a874c60c3960b88ce465b19b5d20be95662 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 2ad9d682bd64328fc341e0c28123976fbde8b792) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve polish loop detection and diagnosticsJan Arve Sæther2020-05-212-7/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing warning was pretty much useless since it would only warn after having looped INT_MAX times. In addition, it didn't actually detect if polish() was called from within updatePolish(). Instead, the counting is changed to be strictly more correct: The counter is now only increased when polish() is called within the updatePolish(). It will reset back to 1 if that does not occur. Effectively, the counter will reflect how many consecutive polish loops we have processed. This patch will show diagnostics after having reached 1000 consecutive polish loops. It will only warn for the next 5 items in order to not be too verbose...(most likely they will be the same 5 items). If the counter reaches 100,000, we break out of the loop: This might be important for e.g. CI runs so that the process can actually terminate in order to get some useful diagnostics. Note that the item that calls polish() within updatePolish() doesn't have to be the same item as updatePolish() was called on. We also want to track these since there might be several items working in tandem to create the loop. With this change it will now give the following output: main.qml:10:5: QML Row: possible QQuickItem::polish() loop main.qml:10:5: QML Row: Row called polish() inside updatePolish() of Row (This is when Row called polish() from within its own updatePolish()) Fixes: QTBUG-40220 Task-number: QTBUG-83856 Change-Id: Ib8a7242908082c70d8cf71efbbe1fa148dbfada0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 1c8bce285522e0dcfd13fe6c514f4756d6d6438c) Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix handling of QQuickViewPrivate::rootUlf Hermann2020-05-212-23/+33
| | | | | | | | | | | | | | | | | | QQuickView is supposed to own the root item and shall also track it for external deletion. Therefore, when we assign a new root item we need to delete the old one. There is no point in setting a QPointer to nullptr after deleting it. It will do that by itself. When we fail to assign a new item, we should _not_ automatically delete the new one. Calling code typically does not expect the argument to a set* call to be deleted right away. Rather, return a boolean indicating whether we have successfully set the root object. This can then be used to get rid of the object if necessary. Coverity-Id: 218729 Change-Id: I79ed37d22d304bcc6d4e3c956b83a65fe157dfe0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit a64ee3a2481499f856d0f3fbc697399e0df1e8f8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Model WorkerScript as an engine extensionUlf Hermann2020-05-201-47/+58
| | | | | | | | | | | | This is a much better fit conceptually, and it avoids inheriting from ExecutionEngine. Coverity-Id: 218787 Change-Id: I3c1f1249e5267a180c46269829d9f0aa910ecdd0 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0badccfc066fb95fc77b31d2678687bbeaf3a54a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickPathView: Use setPosition() to update item positionAlexandr Akulich2020-05-201-2/+1
| | | | | | | | Sequential call of setX() and setY() results in outdated y value on xChanged() signal. Use setPosition() to set x and y at once. Change-Id: I4054c2347f83d3eba4ead979c75f8dff8c3c19ea Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Revert "QQmlPreview: remove the ignore of :/qgradient/"Giuseppe D'Angelo2020-05-202-0/+2
| | | | | | | | | | The corresponding commit in qtbase has been reverted. This reverts commit 1989323559a7bc08a469f9708c644dcad1f57600. Task-number: QTBUG-84069 Change-Id: Ie042a34ea41baf538c922ed9c7280907475f759a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fuzzing: Add fuzz target for QQmlComponent::create()Robert Loehning2020-05-202-0/+62
| | | | | | | | Task-number: QTBUG-71580 Change-Id: I160a0c73bbd3ee593228c95f2d6315c4964fdca0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b780deba1b4fc0ad0a4269d40b9a65e9488a70db) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix Clang 10 warning about converting ULLONG_MAX to doubleThiago Macieira2020-05-201-1/+1
| | | | | | | | | | | | | | The compiler must convert ULLONG_MAX to double before adding 1, so this expression was wrong. MathExtras.h:402:43: error: implicit conversion from 'unsigned long long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion] Task-number: QTBUG-83666 Change-Id: I99ab0f318b1c43b89888fffd160b4a95a258423b Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 1250d8b5b95eecac767a23563717e53faa5d3b8a) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QQmlPropertyData: Fix isDirect flag handlingFabian Kosmale2020-05-201-1/+2
| | | | | | | | | | | | | | | During the QQmlPropertyData::Flags refactoring, this accidentally broke. Amends 9768792381d660e46db58c0c0e0fe9f2f6f9e836 # Conflicts: # src/qml/qml/qqmlpropertydata_p.h Coverity-Id: 265549 Change-Id: I433701e2a1926dbd7afc4a826d78ba28f6894e60 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 150cd0570d28291d6727c6e42ab83b746ac2e578) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Respect margins when sizing flickable content itemNicolas Fella2020-05-201-4/+4
| | | | | | | | | | | | | | | When setting the width/height of the content item we need to take the margins into account. Otherwise for example a left margin of 10 causes the content item to exceed the parent by 10 pixels to the right. This causes, amongst possibly other issues, misaligned headers/footers. Change-Id: Ib620bb3be4a4f620b61f14564beb92ceb10ab02f Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Marco Martin <mart@kde.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit a071befa4f96e2df51d9a98b0f3d2700d791e7a5)
* TableView: during layout, set item width before heightRichard Moe Gustavsen2020-05-201-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. Task-number: QTBUG-84046 Change-Id: I1893187027b45649568347ffc3ed5d4d84beaa95 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit e1b63ac3e9a1c3920dd00a862d3f12fd278124e0) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* TableView: allow negative spacingRichard Moe Gustavsen2020-05-202-6/+13
| | | | | | | | | | | | 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 Change-Id: I3be9d58ac8c43142e26e75165274e41872e878f4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit adfff7ec77223dfdd8c29327dc0f0181972516ef) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add lancelot test for ShaderEffect on layerPaul Olav Tvete2020-05-196-0/+47
| | | | | | | Task-number: QTBUG-83975 Change-Id: I40e3836205c62f52a80925384070175a7bcb5856 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit bd221dfcb3126140071ceeb8f337cdacbe05a62e)
* Lancelot tests for ShaderEffect uniform bindingsPaul Olav Tvete2020-05-197-0/+74
| | | | | | | | | | | Test that properties are bound to shader uniforms. Three ways of setting the property: initial value, PropertyAnimation, and UniformAnimator. Task-number: QTBUG-83975 Change-Id: I61518dc1bf680d0d28dd0171c5dcf8b4a6b3695e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 1907265de25d3815cba24885c01fe4072b570e46)