aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-241306-26870/+26870
| | | | | | | | | | | This reverts commit 7b1331c789df0ac12d7cf5aa5f8967b8651a4cfa. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I47eb004523bdb3beb16e9fd51e40da6f738f9f34 Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
* QQuickWindowIncubationController: Use QPointer to guard QSGRenderLoop referenceMike Achtelik2021-02-111-3/+3
| | | | | | | | | | | | | | In some cases, when the QGuiApplication is shutting down while there is an active QAnimationDriver and an incubating object, the QQuickWindowIncubationController will try to access an already destroyed QSGRenderLoop. So use a QPointer to guard the QSGRenderLoop access. Fixes: QTBUG-90489 Change-Id: I528e06ff22dfcad804593db6771d9163b21808f4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit bac93541ba324e75c532c1987e861109e1c5b131) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QV4 Engine: Remove MSVC special casingFabian Kosmale2021-02-103-18/+2
| | | | | | | | | | | | This patch removes a workaround for old versions of MSVC; we should be able to rely on the standard library nowadays. Original-patch-by: Alexander Neumann Fixes: QTBUG-89203 Change-Id: I8047565000fc7e4e3b8ac28584ff4a479b648274 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit fb4de27768935393744cbd67e9789d325e70e742) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuickTextEdit: ensure we update after changing paddingRichard Moe Gustavsen2021-02-091-0/+4
| | | | | | | | | | | | | | | As it stood we would never updated the paint node upon changes to padding. The result was that if you changed padding after start-up, you would not see any visual changes. This patch will ensure that we update the paint node when we change padding. Change-Id: I2e9ed4406e8f01c26d1fa2ef09fe35a50f28411c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit eb08da3249fcbffe845e209ea48ba38484783d29) Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix crash during model resetJoni Poikelin2021-02-091-0/+5
| | | | | | | | | | Commit 37fcffa035d55ac00f85f57ce1390fff3be213c6 fixed the issue for remove rows, but it can also happen with model reset. Fixes: QTBUG-83352 Change-Id: I0ec1a67e822e4f8fe5b8f87f38dfae1f26b3fab5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d99d192884608408759492bd656ab99a2f4f23ed)
* QQuickItemParticle give() method kill particleFabio Falsini2021-02-061-0/+1
| | | | | | | | | | | | | | | Currently removing an item connected to a particle only invalidate the particle that will be reused for the next item set. This has the effect that the new item inserted appears in the same position as the old one just removed. This patch force killing the particle to assign next item to a new particle starting from initial position. Change-Id: Ic937a6d7aea65368cceb1405bb81ef1502d988a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d0b1bef8b889ab852eaf906fdc9cd4219238872e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSequentialAnimationGroupJob: Protect against self-deletionUlf Hermann2021-02-052-9/+9
| | | | | | | | | | | | setCurrentAnimation() can indirectly delete the animation group job itself by invoking the animation controller. Use the RETURN_IF_DELETED mechanism to avoid the resulting dangling pointers. Task-number: QTBUG-90401 Change-Id: Ibd0ad21e8d3af4760604c3ff37dc46101d5f49ad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 680f28b08f65ad38c8d5498b5738231b2a2779a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Change QQuickShortcut::setSequences to bind to all sequencesAndreas Buhr2021-02-041-23/+60
| | | | | | | | | | | | | | | When binding a Shortcut to a standard key sequence like QKeySequence::FullScreen, it binds only to one key sequence, even though there might be multiple key sequences associated. This patch changes the code to emit a warning in this case and allows to bind to multiple key sequences using 'sequences: [ <key> ]'. Fixes: QTBUG-88682 Change-Id: I88998aa8858d8f2c0c86e46bae94afd7ceb15b66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6511b17038627ac30cb6622b13c7d46d9877bac5)
* qquicktextinput: ensure we update IM when cursor changes positionRichard Moe Gustavsen2021-02-041-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normally the cursor will change position inside a text input after receiving a touch or a keypress event. But it can also change position by sending it a QInputMethodEvent. But as it stood, we would in that case not inform the platform input context about it, which meant that the IM state in QQuickTextInput would be different from the IM state in QPA. A bug on iOS could be seen from this when dragging the cursor around using the magnifier glass. In that case QIOSTextResponder would move the cursor in QQuickTextInput using QInputMethodEvents. But since this would not be forwarded back to UITextInput, the result would be that if you e.g pushed backspace on the input panel, you would delete the character at the position the cursor had before the drag. This patch will ensure that we update platform IM state whenever the cursor changes position from QInputMethodEvents. Fixes: QTBUG-72757 Change-Id: Ic39c60fbce982f80d014befddbb2d4439ddeea4f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 04c0615352e947a23bcd52a0da4f901b3decdb87) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlIRLoader: Actually load RequiredPropertyExtraDataFabian Kosmale2021-02-031-0/+7
| | | | | | | | | | | | | | | | If a QML component wants to mark properties of its "parent" component as required, it can do so via required propertyName The information about those properties is stored in a RequiredPropertyExtraData data structure. This structure is already serialized to disk in the QQmlIRWriter. However, we neglected to restore it so far in the loader. Fixes: QTBUG-90538 Change-Id: I789daff9bc881e4f35c942c77f5116b5284de81b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b322a971f06823a4356f2b3aa331501aa4d0dc7f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix broken QDoc markupPaul Wicking2021-02-031-2/+2
| | | | | | | | | | \code must be closed with \endcode. Fixes: QTBUG-89738 Change-Id: I0cadb14b6726a6fdc6c3fb773155066d30490e74 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 357e426d9849a048d3063030f2a1355f22c259e0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update commercial license headersTarja Sundqvist2021-02-021306-26870/+26870
| | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qtdeclarative. Examples, documentation files or tests are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4161 Change-Id: Ic1d011aa01b1fe7242bcbbf72d5ab454d1015cf9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlProperty: Guard QQmlContextData with QQmlGuardedContextDataJan Arve Sæther2021-02-021-1/+1
| | | | | | | | | | | | | | Some animation classes store the property to animate in a QQmlProperty. In some cases (e.g. ListView delegates), the item that is animated (and therefore the context) might get destroyed while the animation is running. And since the QQmlContextData in QQmlProperty was not guarded, it could sometimes cause a access violation crash as the task demonstrates. Fixes: QTBUG-86567 Change-Id: I2c8c4f0dca8029887702adeae542eadc47451f60 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* ListModel: Fix move handling in syncFabian Kosmale2021-02-021-3/+24
| | | | | | | | | | | | | | | | | When a ListModel is modified in a workerscript, we reconciliate the state in ListModel::sync. However, the logic for moving elements was wrong, causing crashes in endMoveRows due to invalid moves. This patch ensures that elements are moved to the correct position. Notably, whenever an element is moved, we must update the targetIndex of all elements affected by that move. Amends 3accc1dae76575120e71cadb547e961ecd50bcb0. Task-number: QTBUG-85557 Change-Id: I1a1ffa43eab39ed2315f1916527d897b208c2c3b Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 2996439993c587bc9c7169e4f152169f28247c21) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QuickLayouts: fix crash when layout width depends on parent widthIvan Solovev2021-01-221-2/+2
| | | | | | | | | | | | | | | | | | Some tricky cases of setting layout width based on parent layout width were leading to infinite recursive loop of layout size calculation (see the attached example in the related Jira task). Initially the QQuickGridLayoutBase::rearrange() method already had a recurse check, but it seemed to happen too late, so that the recursive calls kept happening from the ensureLayoutItemsUpdated() calls. This commit moves the recursion check up, so that it's actually executed before we have a chance to get to the next level of recursion. Fixes: QTBUG-87253 Change-Id: I473ee219e7b5b13547e33ebbd3a6d884de2c7d45 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 4f8041b01445fd4eec0beb133719645d00d0b2ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* export QAcccessibleQuickItemJan Arve Sæther2021-01-221-1/+2
| | | | | | | | | | | | This is needed in order to make controls in qtquickcontrols2 module more accessible. Their accessibility implementation can now inherit from QAcccessibleQuickItem Task-number: QTBUG-75042 Change-Id: I30deba018825937a4ebd757e5250efca87519822 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 21b975f186e6cec81914b6ee9a6aae5b847069d1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QAnimationGroupJob: Don't call virtual functions from dtorUlf Hermann2021-01-222-23/+42
| | | | | | | | | | | | | The subclasses are already dead at that point. We don't need to notify them anymore. Rather, refactor the code so that we can clean up QAnimationGroupJob itself without virtual calls. Task-number: QTBUG-90401 Change-Id: I6917bf299ceb1383b9d29687e5bf53ae36803ecf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 75437f824d4c3a608af9eb1afddcb4d8c1a25944) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QQuickShortcut::setContext so re-grab all shortcutsAndreas Buhr2021-01-221-0/+7
| | | | | | | | | | | | | A while ago, QQuickShortcut was extended to not only have a shortcut m_shortcut but in addition a list m_shortcuts. During this extension, the setContext method was missed: Shortcuts in m_shortcuts are not re-grabbed on context change. This patch fixes this. Task-number: QTBUG-88682 Change-Id: Ie73d516f2a325a328b6e975d69490eea29a18401 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 28f515e6334fd1c15a2f7f18de6be7bfe1f9c302) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Set the stencil buffer zone" and "Add clipNext null pointer guard"Laszlo Agocs2021-01-191-35/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 576d3fc2c84f324c035aa924c386f0615002fa16. This reverts commit 6382ec9a6c961f2b7d7139659c11a047f6b68b07. The original patch is broken in multiple ways: - Any at least two level deep clip where rotation is involved results in a failing assertion (triggers in debug builds only). - The assertion looks legit: using calculations meant only for 90, 180, 270 degree rootations for arbitrary rotations seems wrong. Taking frame captures with RenderDoc show that the generated scissor rectangle that is set before the glClear for the stencil buffer is _not_ correct, i.e. it does not correctly cover all the area that will be touched in the stencil buffer in the following draw call. - The logic for accessing the clip list is dubious. Hence a suspicion that the patch is not correct when it comes to the handling of the clip list: It is not clear why accessing clip->clipList()->matrix() is correct when the clip list is more than 2 levels deep. At the same time a single clipping item will not trigger the assertion because it does not set the scissor before the clear at all (which is contrary to what the patch is aiming to achieve). The original patch has a follow-up crash fix that is incorrect in its own right: it adds a null check for clipNext (i.e. the clip->clipList() mentioned above), while including code in the true branch that should execute regardless. Fixes: QTBUG-89898 Task-number: QTBUG-83108 Change-Id: Ic28bd8670a7663fd6232aaf5739b05fd16d2da24 Reviewed-by: Dominik Holland <dominik.holland@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Do not revert properties of deleted objectsAlexey Edelev2021-01-141-0/+5
| | | | | | | | | | | If state contains revert action of properties of deleted objects, we should avoid adding them to apply list Fixes: QTBUG-85106 Change-Id: Iff57eb9958a054476096f6d951ab7390277a2b39 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 96763dbb105fde20431a264789ac27abfdab841c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix Text with ElideRight not being rendered when width goes from 0 to >0Fabian Kosmale2021-01-141-1/+4
| | | | | | | | | | | | | | | | | | | QQuickText attempts to reduce relayouting. However, it was a bit to aggressive in doing that. If only the width changed in a geometrychange, it would not relayout if widthMaximum was true. However, if the width goes from 0 to greater than 0, the value of widthMaximum should have actually been false (but we would only notice this after relayouting). Thus, don't skip relayouting in that case. Amends 56ade46b4234bb828b8e4f9a6bf83b5687bd122e, which fixed the same issue, but for height. Fixes: QTBUG-83408 Fixes: QTBUG-33608 Change-Id: I14b610c703eb0496c71de7b12ad9fcf16842af64 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 127c79fb7fda16b9a48ce8c425d1700d1aa7502d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Cache static compilation unitsUlf Hermann2021-01-143-12/+61
| | | | | | | | | | | | If we load the same file multiple times, we can re-use the old mapping. In fact we may leak memory if we don't. The fact that we have to use a mutex here is somewhat regrettable, but I haven't found a better way of serializing access. Task-number: QTBUG-89659 Change-Id: Iaa44ac80faa5e95f30c05e950ab35083a8b0416b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7660c30e08975011c7bd47bcb1796139b9d77196)
* Regenerate Shape fill geometry when alpha changes to non-zeroLaszlo Agocs2021-01-131-0/+4
| | | | | | | | | | | An alpha of 0 removes the scenegraph node for the fill. If the alpha changes to non-zero afterwards, the geometry needs to be regenerated. Fixes: QTBUG-85103 Change-Id: I180b9eb78bd98b99bc87c4d960108b95eb6ae723 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit a129c02e7b0d9977eafa66dc191ef185774f461e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove QQmlCleanup from QQmlScriptDataUlf Hermann2021-01-132-25/+1
| | | | | | | | | | | | | | It prevents the compilation unit held by QQmlScriptData from being released on clearComponentCache(). The comment justifying the QQmlCleanup has been wrong since we moved away from V8. Task-number: QTBUG-89659 Change-Id: I220561d90f707540e47c76d60a51468ee231ce9a Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 8dbe5b2be4e65e96013651f1ffee1cc26dd1ead1) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* masm: Add error handling for failed mprotect()Ulf Hermann2021-01-1212-205/+29
| | | | | | | | | | | | | If we cannot mprotect() we have to abort the JIT compilation. Delete RepatchBuffer.h as it is unfixable in that regard. Luckily we don't use it. Task-number: QTBUG-89659 Change-Id: Ic5ddbdf51b471db4ddeaa75aab48b24c1f7ced56 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 131e2c81d40e3d324c62e113749a08e7993d008f) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuickLoader: prevent clearing initial properties after active = trueWang Chuan2021-01-111-1/+0
| | | | | | | | | | | | After commit b6d88c73, we implement the method [disposeInitialPropertyValues] and clear the cache of initial properties actually. Since we also call this method after source loaded, it will cause loss of initial properties after active = true. (cherry-picked from commit a135f3d6c3202b37eda0f1e94292f795f9e575ca) Fixes: QTBUG-83895 Change-Id: Iaa500fff14dcaad79a9e68dcbac9f65fa8720456 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Doc: mention that Item's childrenRect property is local to the itemMitch Curtis2021-01-052-0/+76
| | | | | | | | | As opposed to being local to the item's parent. Change-Id: Idcf2cdbedcac24a6890ce761c3f2a23f2c7a8dc4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit a0769549cdb81c7104b60c2a67dfa62e8c42c224) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: explain QQItem event delivery, handlers, setAcceptTouchEvents()Shawn Rutledge2021-01-041-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | We quietly recommended calling setAcceptTouchEvents() in the Qt 5.10 release notes in any Item subclass that wants to receive touch events, and in the docs for setAcceptTouchEvents() itself; but the message about the impending behavior change might not have been obvious enough. In Qt 6 it becomes mandatory, so clearer docs will hopefully help to stave off bogus bug reports. We also never had a great overview of event handling from an Item's perspective; now it's a little better. Followup to ab91e7fa02a562d80fd0747f28a60e00c3b45a01 and a97759a336c597327cb82eebc9f45c793aec32c9 [ChangeLog][QtQuick][QQuickItem] When subclassing QQuickItem, you should call setAcceptTouchEvents(true) if you need the item to receive touch events. It will be required in Qt 6. Task-number: QTBUG-87018 Task-number: QTBUG-87082 Change-Id: I1c7a43979e3665778d61949c9d37c1d085ed594b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7c648280bb53c4276ba4ae2abf26d070fedde71a) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* JIT: When making memory writable, include the exception handlerUlf Hermann2020-12-267-18/+40
| | | | | | | | | | | | | makeWritable() rounds the memory down to the next page boundary. Usually we include the exception handler this way, unless the offset from the page boundary is less than the exception handler size. Make it explicit that we do want the exception handler to be writable, too. Fixes: QTBUG-89513 Change-Id: I2fb8fb0e1dcc3450b036924463dc1b40d2020c46 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 86a595b126bc6794380dc00af80ec4802f7d058c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix IC properties in same fileFabian Kosmale2020-12-244-3/+37
| | | | | | | | | | | Also fixes typename and metatype registration for inline components. Done-with: Fabian Kosmale <fabian.kosmale@qt.io> Fixes: QTBUG-89173 Change-Id: I97d65d5539b577a8828d5711e5f2e79c8568b441 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit c2ca14ce22551ea72544b6e2b3a19823b6dc3050)
* QML: Fix proxy iterationFabian Kosmale2020-12-231-2/+6
| | | | | | | | | | | If the target of a proxy was extensible, we did not set the iteratorTarget to its correct value, and thus the ForInIteratorObject would not be usable. Fixes: QTBUG-86323 Change-Id: Id1924ac4087bab38c006b8eba92b619b79d36b7a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit dd740d6b3469448dc1fd31c1742781e923e9f274)
* DesignerSupport: Don't skip already inspected objectsMiikka Heikkinen2020-12-211-11/+4
| | | | | | | | | | | | | | | | Already inspected objects should not be skipped when determining their properties, as recursive call will always have different base name for the properties. Internally we don't need inspectedObjects list at all anymore, but it's kept to avoid changing API and in case the caller is interested in inspected objects. Fixes: QDS-3301 Change-Id: I76198b96d420e2a5ae6b13cfee65df4bce22d8f5 Pick-to: dev Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Show a tableview even if the syncView has an empty modelAndy Shaw2020-12-091-5/+2
| | | | | | | | | | | By showing the tableview, we can be sure that headerviews will be visible even in the syncView has an empty model. Fixes: QTBUG-87526 Change-Id: I68c8b119122a2d2f88c2afbeb2d6c71a83a3ce33 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 27c254203b3e7dd6d3a4445feb205fbe98c32d30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmlistmodel: Fix crash when modelCache is nullMaximilian Goldstein2020-12-081-1/+1
| | | | | | | | Fixes: QTBUG-89173 Change-Id: Ife82518808fc5504ec42407e80ed3de89ed4adeb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c3860cd04bbc089ef95bc441a1f8f1e46f9606f8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qv4qmlcontext: Fix bounded signal expressions when debuggingMaximilian Goldstein2020-12-041-2/+2
| | | | | | | | Fixes: QTBUG-83599 Change-Id: I8909f0b2d3eca909512b99c172c8dc5e93e48482 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit bad85119bf35468292cfd80ecc934b66515f0c68) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmltypes.prf: Take abi into account for *_metatypes.json file namesAlessandro Portale2020-11-271-1/+2
| | | | | | | | | | | | The lib/metatypes/*_metatypes.json file names contain the ABI. When constructing the qmltyperegistrar command, the right file names with that ABI part need to be passed as "foreign-types". Fixes: QTBUG-85888 Fixes: QTBUG-87117 Change-Id: I20daac1b6b9a27c5ac48b3c2c685e2fed301e213 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit acc5e48a90d0daeccb28175b80ab6b52cac5d84a)
* Accessibility event is sent on item's geometry changePiotr Mikolajczyk2020-11-261-0/+8
| | | | | | | | | | | | | In case of enabled accessibility, whenever the geometry of a QQuickItem changes, accessibility module is notified by a LocationChange event. This enables responding to this by for example moving the accessibility frame on the screen. Task-number: QTBUG-79611 Change-Id: I808e835384ef42bba2e9aabecf4be3cda07859fe Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit def81070668f101e1e2cbb46d586bbab64c8e00f) Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix crash when calling hasOwnProperty() on proxy objectRichard Weickelt2020-11-251-4/+6
| | | | | | | | | | | | Property pointer p needs to be checked for nullptr value in QV4::ProxyObject::virtualGetOwnProperty(). This can happen when calling hasOwnProperty() or propertyIsEnumerable(). Fixes: QTBUG-88786 Change-Id: I43da58fed4d8656f9187213f7317f17398739e34 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 9b321a34490cd17c0eb043b69bd7c9d8d8f513d5) Reviewed-by: Richard Weickelt <richard@weickelt.de>
* QQuickTextInput: Store mask data in std::unique_ptrFabian Kosmale2020-11-242-5/+5
| | | | | | | | | | This ensures that the memory is freed reliably Fixes: QTBUG-88807 Change-Id: I841a5a2b226a69ce50975d95702a948857d1b54f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit d2d8e90e9f218103d60737e1273ab5322834d9ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QML property cache leaks of delegate itemsAndrei Golubev2020-11-241-1/+10
| | | | | | | | | | | | | | | | | | | | | The delegate items are destroyed through an event loop by a call to a deleteLater(). This, however, doesn't work when the application is in the process of exiting and the event loop is already closed (i.e. we're in a stack unwinding part that starts after app.exec()) Combat this situation by setting a parent of the to-be-deleted object to some QObject that will be destroyed e.g. QCoreApplication::instance() before the program finishes. As QObjects clean their children on destruction, this will make sure that we cleanup the previously leaking thing regardless of the event loop Added a test to check that delegates are destroyed (as a separate binary due to differences in main() function) Fixes: QTBUG-87228 Change-Id: I59066603b77497fe4fd8d051798c3e4b47c119f0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 3a5617dc45e281552b9c1f7a04f0561b8fa14d94)
* qmlfunctions.qdoc: Add clarification to QML_FOREIGNMaximilian Goldstein2020-11-231-0/+4
| | | | | | | Fixes: QTBUG-87150 Change-Id: If99a06a07892bdfef7b6b1e8fa737480750992fe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 56f428c360191230b571969a2651e85380030afa)
* Doc: mention that INCLUDEPATH must be set in some casesMitch Curtis2020-11-201-0/+8
| | | | | | | | | | Otherwise the generated type registrations .cpp file will not be able to include the sources. Change-Id: I7821c7674b4341546da2fc49e584bf10cc60b46f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 06c31f386f8664343debd219a522a8897df0f3ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML Text doesn't reset lineCount when text is emptyShinichi Okada2020-11-201-0/+2
| | | | | | | | | | | | lineCount is not reset when replacing a multi-line QML Text 'text' property with an "" empty string. Also, the lineCountChanged signal is not emitted Task-number: QTBUG-84458 Change-Id: Ic3c02e6a90e6675eadbaafc6af6ab0356ee98123 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ae1b9c6d94001411efeef600e22638906e0fa990) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid GHS linker to optimize away QML type registrationsKimmo Ollila2020-11-1818-0/+26
| | | | | | | | | | GHS linker optimizes away QML type registrations despite volatile. To prevent this we add #pragma ghs reference(s) to avoid such linker optimization. Fixes: QTBUG-88033 Change-Id: I7c8983506360710185c37028873234b1464847d5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQuickWindow: Check if QQuickItem was not deletedBartlomiej Moskal2020-11-161-0/+8
| | | | | | | | | | | | | | | Added check into deliverMatchingPointsToItem method for Android device. In QT_VERSION below 6.0.0 touchEnabled for QtQuickItems is set by default to true It causes delivering touch events to Items which are not interested In some cases it may cause a crash. For example using Material Style in Android. QQuickShaderEffectSource may be deleted and then try to handle touch Fixes: QTBUG-85379 Change-Id: Ia2c4e016db57ef9c86fcc31d4cfba6154068a546 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit a14e4fcdf94d26774490b26a4ef77981594f583f) Reviewed-by: Bartlomiej Moskal <bartlomiej.moskal@siili.com>
* QQuickView docs: show correct usage of setInitialPropertiesFabian Kosmale2020-11-122-0/+13
| | | | | | | Change-Id: If63f4c59f18bc0754ce2e68e424f6efd0f512d30 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 54d4f8f526f9c9a1af702b14925e1d34ee8b2134) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "qquickloader: Free memory of loaded components after source change"Maximilian Goldstein2020-10-301-13/+0
| | | | | | | | | | | This reverts commit c5085eb8905f1a3c070f866746110980e84be271. It can cause crashes and only fixes an edge case that can't be encountered during normal usage. Change-Id: Ia265f0d6716b59a0f483e5a114b3f3b1a76fe898 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0fa6091b1076bc3cc58303ff00d43efdad32b8ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Inline components: Fix custom parser supportFabian Kosmale2020-10-281-0/+6
| | | | | | | | | | Fixes: QTBUG-85713 Fixes: QTBUG-87464 Change-Id: I5c190ad2d02190de90260042cc06e51c1da01c63 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 2425cd478138c52694aaa20b7f7eb4a91d97b51c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* TableView: ensure we rebuild the sync view, even when flicking on a sync ↵Richard Moe Gustavsen2020-10-262-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | view child When two table views are connect through the syncView property, both views will flick when you flick on either of them. This also means that if you fast-flick more than a page on the sync view child, the sync view needs to rebuild, like if you did the fast-flick directly on the sync view. Because we updated the sync view's viewportRect too soon while fast-flicking on the the sync child, we didn't detect that it was a fast-flick, and that a rebuild was needed. The result is that you could sometimes end up with the views getting out-of-sync. This patch will allow TableView to only move the viewport without updating the internal viewportRect while flicking. The viewportRect will instead be sync-ed at a later point, like we do when you flick on the sync view directly. This will ensure that we rebuild if needed, also while fast-flicking on the child view. Task-number: QTBUG-87821 Change-Id: Ifc74473eb43406acaa8e24880066fb4ca89d3a4e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit b5501e9043cabcbf74d3d53b424ece5deb706a27)
* TableView: ensure we update content size upon model changesRichard Moe Gustavsen2020-10-222-30/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For tables of non-trivial sizes, we usually don't know what the content size will be unless we load all rows and columns, which we simply cannot do. Because of this, we have up till now chosen a strategy where we normally just calculate a predicted content size up-front, when we table is built, and afterwards just stick to that prediction. This strategy works for big tables that fills more than one size of the viewport, and if the number of rows and column in the model stays around the same. But for tables that start off smaller than the viewport, and later expands to grow out of it, it simply fails. And the failure is such that the tableview can get stuck, with no way way for the user to flick around to see the rest of the contents. An example is TreeView that might only show the root node at start-up, but as you start to expand the tree, it will quickly add more rows than what fits inside the viewport. And in that case, the contentHeight will be totally off, and in turn, make the scrollbar be based on wrong values, and sometimes not work at all (e.g if it has the flag Flickable::StopAtBounds). This patch will change the implementation so that we recalculate the content size whenever it should logially change. That is, if e.g the model add or remove rows and columns, or if you change spacing. This still doesn't mean that contentWidth/Height reports the correct size of the table, but at least it will be a better guestimate for smaller tables, and at the same time, work together with Flickable and ScrollBars. Fixes: QTBUG-87680 Change-Id: Ie2d2e7c1f1519dc7a5d5269a6d25e34cf441b3fe Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit dac2c8aec4917742aed6e311cf542dc37da60809)