aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug where QQMPH kept an exclusive grab when no buttons were pressedJan Arve Sæther2019-02-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This happened if you moved the mouse while doing a multitouch operation. More specifically this caused the bug: 1. Open qtdeclarative/tests/manual/pointer/map.qml 2. Rotate the map with two fingers (Do not release fingers). 3. Move mouse (no buttons pressed). 4. Release both fingers. 5. Move mouse again (error: the draghandler has a grab and thus the map is dragged even if no buttons are down). This happened because if you moved the mouse while having two fingers down, Windows would generate a *mouse*move* event with Left button or Right button pressed (which wasn't the case on the physical device but it's probably because of a bug in how mouse events are synthesized from touch on Windows). This caused the QQuickMultiPointHandler to do a passive grab. Then, when releasing the fingers it would not send a mouse release event (just plain touch release events), so the QQuickMultiPointHandler would keep the passive grab it had. All subsequent mouse move events would then be dispatched to the QQuickMultiPointHandler where it would assume that the button was pressed until it got a release event (but button was never pressed so that wouldn't happen). Eventually it would perform an exclusive grab, and dragging was initiated. Change-Id: I42b3133c5fde93c7f92f1cb28705156a69f9ad1c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickWindow: don't give exclusive grab to invisible or disabled ItemsShawn Rutledge2019-02-051-1/+1
| | | | | | | | | | | | An Item might set itself invisible or disabled while handling a mouse press, as an alternative to rejecting the event. In earlier Qt versions (e.g. 5.6) it did not end up with a grab in such a case. Task-number: QTBUG-63271 Change-Id: I12f646e4217d773d396f380672420c85e6adcd52 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Merge remote-tracking branch 'origin/5.12.1' into 5.12Liang Qi2019-02-012-27/+51
|\ | | | | | | | | | | | | Conflicts: src/quick/handlers/qquickpinchhandler.cpp Change-Id: I1f3618ceb93049623d6bf3a208b037c33d9d1f0c
| * Fix axis constraints API and documentation:v5.12.1Jan Arve Sæther2019-01-212-27/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should have been done properly for 5.12. Since this API was introduced in 5.12.0, we simply hide the documentation for the old properties and make sure the properties we want to expose are documented: * Document the xAxis and yAxis properties. * Deprecate the {min,max}imum{X,Y} properties, and hide them in the documentation. Fixes: QTBUG-73137 Change-Id: Ic749bcfec63dc4772f193ccae2a2750c20cb63aa Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | TapHander: do not "want" an eventPoint that is outside parent boundsShawn Rutledge2019-01-302-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far it was checking parentContains() on press, release, or when the gesturePolicy is WithinBounds, but not for each movement when the policy is DragThreshold (the default). This might explain most of the remaining warning noise: "pointId is missing from current event, but was neither canceled nor released" because it was possible for TapHandler to remember wanting a point that it should not have wanted, but without taking any kind of grab, and then complaining when that point was no longer present. Since it did not grab, it did not get the release, unless the release was part of an event containing a point that it DID grab. Fixes: QTBUG-71887 Change-Id: I26ce62279574cf6b0150f24e486f224a604ac6b1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | TextInput: Stop leaking password values to process memoryIvan Čukić2019-01-292-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The contents of a deleted QString can still remain in memory and can be accessible by tools that read the raw process memory. The same problem appears when the QString reallocates -- the old buffer gets deleted, but its contents will remain in memory. This means that a TextInput that serves as a password input field can leak parts of the password while the user is entering it (due to reallocation) and the whole password when the TextInput instance is destroyed. With this patch, the contents of the m_text string member variable will be zeroed-out before the TextInput is destructed. This is done only in the cases when the TextInput serves as a password field. Also, this patch reserves the space for 30 characters for m_text when the TextInput is used for password input. This is enough to make sure no reallocation happens in majority of cases as barely anyone uses passwords longer than 30 characters. [ChangeLog][QtQuick][TextInput/security] When the TextInput is used for password input, preallocate a buffer for the string that stores the entered value and zero-out the string on TextInput destruction to avoid leaking sensitive data to process memory Change-Id: I8f1f307b1cfc25ad51f48bae8509a258042a2e7f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | PinchHandler: fix pedantic warningsShawn Rutledge2019-01-282-20/+19
| | | | | | | | | | | | | | | | | | - qreal<->float conversions are explicit - use qFuzzyCompare rather than == - remove padding between variables (but the class still needs padding) Change-Id: I9a9eb01f5a4108592b34e4b2f018c720ba19beb0 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | PinchHandler: Avoid unwanted translations when axes are disabledShawn Rutledge2019-01-281-6/+4
| | | | | | | | | | | | Fixes: QTBUG-72822 Change-Id: I2773ba14fcb24a47fe2ec04860b4aa305a051453 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Silent -Wdouble-promotion warningJesus Fernandez2019-01-251-2/+2
| | | | | | | | | | | | Change-Id: I44ba34365818adf6b9af022e4bf4ae9e02c3511a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Canvas: Guard context pointer against external deletionUlf Hermann2019-01-231-144/+166
| | | | | | | | | | | | | | | | | | You cannot keep the context when reparenting the canvas item. Use a QPointer prevent dangling. Task-number: QTBUG-73113 Change-Id: Ie7021c6f0bb0d09923eb358dc7e51d6727e74a7a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add handlers declared as Flickable children to its contentItemShawn Rutledge2019-01-225-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickItemPrivate::data_append() was not invoked when any kind of Pointer Handler was directly declared in a Flickable (or subclass) because QQuickFlickable redefines the default property to be its own flickableData property. So we need to repeat the special handling in QQuickFlickablePrivate::data_append() too. The handler must be added to the private->extra->pointerHandlers vector, so that QQuickItemPrivate::handlePointerEvent() will attempt to deliver events to those handlers. TapHandler seems OK (especially with its default gesturePolicy so that it does not do an exclusive grab). PointHandler seems OK. DragHandler competes with Flickable for the exclusive grab. pressDelay can help; or set acceptedDevices: PointerDevice.Mouse to allow the mouse to drag but not flick, and the touchscreen to flick but not drag. Fixes: QTBUG-71918 Fixes: QTBUG-73035 Change-Id: Icb97ed5230abe0cb6ec0230b5b5759a0528df7e8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.12.1' into 5.12" into ↵Liang Qi2019-01-226-9/+13
|\| | | | | | | refs/staging/5.12
| * Merge 5.12 into 5.12.1Kari Oikarinen2019-01-0818-25/+66
| |\ | | | | | | | | | Change-Id: Ic746fbce93430867e2eda4bc7155d34e20a4aa2b
| * | Fix regression in border-top with high-dpiAllan Sandfeld Jensen2019-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Device pixel ratio was included twice. Task-number: QTBUG-72603 Change-Id: Idd1b75c3b1926a6381bf258c1b705be10c5575b9 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * | TapHandler: clean up when wantsEventPoint returns falseShawn Rutledge2018-12-132-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already emitted grabCanceled() to inform QML callbacks, but we didn't call reset(). It seems more proper to do everything that would normally be done when grab is canceled. TapHandler should not give up its passive grab yet though, because that prevents delivery to any parent Flickable that might be filtering events. A parent Flickable should be able to start flicking after the drag threshold is exceeded (it happens to be exactly when TapHandler gives up). Fixes: QTBUG-71466 Fixes: QTBUG-71970 Change-Id: Ibba1b0de92cfd88547eeb44edb095d019de76a94 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | PointHandler: distribute simultaneous touch presses properlyShawn Rutledge2018-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If multiple touchpoints are pressed simultaneously, each point can be grabbed by one PointHandler instance. Each PointHandler instance cannot grab more than one point, nor grab a point that is already chosen by another PointHandler. This was always the intention, but got broken (perhaps by 3523b676382db4aa39adeb9126d8bb2185e84403), and there was no test coverage of this case until now. Fixes: QTBUG-71431 Change-Id: I6d7614eb4767c677d929291f917cf62d9c03bd93 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
| * | Fix typo in notify signal emissionRobert Griebl2018-12-101-1/+1
| | | | | | | | | | | | | | | Change-Id: Ic2c298d14eb85ee8702eb751dd269eb0e3e11cc6 Reviewed-by: Michael Brasser <michael.brasser@live.com>
| * | Doc: Restore QtQuick.Shapes documentationTopi Reinio2018-12-101-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sources for this module were recently moved. Add the new directory to documentation config to make the documentation generate again. Also, make the documented QML module version track the minor version of Qt. Change-Id: I56f439c141cbf39639a97d44d328c068fff6e96e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Documentation: Start using the \nullptr macroFriedemann Kleint2019-01-213-5/+5
| | | | | | | | | | | | | | | | | | Task-number: PYSIDE-903 Change-Id: I0c4640eb20157673eabb131e8834e79cbbf95d5c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Remove reference to OpenGL from distance field cache superclassEskil Abrahamsen Blomfeldt2019-01-214-15/+7
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSGDefaultDistanceFieldGlyphCache is the OpenGL-specific implementation, but for some reason the core profile flag was stored in the superclass. It is ever only used from QSGDefaultDistanceFieldGlyphCache and the rest of the superclass has no OpenGL-dependency, so we just move it. This is needed to be able to share the generic QSGDistanceFieldGlyphCache with Qt 3D Runtime, where there is no current OpenGL context when the scene graph is built and resources have to be allocated through an abstraction layer in Qt 3D. Task-number: QT3DS-1419 Change-Id: I7f4e26eecc21635ff81030b32ecc89c6dc4fcfbe Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Doc: Fix link issuesNico Vertriest2019-01-039-13/+6
| | | | | | | | | | Change-Id: I738b9da5335afb048d2eda2edf2be5095a91d7e5 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | qquickpixmapcache: Fix invalidation of m_cache while iterating itRobin Burchell2018-12-221-1/+2
| | | | | | | | | | | | | | | | | | Releasing items from the cache modifies m_cache, which we cannot do with a range-for. Fixes: QTBUG-65077 Change-Id: I2efcf6a03b03982a54bb1aacff43c55c45782eaa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | When there are no points to grab, then we should return falseAndy Shaw2018-12-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | If there are no points to grab then it should not indicate that it was able to grab points. Otherwise it can cause a handler to be active when it has not valid points to work with. This can happen if you do a pinch gesture on a DragHandler as the points are not valid by default then. Fixes: QTBUG-71972 Change-Id: Ib1c48e5a3777f4118944accfa2bc92edf0209884 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | nothread: do not delete reader thread object before it gets usedLorn Potter2018-12-131-0/+7
| | | | | | | | | | | | | | | | | | | | exec is an empty function on nothread and returns right away, so the pixmap reader thread object gets deleted before it can download the url Task-number: QTBUG-72105 Change-Id: If205dbe12d0b5299b43a68e7d0d955a2b89b4af1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Doc: velocity properties must be set to -1 when setting durationMitch Curtis2018-12-131-1/+12
| | | | | | | | | | | | | | | | | | This is an important detail that was left out, causing confusion when a user tries to set e.g. highlightMoveDuration without setting highlightMoveVelocity to -1. Change-Id: Ida4042626fcc20105267a5d2a0babcb91eed1516 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-12-112-3/+7
|\ \ | | | | | | | | | Change-Id: If18e582a7210dae046426d97af530ab7ef47ddf4
| * | Fix leaking textures and animation resources by software backendKirill Burtsev2018-11-142-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickStyleItem1::updatePaintNode assumes every instance of QSGNinePathNode (QSGSoftwareNinePatchNode for software backend) to own new texture object on setTexture. Instance of QQuickAnimationController is also assumed to be deleted by render loop on window destroy. Fixes: QTBUG-69290 Change-Id: Ibd22229108c986c1c115600280482cea01bf4160 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | Fix missing strike outDaniel Engelke2018-12-102-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added <s></s> and <del></del> tag aka strike out to QQuickStyledText. QQuickStyledText covers the essential text decorations, apart from strike out. In order to use it, one had to switch to RichText, which comes with its own overhead and limitations. <s> for no longer accurate or no longer relevant content <del> for removed content Fixes: QTBUG-72376 Change-Id: I3c191d91d57afcc48090facc49d643f8ad708fb4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | TapHandler: ignore scroll events and native gesturesShawn Rutledge2018-12-102-4/+9
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | During a 2-finger press (to emulate right click on a trackpad), the OS may also generate a QWheelEvent with ScrollBegin phase just in case scrolling starts. This must not prematurely deactivate the TapHandler. Also if a gesture or wheel event begins as the very first event after an application starts, ensure that subsequent mouse events are not mis-delivered as wheel or gesture events. Fixes: QTBUG-71955 Change-Id: Ic12e116483ab9ad37c4ac3b1d10ccb62e1349e0a Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Ensure that each Event Handler has an Item parent rather than assertingShawn Rutledge2018-12-071-1/+5
| | | | | | | | | | | | | | | | | | | | QQuickItemPrivate::data_append() was already getting called, but the assert (that the parent was already an Item) was failing in case a handler was declared inside a Window or a Dialog. Fixes: QTBUG-71317 Change-Id: Ia497182e3b4a9722eee97a375f9ee5d4151108e6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Add dynamically-created Event Handlers to the relevant handlers vectorShawn Rutledge2018-12-073-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If any kind of Pointer Handler is created dynamically in JS by calling Component.createObject(), QObject::setParent() is called rather than passing the parent to the constructor, so QQuickItemPrivate::data_append() did not take care of adding the handler to QQuickItemPrivate's extra->pointerHandlers vector. We need to use the auto-parent mechanism (just as we did with handling dynamic creation of nested Windows in 8cb02e23abbefc9d020707fc1a2d8b6eb4e103b6). Added QQuickItemPrivate::addPointerHandler() to put the prepend() and implied setAcceptedMouseButtons() in one place. Fixes: QTBUG-71427 Change-Id: I3be3dd033c1c89e6e5b5c3463e1a720bbe963281 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Declare the enum so it can be passed to the QML sideAndy Shaw2018-11-301-0/+1
| | | | | | | | | | | | | | | | | | In order for the enum value to be passed to the QML side then it needs to be registered so it can be picked up. This fixes the signals using QQuickEventPoint::GrabTransition, such as PointerHandler's grabChanged. Change-Id: I387930d50f03fee867b3d869618525d44173b538 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Prevent overly drawn-out animation when snappingMichael Brasser2018-11-291-1/+5
| | | | | | | | | | | | | | | | Don't trigger (potentially seconds long) animation to to fix very small errors in offset. Change-Id: Ibdba16e4fb7a1aff7577a29ab594af8aba231d6d Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
* | Disable antialiased clipping when painting imagesAllan Sandfeld Jensen2018-11-282-10/+8
| | | | | | | | | | | | | | | | It shouldn't be needed and produces tiling gaps Change-Id: I3c7bbc91e5e618bdb111ddf18412acac253f2c6e Task-number: QTBUG-71322 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | QQuickTableView: connect directly to the model, and not to the QPointerRichard Moe Gustavsen2018-11-281-4/+6
| | | | | | | | | | | | | | | | Fixes building with gcc 4.8.4 Change-Id: I61810102bba20c21321112c63e7197bbe05ec27d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | QSGSoftwareInternalRectangleNode: Remove unnecessary loop iterationsMikhail Svetkin2018-11-271-1/+1
| | | | | | | | | | Change-Id: I95ae475cfbab432e3ac4d49384d4861185d3cb1b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | QSGSoftwareInternalRectangleNode: Reduce memory allocationsMikhail Svetkin2018-11-271-1/+4
| | | | | | | | | | | | | | | | QSGSoftwareInternalRectangleNode does not check size of the border QPixmap and always generates the new one. Change-Id: I24d5917252ae310238417cc01935b9471992e1c8 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Fix vertical alignment of images in a text documentLars Knoll2018-11-224-13/+20
| | | | | | | | | | | | | | | | | | | | | | The vertical alignment was not calculated correctly in all cases, this should fix it by retrieving the height and baseline for the current text line and doing the calculation correctly in all cases. Change-Id: I5bb650ede46dc03d51bf0f64b77dc4ca77d30fd2 Fixes: QTBUG-59310 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Igor Bugaev <freedbrt@gmail.com>
* | Fix updating of text nodes in QQuickTextEditLars Knoll2018-11-221-1/+12
| | | | | | | | | | | | | | | | | | | | | | The update algorithm wasn't working correctly if there were two disconnected dirty regions in the textNodeMap. This could happend by e.g. programatically removing text at the beginning and appending at the end. Change-Id: I3de2c8efedb03c004c4c304d130360cbdb4485b7 Fixes: QTBUG-68863 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Use msvc qmake scope where appropriateOliver Wolff2018-11-221-1/+1
| | | | | | | | | | | | | | Use 'msvc' instead of 'win32-mscv*'. Change-Id: Ic592d9b5e63529aaae0b780b00e0fce5999926a0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | QQuickText: Signal content height/width changes also when resettingUlf Hermann2018-11-202-9/+18
| | | | | | | | | | | | | | | | | | If we change the content height or content width to the initial one, we still need to signal the change. Fixes: QTBUG-71684 Change-Id: Idf6e3f89423eab3d8f5310c164c5acc5108e0d8b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Fix tiling overflow with BorderImageAllan Sandfeld Jensen2018-11-171-34/+66
| | | | | | | | | | | | | | | | | | Switch the geometry to using quint32 indexes if there are too many tiles. Change-Id: Idf51210299d14737d0d115104060d32f5754dff7 Task-number: QTBUG-58924 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.12.0' into 5.12Qt Forward Merge Bot2018-11-162-97/+1
|\ \ | | | | | | | | | Change-Id: I7623438dde316ae1e97802f91991f2e7ccc205a5
| * | Move xmllistmodel to xmlpatternsv5.12.0-beta4Frederik Gladhorn2018-11-052-97/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Latest changes moved to xmlpatterns: e08f9393acc6417598f328d7f4b7b082c5d57afa Change-Id: I7e3054a3f0f11833053746294e3b2b958047394d Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Fix more null pointer accesses in QQuickOpenGLShaderEffectMaterialCacheJüri Valdmann2018-11-122-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This amends 6c08137faf1a53db879701126608833474a2450b. Fixes: QTBUG-71705 Change-Id: I0e9ca137c039802d348af4a29146395155e497c0 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Fix null pointer access in QQuickOpenGLShaderEffectMaterialCacheJüri Valdmann2018-11-073-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a QQuickWindow is destroyed without ever being rendered, then there won't be any QOpenGLContext in QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache. Same goes for QQuickWidgetRenderControl. Fixes: QTBUG-65236 Change-Id: I2742505d147bc8444b46688170d33fbb2844f2ac Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | DesignerSupport: Fix emitComponentCompleteSignalForAttachedPropertyThomas Hartmann2018-11-052-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signal for completed for the attached Component property was no emitted correctly by emitComponentCompleteSignalForAttachedProperty(). I added a test for the correct behaivour. Change-Id: I0ebfc10e512ba5c5e2352a5f5d6be3030b43cbbc Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* | | Doc: Remove wrong return typeJoni Poikelin2018-11-021-1/+1
|/ / | | | | | | | | Change-Id: Iebd325afcfc0e892f970d450b59e0249d1fcb83f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Doc: Fix linking to Qt Quick ControlsTopi Reinio2018-10-302-3/+2
| | | | | | | | | | | | | | | | | | | | The dependency to Qt Quick Controls 2 is now simply 'qtquickcontrols'. Remove the dependency to old version 1 of Controls, and update linking to Controls examples accordindly. Task-number: QTBUG-70333 Change-Id: I2f42031ab8aea90332b8b68537654ea761e44811 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | QQWindow: cancel touch->mouse synthesis when touch is ungrabbedShawn Rutledge2018-10-302-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, each time a new touchpoint is pressed, we would purposely forget which touchpoint was acting as the mouse, as part of "starting over" with event delivery. Conceptually "starting over" ought to mean as freshly as possible; but in practice, if a user was using one finger to interact with some mouse-only Item, and then presses a second finger (whether intentionally or not), (s)he doesn't want the first interaction to immediately end. The multi-finger DragHandler must be able to take over the grab from the Item which already had the grab; but it uses a passive grab in the meantime to track the movement, and normally takes over the exclusive grab only when its preconditions are met: the point has to move past the drag threshold. So we can wait until then to reset the touchMouseId. The concrete use cases are: double-tapping a map is supposed to zoom in, even if there is a MouseArea on top. And, while dragging a Slider inside a Flickable, you should be able to start dragging the Flickable with a second finger. In the first case the issue was that the MouseArea could grab while handling the synth-event, thus setting touchMouseId; then touchMouseId was immediately reset again while handling the second touchpoint, so the second touchpoint would also be offered as a synth-mouse event to various items. But while fixing that, we have to avoid this issue in the Slider-in-Flickable case: when the first touch press is delivered, Flickable takes the exclusive grab temporarily; after moving the touchpoint, the Slider's DragHandler steals the exclusive grab. Then we try to deliver the second touchpoint press: at this time, we don't want touchMouseId to be set, because we want to be able to deliver synth-mouse events for the second point so that Flickable can grab that one. So it must be that when DragHandler steals the grab, we can reset touchMouseId, because the only reason it was set was that Flickable had the grab. This result is achieved by having QQuickItem::touchUngrabEvent() call a new QQuickWindowPrivate::cancelTouchMouseSynthesis() function. It was already a good idea to have such a function since we always reset touchMouseId and touchMouseDevice at the same time. Also modify the docs to remind users that when subclassing QQuickItem and overriding mouseUngrabEvent() or touchUngrabEvent() they should call the base class implementation, to avoid bypassing this new functionality. Fixes: QTBUG-70998 Change-Id: I02894971e9047d4fa7ac9d062d6714c9183a8058 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>