aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickmousearea.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-191-1/+1
|\ | | | | | | Change-Id: Ieb48911638b5c1acdfd4dee8aa19dca9be99a1f6
| * MouseArea: fixed a crash in propagate()Liang Qi2015-11-261-1/+1
| | | | | | | | | | | | | | | | Should not propagate without window. Task-number: QTBUG-49100 Change-Id: Ieda3a8357283f8d07d4ffc0cc62c4e15645d7e5a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Fix MouseArea stealing mouse grab after release.Andrew den Exter2015-09-151-0/+1
|/ | | | | | | | | This was preventing child items from receiving a release event and making the MouseArea the mouseGrabber when the mouse wasn't depressed. Change-Id: I93a9f4d6bd94041879ea13efda40c8d1dbb63a88 Reviewed-by: Mikko Harju <mikko.harju@jolla.com> Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
* Version scrollGestureEnabled as a new propertyAlan Alpert2015-06-141-0/+1
| | | | | | Change-Id: I3408cf93a90327e8abbe2f8b7a85d8a84e24ae58 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix invocations of static methods of QGuiApplication/QCoreApplication.Friedemann Kleint2015-03-051-1/+1
| | | | | Change-Id: I7bcc209b0c6e77cf6d974af85a19487345a48975 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-0/+2
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf LICENSE.GPLv2 examples/qml/networkaccessmanagerfactory/view.qml src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4stringobject.cpp Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
| * docs: Add a link to Drag and DropArea in MouseArea's drag sectionSérgio Martins2015-02-171-0/+2
| | | | | | | | | | | | | | They are related subjects so deserve a mention. Change-Id: I52f338402c8568f54dfd4b91845f9fafa762ca4d Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* | MouseArea: add scrollGestureEnabled propertyShawn Rutledge2015-01-281-2/+32
|/ | | | | | | | | | | | | | | | | If true, scroll gestures coming from the operating system can cause wheel to be emitted; if false, only an actual mouse wheel will do that. The photosurface example demostrates the use case. 1) the flick gesture on a trackpad should flick the underlying Flickable, not zoom an individual image 2) mouse wheel should zoom an individual image if the cursor is pointing to it 3) dragging an image on a touchscreen should be possible, independently of flicking the Flickable. This means multiPointTouchEnabled should be true, so we cannot interpret multiPointTouchEnabled to mean that multipoint touch scroll gestures should be disabled. Change-Id: Ie063556866f07b3fbadc53990b110edeed532710 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* MouseArea: Fix cancelling the double click when the windows loses focusOlivier Goffart2014-09-031-0/+1
| | | | | | | | | | Without this, the next click is not received after the windows loses focus while we double clicked but not released the mouse. This may happen if the onDoubleClicked opens a new window Change-Id: I86742de2bb1ea4c9657b9d5e90472d093293177d Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Add containsPress property to MouseAreaMartin Jones2014-07-161-2/+28
| | | | | | | | | | | | | | | | It is very common to use pressed and containsMouse properties together to highlight a pressed item, e.g. property bool highlighted: pressed && containsMouse The containsPress property allows simplification and optimization of user code. [ChangeLog][QtQuick] Add containsPress property to MouseArea Task-number: QTBUG-40130 Change-Id: Ie286d431154eb37a99e57e4cf881d68d7cbbe31d Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-101-1/+1
|\ | | | | | | Change-Id: Iba61035910c46627e5e1c3824757da7b3d573657
| * Doc: correct link/compilation errors in Qt DeclarativeNico Vertriest2014-07-021-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-34749 Change-Id: I507d54b0568d77c6099a0bd99f5c369b8667032a Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-06-041-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | The merge conflict is about the removal of "d1" from the register set on ARM, but that was already done in dev in commit ddb33ee9ba9e1344caa9be5dbf4b534c3ede692e The change in src/quick/scenegraph/coreapi/qsgrenderer.cpp with commit 2414f1675eab163b22dcc4e8ded80ed04d06369b was reverted to what it was before, per Laszlo's advice. Conflicts: src/qml/jit/qv4isel_masm.cpp Change-Id: I7bce546c5cdee01e37853a476d82279d4e72948b
| * Fix potential null pointer dereferencingFrederik Gladhorn2014-05-301-1/+1
| | | | | | | | | | | | | | | | | | These were found by http://www.viva64.com/en/b/025 most issues are rather cosmetic. Change-Id: I7cc12610aae6a43d26bedb9b480863c0695ddfa3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Introduce MouseArea.drag.smoothedKevin Funk2014-05-141-1/+7
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick] Added property MouseArea.drag.smoothed for toggling whether the drag target is moved to the current mouse position after a drag operation has started. Task-number: QTBUG-38539 Change-Id: I989b51bc83fc24c64b84ac8e9a50b352e674e8f8 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-101-49/+73
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/plugins/accessible/quick/quick.pro src/quick/items/qquickpincharea.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp Manually adjusted for TestHTTPServer constructor change: tests/auto/quick/qquickimage/tst_qquickimage.cpp Change-Id: I5e58a7c08ea92d6fc5e3bce98571c54f7b2ce08f
| * Doc: Fix broken \qmlsignal linksSze Howe Koh2014-03-181-2/+2
| | | | | | | | | | | | | | | | Fix the breaks caused by the re-categorizing of \qmlsignal pages Task-number: QTBUG-35846 Change-Id: I528ae16ec522fc902133e22d8f53c87a7f0d56ad Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Doc: Document signals (not handlers) under \qmlsignalSze Howe Koh2014-03-181-47/+71
| | | | | | | | | | | | | | | | Append the handler names to the end of the corresponding signal doc. Task-number: QTBUG-35846 Change-Id: I3d627ba7ed5be94e5c402ab092b4d582536499e8 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Document that MouseArea::enabled is not the same thing as Item::enabled.Robin Burchell2014-05-071-0/+4
|/ | | | | | | | This might change in the (long) future, but not yet. Task-number: QTBUG-38364 Change-Id: Ia424d6b5d54dff88f67b39e4521b5ecc3121fd07 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* MouseArea: make clear containsMouse requires the cursor to be insideShawn Rutledge2014-03-071-1/+2
| | | | | | | Task-number: QTBUG-37133 Change-Id: I5d0943963bf423c3f930365502e42b54a71d9e88 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-241-0/+1
|\ | | | | | | | | | | | | Conflicts: src/quick/items/qquickrectangle.cpp Change-Id: Ia40bc0f2f08b5be68e32eb1e1f118445d20e44fc
| * QtQuick docs: add missing \qmlpropertygroup commandsJ-P Nurmi2013-12-201-0/+1
| | | | | | | | | | | | | | "warning: No QML property group command found; using..." Change-Id: Iafbdbc09cbd76bf81a5baf3a5a4fab843778b5cb Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-161-0/+6
|\| | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickitem.cpp src/quick/items/qquicktext.cpp tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I0bc5786098193c2c40b6fd8905de75d90f6ed0cf
| * When the MouseArea loses grab, an active drag should be cancelled.Robin Burchell2013-11-301-0/+6
| | | | | | | | | | Change-Id: Icc784dd3265c211d9b077b692464591a41976354 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | Use platform specified duration for triggering MouseArea::onPressAndHold.Michael Brasser2013-12-121-3/+2
|/ | | | | | Task-number: QTBUG-24793 Change-Id: Ib663197eac46a17bfc73aaa945a6a2d52beb0b38 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Don't propagate mouse events to disabled MouseAreasAlan Alpert2013-11-051-1/+1
| | | | | | | | Task-number: QTBUG-34368 Change-Id: I28d4f57e51300f12a7bab5d215933762102f3916 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-30/+30
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: Fixed and updated Qt Quick's \qmlmodule pageJerome Pasion2013-09-251-1/+1
| | | | | | | | | | | -incremented version to Qt Quick 2.2 (in \qmlmodule page) -import changed to QtQuick 2.2 -\inqmlmodule no longer needs the version. QDoc will ignore the version but it is better to remove it now to avoid confusion Task-number: QTBUG-32172 Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Expose drag threshold in MouseAreaJens Bache-Wiig2013-09-131-5/+7
| | | | | | | | | | | | | | | | | | | | In several cases such as for creating a Slider, it is useful to have a 0 pixel threshold in order to initiate a drag operation. We have previously hardcoded this to a platform dependent (usually 10 pixel) value for MouseArea. Note that we have no way of indicating the version/revision number in a grouped property for documentation at the moment. In addition we deliberately had to remove the REVISION from the property because it is blocked by QTBUG-33179. However, since this is not a user-creatable type it should not cause any issues in practice. This patch adds MouseArea.drag.threshold in order to improve on this. Change-Id: Ia4871e64fab39e30c4494f00be99ad38cdd630df Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Add support for external drag and drop in Quick items.Chris Meyer2013-09-091-131/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add dragType enums with values of None, Automatic, Internal (default). Setting to Automatic allows startDrag to be called automatically. Setting to Internal (default) retains old behavior. Add mimeData to Drag item to enable external drags. Call startDrag to start drag manually or change from internal drag to external drag. Added events dragStarted and dragFinished that get invoked from startDrag. Mime data must be specified in the mimeData property as mime-type / data pairs. Moved QQuickDrag from qquickmousearea* files to qquickdrag* files to reduce header interdependencies that caused linking errors in other modules and also to improve code organization. Allow DropArea to receive and process external data. Introduced new variable containsDrag to QQuickDropAreaPrivate. This replaces mimeData which was previously being used to determine if a drop operation was currently occurring. The problem was that mimeData was being externally destructed. Also introduced accessor methods for getting color, html, image, text, and urls out of the drop. This facilitates dropping of external data of those types onto a DropArea. Added example quick/externaldraganddrop. Task-number: QTBUG-27498 Change-Id: I1420df7c161ea3399e49a23305273e106baa246f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Explicitly call setCursor in the QQuickMouseArea constructorDaiwei Li2013-08-271-0/+6
| | | | | | | | | | | | | | QQuickItemPrivate has a boolean hasCursor that is used by QQuickWindow to determine whether to use the cursor for an item. QQuickMouseArea has a default cursorShape of Qt.ArrowCursor that is ignored due to hasCursor not being set. Thus, call setCursor in the QQuickMouseArea constructor to sync the cursor state of the QQuickItem and the MouseArea. Task-number: QTBUG-33157 Change-Id: I56402564bd72bdc89d6ef8e5bc75bfd07c096202 Reviewed-by: Josh Faust <jfaust@suitabletech.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fix hover after press eventFrederik Gladhorn2013-04-271-1/+2
| | | | | | | | | | | | | | | When a mouse press event was rejected, we would unconditionally cancel the hover and claim that the mouse is not contained any more. Instead check if the mouse left and only then cancel the hover state. Task-number: QTBUG-30783 Change-Id: I5fac6f3a1f2807ef03e07982c603492d40d2a249 Reviewed-by: Florian Boucault <florian@boucault.net> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Simplify setting of hoverFrederik Gladhorn2013-04-261-5/+1
| | | | | Change-Id: I620dad5a07749a25c97f5c17e8f7f552593cfd2d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Smooth dragging an item with MouseArea.Andrew den Exter2013-03-141-0/+1
| | | | | | | | | | Calculate drag distance relative to the mouse position when a drag is detected rather than the press position so there isn't a large change in position on the first move. Task-number: QTBUG-30188 Change-Id: I5c2269c2228668a3842e18f65167637497b3beb4 Reviewed-by: Joona Petrell <joona.petrell@jollamobile.com>
* MouseArea shouldn't grab the mouse until there is an effective drag.Andrew den Exter2013-02-221-30/+19
| | | | | | | | | | A MouseArea shouldn't prevent a parent MouseArea or Flickable from handling a drag event unless it is going to do something useful with it. Task-number: 29717 Change-Id: I24016994f6cf9116382ef7faeb50b10e5716e10e Reviewed-by: Alan Alpert <aalpert@rim.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Compile with QT_NO_WHEELEVENT.Volker Krause2012-12-191-0/+2
| | | | | | | | Change-Id: I2fbe6f45ba50e3db75bd02cfca47ddabfcd5fc49 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add a hidden XandYAxis enum valueAlan Alpert2012-12-151-2/+2
| | | | | | | | | For Qt 5 XandYAxis is being renamed to XAndYAxis to more consistently follow capitalization rules. Add an undocumented XandYAxis variable to ease porting. Change-Id: Id9e41dd5578373f5f557937da889a9326ff12e53 Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Renamed QQuickItem::pos property to positionShawn Rutledge2012-11-291-4/+4
| | | | | | | | | Abbreviated property names are less descriptive so we don't have many of them. Might as well be consistent. QWindow::pos was already renamed. Change-Id: Ib52673e68e7dc902b2f8942dba6b899074b2538b Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Remove interim compatibility measuresAlan Alpert2012-10-161-1/+1
| | | | | | | | Also update some variables in qtdeclarative which failed to update rootItem->contentItem. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d3 Reviewed-by: Alan Alpert <416365416c@gmail.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix uses of various qml doc commandsBea Lam2012-08-081-2/+2
| | | | | | | | | | | | | | Signals documented with \qmlsignal should indicate handler name, i.e. 'onSignal' rather than 'signal'. Methods documented with \qmlmethod do not need to document 'void' return values. Also the name of any documented attribute should be qualified with 'QtQuick2::<qmltype>'. Change-Id: I206dd9e8f39c3b84e029ae9d4101b05d0bfb3478 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* MouseArea doc improvementsBea Lam2012-08-071-24/+59
| | | | | | | | | Add example for propagateComposedEvents, and shorten the description of this property in the main type docs as it's discussed in detail in the property docs. Change-Id: I6bc0acd537184c9dd8b5a22bcbc3fd044e10a2cd Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Doc: QQuickMouseArea::acceptedButtons() accepts ALL MouseButtonsstockton2012-08-031-10/+10
| | | | | | | | | | | | setAcceptedButtons() can make a MouseArea respond to any/all of the Qt::MouseButtons defined in Qt5. (27 possible buttons, not just Qt::LeftButton | Qt::RightButton | Qt::MiddleButton) Task-number: QTBUG-26735 Change-Id: Ib48e5b02eb64c65050b9020b99d917e472328a30 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Doc: Changed \qmlclass to \qmltype and added \instantiates.Jerome Pasion2012-07-301-1/+2
| | | | | | | | | | -To simplify QDoc, \qmlclass is now \qmltype. -'\instantiates <C+++ class>' is for the types that are defined in C++. Change-Id: I29242d33daf7b972d8b86a356b9689638866b950 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Fix resolution of cursor when items are overlapping.Andrew den Exter2012-07-261-17/+8
| | | | | | | | | | | | If MouseArea with cursorShapes are overlapping then cursor shape of the foremost item under the mouse cursor should be shown, but because the hover events are delivered to the foremost items first the opposite is occuring. This makes QQuickWindow responsible for correctly setting its own cursor instead of relying on items to work it out amongst themselves. Change-Id: Iedf144c583dfa3d1ff441e19db9601b5e171902a Reviewed-by: Martin Jones <martin.jones@nokia.com>
* QQuickCanvas renamesAlan Alpert2012-07-171-12/+12
| | | | | | | | | | | | | | | | QQuickCanvas is now called QQuickWindow QQuickCanvas::rootItem is now QQuickWindow::contentItem QQuickItem::canvas is now QQuickItem::window QQuickItem::ItemChangeData::canvas is also renamed window QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow The functions related to the color property have dropped the clear from their names. The first three changes have interim compatibility measures in place to ease the transition. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2 Reviewed-by: Martin Jones <martin.jones@nokia.com>