aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
Commit message (Collapse)AuthorAgeFilesLines
* Delay the deletion of QSGTextures until all windows are synchronizedDominik Holland2017-06-162-2/+3
| | | | | | | | | | | | | | | | With the 'basic' and the 'windows' render loop the scene graph context is shared. Because of this we cannot start deleting textures after the first window is synchronized as it may contain textures needed by the another window, which is not yet synchronized. QWindowPrivate::syncSceneGraph() is not calling endSync() anymore as it doesn't know whether it is the last window or not. Instead the renderloop is now responsible for calling endSync() once this is safe to do. Change-Id: Icb50ebfb447c928e38b41df7e26f3bfafdb4a811 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com> Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* QQuickItemView: fix releaseItem() loopsJ-P Nurmi2017-06-124-12/+13
| | | | | | | | | | | | | | Calling releaseItem() destroys the item, which emits childrenChanged for the contentItem, and if at that point anything calls setFooMargin(), setContentHeight(), returnToBounds(), or many other methods that indirectly access the visibleItems list, it leads to a crash due to read after free. Add a releaseVisibleItems() helper method that makes a copy, clears the original list first, and then releases the items. Task-number: QTBUG-48394 Task-number: QTBUG-61294 Change-Id: I29e4d3870d33549e8bf789de84c67ab1826fca7d Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Repeater: Clarify documentation a littleRobin Burchell2017-06-071-1/+5
| | | | | | Change-Id: I4544dafd4d641728394de9a97e7ae9dd029e91a4 Task-number: QTBUG-57155 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickWindow/View: set a QObject-parent on the root itemJ-P Nurmi2017-06-022-0/+2
| | | | | | | | | | | | | | | | | | | | | | | People are often confused why eg. the objects from: window->contentItem()->findChildren() are not included in window->findChildren(). This change connects the item tree to the window's object tree to make findChild() and findChildren() produce expected results. The same technique is already used for QQuickFlickable's contentItem. [ChangeLog][QtQuick][QQuickWindow] Set the window as the QObject-parent of the contentItem to ensure consistent behavior for calling findChildren() on QQuickWindow and QQuickWindow::contentItem. [ChangeLog][QtQuick][QQuickView] Set the window's contentItem as the QObject-parent of the rootObject to ensure consistent behavior for calling findChildren() on QQuickWindow::contentItem and QQuickView::rootObject. Change-Id: Idb7834eb5e560088ca849e6ce90e6fa3b3ae3e91 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Revert "QQuickWindow::createTextureFromImage(): return nullptr for null images"Mitch Curtis2017-06-021-1/+1
| | | | | | | | | | This reverts commit e6acf80136db9f667d0d4664f6c68065355d6811. This breaks behavioral compatibility. Task-number: QTBUG-61083 Change-Id: I0161d536502bab31aaf4ebc38f91e6c8842f72b0 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-313-48/+54
|\ | | | | | | Change-Id: I3f77593ca944114534fff5df26bbb09150ee4400
| * Revert "Temporarily restore QQuickPointerDevice::pointerEvent() accessor"v5.9.0-rc2v5.9.0-rc1v5.9.0Shawn Rutledge2017-05-202-11/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit ee6b07b3ce8ba80632868181d45d96253acb1064. This is to be integrated after the qtlocation change to remove the dependency on this private function. Task-number: QTBUG-57253 Change-Id: I756681fb2595d1326b7e5206bac57ccc318c0a46 Reviewed-by: Liang Qi <liang.qi@qt.io>
| * Revert "QQuickItem: Port a number of manual loops to range-for"Robin Burchell2017-05-191-37/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8d92e595e0e8cf19f60db2fce4a543265c9130e9. This is broken in a few places, e.g. setEffectiveVisibleRecur emits, which means that it may run uncontrolled code, so we can't be sure the list isn't altered underneath us. Change-Id: I58b8b62e74581207c1b14902ea7b8b552761de8a Task-number: QTBUG-58811 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Document the default value of x, y, width & heightJesus Fernandez2017-05-231-0/+1
| | | | | | | | | | | | | | | | The default values of the coordinates and size variables were missing. Change-Id: I1bba77b3db68d3f726c1211c6a0090e97f687b51 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-192-1/+11
|\| | | | | | | Change-Id: I52c591fff08a0cbf426aa53354850fb4b5f130c1
| * Temporarily restore QQuickPointerDevice::pointerEvent() accessorShawn Rutledge2017-05-122-1/+11
| | | | | | | | | | | | | | | | | | This can be reverted as soon as the relevant qtlocation change is integrated. Task-number: QTBUG-57253 Change-Id: I72b71f61ba8fe421ac57c963801176098fe9f11c Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | QQuickWindow::createTextureFromImage(): return nullptr for null imagesMitch Curtis2017-05-151-1/+1
|/ | | | | Change-Id: Idf3315be104e058315d82893443e1c27d1d79f2e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Move pointerEvent instance to QQuickWindowJan Arve Saether2017-05-103-29/+52
| | | | | | | | | | | | With two or more windows, if events are being delivered to each, the grabbers can be different in each. We need unique instances of the QQuickPointerEvent objects for each window to avoid losing the grab state in the parent window while delivering a synthesized event to a subwindow, for example. Change-Id: I51da1212d573853969e32ad78f5b219d979a8a5c Task-number: QTBUG-57253 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix hover delivery in case of touch release eventsFrederik Gladhorn2017-05-101-2/+8
| | | | | | | | | | | | | | | | | | | | | This fixes tst_TouchMouse::hoverEnabled. It turns out that the problem is that QQuickWindowPrivate::flushFrameSynchronousEvents would deliver artificial hover events which (due to the nature of the function) would arrive without being synchronized with the test. This should not be a problem as such, but there was one bug: the hover event would also be sent in case of a touch release event. The definition of when to "pretend hover" is a bit shaky, but we should definitely not send hover events after touch releases. By clearing lastMousePosition instead of setting it to where the touch point is released we no longer receive bogus events. Task-number: QTBUG-55350 Change-Id: I4dea54740e37182f66c4a729d7b06a1c770c34a9 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Touch child mouse filtering: pass not grabbed points inside item boundsFrederik Gladhorn2017-05-071-1/+2
| | | | | | | | | | | | | | c2ca2cbf04071ffb3aee6af8d5ab9084dfa1c091 started to restrict delivery of items in childMouseEventFilter by checking that we wouldn't deliver completely random points outside the item that were not grabbed by child items. That is generally correct. It did no longer send along touch points that had any other state but pressed but were inside when they had no grabber. That part was wrong, points must be sent along if they are not grabbed and inside the item. Task-number: QTBUG-60368 Change-Id: Ida24f5d2310d3b71db79ae5f95da2c57dcd3f150 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix remaining QQWindow qCDebugs to show eventpoint IDs in hexShawn Rutledge2017-05-041-2/+2
| | | | | Change-Id: I04122218499733856136f5a49b72707a0e8885e5 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Doc: fix 'adpatation' -> 'adaptation'Jüri Valdmann2017-05-031-2/+2
| | | | | Change-Id: Ia852d86d9b9585a1d3d9b07eb8b48361d61c5671 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add a method to query the scene graph backendMichael Brüning2017-04-272-0/+15
| | | | | | | | | | | | | | | | Since 5.8, it has been possible to set the scene graph backend using QQuickWindow::setSceneGraphBackend instead of using the environment variables. This caused some trouble with modules that need to know which backend is used and relied on the environment variables or command line options for getting this information. One example of such a module is Qt WebEngine, which crashed because it ended up trying to use OpenGL resources with the Qt Quick scenegraph software backend. Task-number: QTBUG-60232 Change-Id: Ia7c4860b16a9ce6fe9af73dfe5a5d2d19ebf5bfd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Run includemocs in qtdeclarativeThiago Macieira2017-04-2655-0/+101
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Document Screen virtualX and virtualYPier Luigi Fiorini2017-04-261-0/+14
| | | | | | | | These two properties were added without documentation. Change-Id: I12c259bf95470d3744dfd6f2fd8487120181fdf4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: correct \sa statementNico Vertriest2017-04-261-1/+1
| | | | | | | qquickwindow.cpp:4198: warning: Can't link to 'Qt.application' Change-Id: I159ce3e432c8d88280dfd0b9de5831f33216ccad Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Fix populating selection clipboard with keyboardVolodymyr Samokhatko2017-04-261-0/+7
| | | | | | Task-number: QTBUG-59879 Change-Id: I7b6e769c6a027df6030b6ab014651b498f3059bf Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix Canvas memory leakRoman Pasechnik2017-04-251-0/+6
| | | | | | | Task-number: QTBUG-59467 Change-Id: I3fa0e20676e453ec194ec71188172f4650313d1e Reviewed-by: Gunnar Sletta <gunnar@crimson.no> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* QQuickCanvas: Fix requestAnimationFrame documentationv5.9.0-beta3Robin Burchell2017-04-211-2/+2
| | | | | | | The type here is an int, not a long. QML doesn't have a long type at all, too. Change-Id: I7aea92819f5e2afadddd7b79289a304875d4297f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: remove reference to no longer existing propertiesNico Vertriest2017-04-211-2/+0
| | | | | | | | qquickmultipointtoucharea.cpp:170: warning: Can't link to 'horizontalDiameter' qquickmultipointtoucharea.cpp:170: warning: Can't link to 'verticalDiameter' Change-Id: Ib1cf7c634457f1557631d0e6ffdc942917746e04 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Silence GCC 7 warnings about implicit fallthrough in Qt codeThiago Macieira2017-04-201-0/+1
| | | | | | | | | | | | | | | This only deals with Qt code. MASM has a lot of those left. We should just update from upstream instead to get the fixes. qv4regalloc.cpp:660:52: warning: this statement may fall through [-Wimplicit-fallthrough=] if (leftSource->type == DoubleType || rightSource->type == DoubleType) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qv4regalloc.cpp:666:13: note: here case OpBitAnd: ^~~~ Change-Id: I7814054a102a407d876ffffd14b6b0e2d6b03689 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix warning for -no-feature-cursorStephan Binner2017-04-181-0/+2
| | | | | Change-Id: Idc2ab95d0ea1e556995e7bcd29b5cbcd82bc28f6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix warning for -no-feature-shortcutStephan Binner2017-04-181-0/+2
| | | | | Change-Id: I2f6f38af1fb9ecc8a763f9c2d0a45200fd6374af Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickText: optimize updateLayout()Anton Kudryavtsev2017-04-181-8/+2
| | | | | | | | QString::replace(QChar, QChar) was fixed in c12f42e91b146109cc9ee5d050928672776ca1ee So no need to use pre-condition. Change-Id: I98eadfc89350194832b229afe061dc0bd01f1bc9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-113-1/+20
|\ | | | | | | Change-Id: Ib3d81ad33a6ba28d891da91271a64d5fcc4874e6
| * Fix hidpi support for opengl window grabbingFilipe Azevedo2017-04-092-0/+4
| | | | | | | | | | | | | | | | | | | | Now set the QImage devicePixelRatio so the content is correct on all screens. Task-number: QTBUG-53795 Change-Id: If94edf901da1285afe9bb847b8973d568a2b7082 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Fix touch event delivery in childMouseEventFilterFrederik Gladhorn2017-03-161-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | Since moving to pointer events, we would deliver all events inside the filter function. The expected behavior though is that only points that are already grabbed, pressed inside or grabbed by children would be seen by the filter function. This broke using multiple touch aware items at the same time (2 pinch areas for example). Change-Id: I42a430f196ebbcf0a83a6dc8aca319e433ad52ad Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Remove revision from Drag.imageSource propertyPaolo Angelelli2017-04-051-1/+1
| | | | | | | | | | | | | | | | | | Having the REVISION in the Q_PROPERTY seemingly breaks the feature. QML property revisioning does not work for attached (nor grouped) properties (QTBUG-33179). Change-Id: I770826e86936b59fb1a25885d7c6b123b5467fe2 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Fix QQuickCanvasItem::toImage() high-DPI captureMorten Johan Sørvig2017-03-312-8/+11
| | | | | | | | | | | | | | | | | | | | | | Make toImage() work for devicePixelRatio > 1 by scaling the source rect. Also set the devicePixelRatio on the returned image. Task-number: QTBUG-59170 Change-Id: I0c8ccd562c1cf1e89ff37ca1806b46296480b0d0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Simplify shortcut override handlingJoerg Bornemann2017-03-311-45/+1
| | | | | | | | | | | | | | | | | | Use QInputControl::isCommonTextEditShortcut to determine when to accept a ShortcutOverride event. This removes the code that was duplicated from QWidgetTextControl. Change-Id: Ia4a251e3870803bdb7b3943075003fddabae924b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Flickable: don't steal grab from item with keepTouchGrab setShawn Rutledge2017-03-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Sometimes filterMouseEvent can be given a mouse event which was synthesized from a touch point which was already grabbed. In such cases, if the grabber has keepTouchGrab set, respect it. This makes it possible again for a QQControls 2 slider to be draggable inside a Flickable which is also draggable in the same direction. Task-number: QTBUG-59416 Change-Id: I93b7fd9cb846b1e574615154f9a54316b60c0477 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | in childMouseEventFilter, touchpoint grabber is also the mouse grabberShawn Rutledge2017-03-271-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an item (such as Flickable) filters its children's mouse events, sometimes the mouse event may be one that is synthesized from a touch point. If that touch point is already grabbed, then in the context of childMouseEventFilter QQuickWindow::mouseGrabberItem() should return the item which has grabbed the touchpoint from which the mouse event was synthesized. Otherwise, there was a regression in which an item which can be dragged via touch (such as Slider in QQ Controls 2) could have its grab stolen by a filtering parent, such as Flickable, or the gesture recognizer in QtLocation. mouseGrabberItem() was returning null because touchMouseId and touchMouseDevice were not set, and the actual mouse was not grabbed. If a touch event is used to synthesize a mouse event, and during delivery an Item steals the grab of the synthetic mouse event, the original grabber needs to be notified that it has lost the grab. Task-number: QTBUG-59416 Change-Id: Ib121b06121df7593c0d549a6df42397b8ead1c45 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | Build fix for configure -no-openglPaul Olav Tvete2017-03-222-0/+4
| | | | | | | | | | | | | | Change-Id: I21f111a04d9e2ce367d7677dbb48abbd591a4e71 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Joni Poikelin <joni.poikelin@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QQuickEvents: Fix documentation of types for MouseEvent and WheelEvent x/yRobin Burchell2017-03-201-4/+4
| | | | | | | | | | | | | | | | These types are qreal, not int. Change-Id: I26569c40825ce098ea095b3d9dc9b84eb3870c02 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Flickable: fix doc statement about content anchoringNikita Krupenko2017-03-161-2/+4
| | | | | | | | | | | | Task-number: QTBUG-54101 Change-Id: I3b0a0225efb77003c1c80c1d5b94ab572f3cc785 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9Liang Qi2017-03-142-0/+2
|\ \
| * | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-132-0/+2
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp Change-Id: I26f8d18fe8af664ee8573116f182fe12b71e089a
| | * Fix build for -no-feature-quick-shadereffectStephan Binner2017-02-273-0/+4
| | | | | | | | | | | | | | | Change-Id: I334603209818a8030ddb5b5b316cab596c328bf1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Build fix for -no-feature-quick-pathPaul Olav Tvete2017-03-132-3/+9
|/ / | | | | | | | | Change-Id: Ib52d45a12b367fa08982535a69c14881beec597e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Build fix for -no-feature-quick-shadereffectPaul Olav Tvete2017-03-103-0/+4
| | | | | | | | | | Change-Id: Ie1f601c6ae4c6c5d8d23b14a6670979d9c24e209 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix copied QDragMoveEvent drop action to propagate to original eventAlexandru Croitor2017-03-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to set the drop action and the accepted state in a overridden dragMoveEvent handler, does not get propagated to the original QDragMoveEvent, because the event passed to the handler is a copy. This does not allow canceling the drop action in the move handler, or change the proposed action to a different one. Changing these values in the move handler is important to allow modifying the cursor when moving / hovering above a possible drop item, depending on user conditions. Fix consists in copying the drop action and accepted values to the original event, as well as removing the hard-coded setAccepted (true) call. Task-number: QTBUG-58260 Change-Id: I7a4bd4e68ee1023a36a63d3e835c282077e4187c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | When stealing a touchpoint as synth. mouse, ungrab touchFrederik Gladhorn2017-03-011-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you use MultiPointTouchArea to make a button component, or if you do something similar by subclassing QQuickItem and handling touch events, and you place such a component inside a Flickable, when the user presses on the button and then drags far enough that the Flickable steals the grab, the MPTA or custom item did not receive the touchUngrabEvent() callback. Now it does, so now the button will go back to released state as a result of having the grab stolen. The situation here is special in that it's the only place where a touch event is transformed to be treated as mouse in the future, usually it's either treated as touch or mouse from the start. When this happens, it's not enough to call setMouseGrabber because that doesn't send touch cancel to the previous grabber. Instead we need to explicitly call touchUngrabEvent to notify the touch handling item. The explicit setting of the grabber which was there previously is not needed, since grabMouse will update the grab based on touchMouseId. tst_QQuickMultiPointTouchArea::inFlickable2 was already testing the pressed state of the touchpoint when the grab is stolen, but it was changed in 468626e99a90d6ac21cb311cde05c658ccb3b781; now that can be restored, and we can also un-blacklist inFlickable, which was deemed unstable in 6d163779711d4601931ae0f82910794fb2498136 [ChangeLog][QtQuick] MultiPointTouchArea, and any custom Item, will now properly receive touchUngrabEvent() when the touch grab is stolen by a filtering parent Item, such as a Flickable. Task-number: QTBUG-57910 Change-Id: I4e1b23ed099f01e7eca2e8a0e7ab4c652ef00cfa Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Ensure mouse ungrab is called when touch is also trueMichael Dippold2017-02-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | Currently when removeGrabber is called with both mouse true and touch true, the touch logic blocks the ungrab mouse from being triggered as q->mouseGrabberItem() is then null. Task-number: QTBUG-57797 Task-number: QTBUG-59098 Change-Id: Icb4d00cf876c9fd0930b50f927f68dfba172dc29 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-248-28/+57
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/quick/accessible/qaccessiblequickview_p.h src/quick/items/qquickmousearea.cpp src/quick/util/qquickanimatorjob.cpp tools/qmlplugindump/main.cpp Change-Id: I84474cf39895b9b757403971d2e9196e8c9d1809
| * Fix build without features.cursorStephan Binner2017-02-201-2/+4
| | | | | | | | | | Change-Id: I20821e5fd4d2154aa49ef90015d512dd09c134f3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>