aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-24169-3465/+3465
| | | | | | | | | | | 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>
* 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>
* 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>
* Update commercial license headersTarja Sundqvist2021-02-02169-3465/+3465
| | | | | | | | | | | | | | | 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>
* 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>
* 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-051-0/+8
| | | | | | | | | 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>
* 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>
* 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>
* 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>
* 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>
* 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-121-0/+4
| | | | | | | 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>
* 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)
* qquickloader: Free memory of loaded components after source changeFabian Kosmale2020-10-211-0/+13
| | | | | | | | | | | | | | Since we cannot be sure when the event loop that would usually handle deferred deletions will run the next time we have to delete these components immediately otherwise we might run out of memory. Fixes: QTBUG-86676 Done-with: Maximilian Goldstein <max.goldstein@qt.io> Change-Id: I01d74f7eea442f8ba240dd66a4cedd6316fbeec2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit c5085eb8905f1a3c070f866746110980e84be271) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: mention that clipping can affect performance and link to pageMitch Curtis2020-10-191-0/+3
| | | | | | | Change-Id: I85e60dd5c8643a8e443a14250987b2b38c78dc08 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit c1c01e21d1a745eccb17d61e10d7f8a4d54d3a43) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickShaderEffect: fix crash when hiding parentMitch Curtis2020-10-191-1/+5
| | | | | | | | | | | | | It's possible for itemChange to be called during destruction when deleting the QQuickShaderEffectImpl. We nullify m_impl before deleting it via another pointer to it, so we must check that it's not null before trying to use it. Fixes: QTBUG-86402 Change-Id: If4955445f7cc0d1f376bc9b86b95e1cca4d88ede Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 266cd7638d887b31d56964a0f13fe208821703b1) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuickTextEdit: ensure we update document width when padding has changedRichard Moe Gustavsen2020-10-081-2/+3
| | | | | | | | | | | | | | | | We use an if-test to check if the document width has changed before we set the new value. The problem is that the value we test against is different than the value we set. The result is that we can sometimes skip setting a new width on the document, even if padding has changed. This patch ensures that we use the same width for both testing and setting. Change-Id: Ia8391999e8cc2b5be72fe525d396bf8c17ba0fa2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 40993321cd67c1fe722977ed94c91cedff4bb1f8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickListView: prevent mouse delivery in floating header or footerShawn Rutledge2020-10-074-16/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | Earlier we reimplemented the contains() method of ListView to prevent dragging in an Overlay or Pullback header or footer. But in QQuickWindow (QQuickWindowPrivate::pointerTargets()), an early check prevents delivery of pointer events to an item that is clipped and for which contains() returns false, and also to its children. In that case, the header or footer no longer responds to a mouse event even if you put a MouseArea in it. Reverts 6ad3445f1e159d9beea936b66d267dcaacdc5d6c; reimplemented using similar logic in a new QQuickListViewPrivate::wantsPointerEvent() method, overriding QQuickFlickablePrivate::wantsPointerEvent(), which is now checked in event-handling code in addition to checking the interactive flag. Done-with: Wang Chuan <ouchuanm@outlook.com> Task-number: QTBUG-74046 Fixes: QTBUG-85302 Change-Id: I9474f035d26b74ee36c0ac19e45a77de2e694bf1 Reviewed-by: Wang Chuan <ouchuanm@outlook.com> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 6857ad3e686a5e2b45d28a7f47dca3210608da50) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickDrag: Do not crash when changing supportedActionsFabian Kosmale2020-09-231-0/+2
| | | | | | | | Fixes: QTBUG-82157 Change-Id: I9d694dd543f41b1ce2b6976983d03a3dc659245d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit dbb0d83779d09dca35f5ad6ee68a19f4e93eec1d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* webOS: Allow to have activeFocus for each windowElvis Lee2020-09-141-1/+25
| | | | | | | | | | | | This makes multiple windows focused if there is a single window per screen assuming that windows across screens don't compete the keyboard focus. Task-number: QTBUG-83361 Change-Id: Id6f6fd0c95747b03d56c5e535f1313c27d67ab24 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit a2c5f5abff3cafc5769588b573bb04cf950a0450) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Capitalize "GUI" correctlySze Howe Koh2020-08-312-6/+6
| | | | | | | Change-Id: I2230e2dcb7bc2497b5dbe71a22c21d84176b5e57 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> (cherry picked from commit fd105380eb4f43c08578b6fe5ce3e5c6dd4b35d6) Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix minor typosSze Howe Koh2020-08-301-1/+1
| | | | | | | Change-Id: I4c51c40697e410d56b6a2d2446ed9f8ae218576d Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> (cherry picked from commit 024ec9c564abfbe9aadd2193deeaa0d37464119a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickLoader: make sure the status property change properlyWang Chuan2020-08-251-0/+2
| | | | | | | | | | | | | When we call [setSource] in qml, we will try to convert a qml value to a string which indicate the url we want to load. However, if this value is undefined, it will convert to a string with content "undefined", and then cause loading error. More worse, if there is a qml file named "undefined", it will be loaded to the Loader. Fixes: QTBUG-85938 Change-Id: I5b192ba84aa29532e547349bbf37d413c107d8e4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 3d195d33ece3f8fd7cd7d8e6163fe038fc7fc036)
* QQuickLoader: make sure the status property change properlyWang Chuan2020-08-251-0/+7
| | | | | | | | | | | | | Since the invocation of [setSource] in qml will clear the old source url first, it is hard to decide whether we have changed the source url, especially when we call [setSource] with an empty string, and the loader's status won't change properly. Fixes: QTBUG-85938 Change-Id: If61a33c790a4fd6562611c4c50756bc5e213363a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 3aa4cd682f52b70803cc3f72d732bde9987677dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc, listview: document that binding to parent should be avoidedRichard Moe Gustavsen2020-08-201-2/+24
| | | | | | | | | | | | | | | | | | | | | | | Clearify in the documentation that the parent of a delegate can change during its lifetime, and even be null. And because of that, they should avoid binding to it. In general, how a control is structured internally should be understood as a private implementation detail. Even if the application has the freedom to read (and even change) the internal parent-child hierarchy as it sees fit, doing so can be fragile as the internal structure of a control can easily change from one version to the other. [ChangeLog][QtQuick][ListView] Since the parent of a delegate can end up being null during its lifetime, developers are now advised against using it in bindings. Fixes: QTBUG-82989 Change-Id: I2d6c79102435d0969f4dc3deec13c5fff4affeb1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit ed73efa27acd8e7c42a960ef90c2e4a898c20c30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace Qt's MidButton with MiddleButtonEdward Welbourne2020-07-222-2/+2
| | | | | | | | | | | The latter has been the preferred name since Qt 4.7.0. Added a comment on where the old name is exposed to QML that it's only for backwards compatibility. Change-Id: I2c5088d597dd7327cc5899d06afb180d0ec2893e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 3debb37250b2c57aaaf81940f9dfeb540fd4e380) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix MouseArea mouseX/mouseY coordinates while draggingShawn Rutledge2020-07-021-1/+1
| | | | | | | | | | | | | | | | | | When MouseArea is not anchored with the usual anchors.fill: parent, such that its position is not 0,0, calculating mouseX/mouseY as d->lastScenePos - mapToScene(position()) was wrong. It could be d->lastScenePos - mapToScene(QPointF()), but instead we use mapFromScene(d->lastScenePos) as in a few other places. Amends 8068e7b98cde09565efe27585b84e120f9c5ea99. Fixes: QTBUG-85111 Task-number: QTBUG-75993 Change-Id: If1440d05ec3b75d9f9f4802fbc361756fadb559e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 192609f2f8c2f5d8b48716af2166aaa8ad67e80b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Change the cursor within HoverHandler.marginShawn Rutledge2020-06-301-7/+11
| | | | | | | | | | | | | The visual cursor feedback was inconsistent with the hovered property when a margin is set. Amends 1c44804600ad3dbeb60d1f5209ce9cf937d30ab3 Fixes: QTBUG-85303 Task-number: QTBUG-68073 Change-Id: I25506baecaecbd6450a0e95786f103024b46b1b8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b1493678fc295765ce93e565c5194e860e746436)
* webOS: Don't send synthetic hover event on a frame updateJaeyoon Jung2020-06-251-0/+4
| | | | | | | | | | | | This reverts the commit 6f84a09 partially which generates a synthetic hover event on a frame update. Such hover event has never been expected in webOS and messes up the existing logic. Change-Id: I7b855d27d1d44f2fab240707ef1ec79cdbcff6e5 Task-number: QTBUG-83119 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a06e873a1e80eda2f8e946ebe4e2f7631c78f53d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add documentation for zScalePaul Wicking2020-06-231-0/+8
| | | | | | | | Fixes: QTBUG-84750 Change-Id: I2a2480abf3c6d81e103869975d68c69adbe5b81e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit fab48743f0f596afc00faa3bdb68736c594eaf64) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix outline for connected textEskil Abrahamsen Blomfeldt2020-06-191-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For any font where glyphs are connected (any font could have this, but specifically Arabic and Indic fonts will typically always connect glyphs, as it is required to express the language correctly), we would draw the outline on a per-glyph basis, thus getting outlines that disconnect the glyphs. In order to fix this, we have to draw the fill of the glyphs in a separate pass after the outline has been drawn. Note that in order for this to look correct, we have to disable subpixel antialiasing on the fill, which required some plumbing in the native rendering glyph node. The outline shaders have also been changed to only draw the outline and not the fill. Also contains back-port of d46c406cc67f12e6a0798ef509abbb973b34d39d in addition to e8d9bc1bcada7d94af5a33d64a9afc860ede5b84. [ChangeLog][QtQuick][Text] Fixed Outline style on connected glyphs, especially visible in e.g. Arabic and Indic writing systems. Fixes: QTBUG-69301 Fixes: QTBUG-83358 Change-Id: If52a940bfb0267384ea002120655aed1310458a1 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit e8d9bc1bcada7d94af5a33d64a9afc860ede5b84)
* Fix the vertical alignment of images in a text documentDominik Holland2020-06-171-4/+6
| | | | | | | | | | | Try to align with the HTML standard as much as possible. AlignMiddle is between AlignTop and AlignBottom. Fixes: QTBUG-84981 Change-Id: Ie99aef0d09a6ece751883492748630526c4a1195 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit d28c625006c1b54fc3d39637a7b33e42fadb72a9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Cull removed items from QQuickItemViewFabian Kosmale2020-06-151-2/+3
| | | | | | | | | | | | | 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>
* Fix QQuickKeyNavigationAttached issueValery Volgutov2020-06-121-6/+6
| | | | | | | | | | | | | | | | | | | | | 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>
* 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 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)
* QQuickTextNodeEngine: prevent renderring transparent selection colorWang Chuan2020-06-051-2/+2
| | | | | | | | | | | 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>
* 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 polish loop detection and diagnosticsJan Arve Sæther2020-05-211-7/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* 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-201-2/+2
| | | | | | | | | | | | 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>