aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup obsolete references to doc/snippets/screenshotsJ-P Nurmi2017-05-041-2/+1
| | | | | Change-Id: Ia631cd493d695aaac44d612f234756b4e5b558dd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_snippets: take screenshots only when requestedJ-P Nurmi2017-05-0383-1/+0
| | | | | | | | | | | | The component loading code has been adjusted so that it can load snippets that use either a Window root element too. This speeds up the test a lot in the CI, and allows us to flatten the snippet-structure. Set SCREENSHOTS=1 environment variable to take screenshots. Change-Id: Ibd9e76befe62044dd1374899f18ea3d8c7ad454b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Use strict comparisonFrederik Schwarzer2017-05-032-2/+2
| | | | | Change-Id: I4829480765c96cf7a2ad94a223f9078f70703db4 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Mark non-default styles as depending on features.quickcontrols2-defaultStephan Binner2017-05-031-0/+2
| | | | | Change-Id: I1472d2f72cf86e2ba66c9cccffbad73061100974 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Add QQuickDrawerPrivate::offsetAt()J-P Nurmi2017-05-022-10/+15
| | | | | | | Share the duplicated logic in grabMouse() and grabTouch(). Change-Id: If53dd5dd4302009594548e94bcc5f95b352e1bf6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickSwipeDelegate: disable touch events to fix swiping on touchJ-P Nurmi2017-05-022-0/+8
| | | | | | | | Don't allow QQuickControl to accept touch events, because QQuickSwipeDelegate is still based on synthesized mouse events. Change-Id: I750ab3b602882ff9d34e013bc08ed4584482138f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Drawer: fix drag-over-threshold calculationJ-P Nurmi2017-05-021-4/+8
| | | | | | | | | | Don't steal a horizontal drag if a flickable has been dragged a long distance vertically, and then later the flick happens to exceed the horizontal drag threshold. Change-Id: Idf39997aa20cc41da561f182119199f30c63ba32 Task-number: QTBUG-60521 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix QQuickPopupPrivate::handleMouseEvent()J-P Nurmi2017-05-021-4/+3
| | | | | | | | | | | | | Touch moves are being abruptly stolen while flicking within a drawer. Looks like there's a difference between mapping mouse events to scene vs. using the window coordinates. All other places in the overlay and popups are using window coordinates, so sync with that to ensure that "drag over threshold" calculations are done based on press and move coordinates that are in the same coordinate space. Task-number: QTBUG-60521 Change-Id: Ied94870fe68a7e5da65b75d3daa585db6e5e9560 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopopPositioner: fix reposition() callsJ-P Nurmi2017-05-021-2/+2
| | | | | | | | | | QQuickDrawer still overrides QQuickPopupPrivate::reposition(), so it must be called instead of calling QQuickPopupPositioner::reposition() directly. Task-number: QTBUG-60493 Change-Id: I45ba7364c32d89d2fd128c07f68274b962467ced Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Universal: add missing importsStephan Binner2017-04-294-0/+4
| | | | | | | | | | All types that use internal types (such as XxxIndicator) must explicitly import the namespace. Otherwise the QML engine might end up doing an implicit import, which leads to URI mismatch. Task-number: QTBUG-57618 Change-Id: Ie803d32bdef287f076be233777d8fe933d5f50e2 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Material: fix editor cursor visibilityJ-P Nurmi2017-04-291-2/+2
| | | | | | | | The cursor should not be visible for read-only editors. Task-number: QTBUG-58797 Change-Id: I9e0fb0fd1c0afac31ab202e7e4ea0f8bde19372c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Don't close a popup when pressed inside and released outsideJ-P Nurmi2017-04-291-1/+2
| | | | | Change-Id: Iadf58b0c98d7410e4cc9f75f4baf42adf8c521b8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: improve the documentation for Popup’s modal propertyMitch Curtis2017-04-291-1/+11
| | | | | | Task-number: QTBUG-60358 Change-Id: I935722f0740140c30ff27192d78c6cf3586723c5 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Promote pressPoint to QQuickPopupJ-P Nurmi2017-04-284-5/+5
| | | | | Change-Id: I5aac904b7fb9397f799817ccaf5e0eb04b0129a9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add QQuickPopupPrivate::contains() for convenienceJ-P Nurmi2017-04-283-6/+13
| | | | | | | This logic seemed to be repeated in several places... Change-Id: I3b74140c7d7e44fa6ada12cf7844d96086d99e47 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: fix flicking inside drawersJ-P Nurmi2017-04-281-3/+3
| | | | | | | | The pressPoint must be stored before rejecting a press event, to be able to calculate correctly when to steal/grab move. Change-Id: I4c9225fdaf730800fec30b3f37a2a0fe773e8b03 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickOverlay: reduce one event filterJ-P Nurmi2017-04-281-52/+49
| | | | | | | | | | | | | Instead of using the window content item for detecting when mouse and touch events propagate through the item hierarchy without being accepted/handled, utilize QQuickWindowPrivate::handleMouse/TouchEvent() to deliver the respective events from the window-level even filter. That way we can unconditionally accept mouse and touch events after the delivery to the item tree, to ensure receiving the consequent mouse and touch events. Change-Id: I5f70c2e0e0d931c544461261721cc9b17ce8d3ef Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix Popup.CloseOnRelease for non-modal popupsJ-P Nurmi2017-04-272-6/+71
| | | | | Change-Id: I70ac251a02a7856e6770cdb9b3e5b2a2d027d133 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Container: document and test current index managementJ-P Nurmi2017-04-271-3/+67
| | | | | Change-Id: I368dd50a4ded743826d6dc4d25dde379c98af20d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickOverlay: add handleMouseEvent() and handleTouchEvent()J-P Nurmi2017-04-272-61/+94
| | | | | | | | To unify overlay event delivery from the child event filter and the event handlers in QQuickOverlay itself. Change-Id: I0e867baeda3a8b829fe1d1992ea8289d466afc85 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add QQuickOverlayPrivate::startDrag()J-P Nurmi2017-04-272-13/+20
| | | | | Change-Id: I9558f82cb7330e451c043e25c9a140f49eefa219 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawerPrivate::startDrag(): start delivering touch eventsJ-P Nurmi2017-04-271-16/+19
| | | | | Change-Id: If483f0787568c18712fe0d2068d26709e6dd012d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickOverlay: add return value to handlePress/Move/Release()J-P Nurmi2017-04-272-12/+17
| | | | | | | Inform the caller whether the event was handled. Change-Id: I9433164ec810f55e760960dd70e4539c5722e775 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Enable touch events for popups and drawersJ-P Nurmi2017-04-264-12/+58
| | | | | Change-Id: Icc0a496facdc2ada1c87b4b02c49a58cb9a4daec Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Revise the press/move/release handlersJ-P Nurmi2017-04-264-46/+58
| | | | | | | | | | | | Otherwise the handlers are not able to control whether presses, moves and releases should be blocked or not. a) outside a non-modal popup, b) to popup children/content, or b) outside a modal popups's background dimming Change-Id: I637295fc3122cdcddb7727ec3939ec6a68a3cf98 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popups: fix non-dimming modal background leaking events throughJ-P Nurmi2017-04-261-3/+8
| | | | | | | | | | | This piece of code, which was thought unnecessary, went missing when moved from mousePressEvent() to handlePress() in 7faafa4. It is needed after all for non-dimming modal popups, because in that case we simply cannot rely on the background dimming blocking the press... Task-number: QTBUG-60405 Change-Id: I53d89133eeae4ad8531b3c1e07c3b22295d438de Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: fix elevation of the RoundButtonNikita Krupenko2017-04-261-1/+1
| | | | | | | | | In accordance with Material Design guidelines, elevation for resting and pressed states of the raised FAB should be 6 and 12 accordingly. Change-Id: I526bb8579aa760c60e25cbeb071b912a30293615 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Eradicate QQuickDrawerPrivate::handleMouseMoveEvent()J-P Nurmi2017-04-252-45/+32
| | | | | Change-Id: I4759baa3691498fce8c291cbb0d3f77e9e2fd8d6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: move mouse/touch press handling to handlePress()J-P Nurmi2017-04-253-25/+2
| | | | | | Change-Id: I8744525e1f185fa1e58d9e5d81f233a3aad3b2e1 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Simplify QQuickDrawerPrivate::startDrag()J-P Nurmi2017-04-251-28/+10
| | | | | | | | | | | | | | The purpose is to calculate whether a press is within the drag margin ie. whether a drawer can start dragging. There seems to be no reason to call the clumsy QQuickWindowPrivate::dragOverThreshold() method, which is different for mouse and touch events. In addition to the start drag distance, it actually calculates start drag velocity too, which is entirely irrelevant for us. Instead, we can do ourselves a very simple mouse vs. touch agnostic calculation whether a press lands within the drag margin. Change-Id: I356a349fdef3df1455715ae7572dbcb9e8100f93 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: move mouse/touch release handling to handleRelease()J-P Nurmi2017-04-253-87/+66
| | | | | Change-Id: I279fe0a0c77e482a414424f90827e85a91df221a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: override handlePress/Move/Release/Ungrab()J-P Nurmi2017-04-253-13/+32
| | | | | Change-Id: Id947e868aa1c89aaab0cb6988b76f0cfe25d8339 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Pass timestamp to QQuickPopupPrivate::handlePress/Move/Release()J-P Nurmi2017-04-253-17/+20
| | | | | | | QQuickDrawer needs the timestamp to calculate velocity. Change-Id: I1ab5fc2e492948a424a8c56e4b9788fc3d489333 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopup: tryClose() via handlePress() & handleRelease()J-P Nurmi2017-04-253-93/+96
| | | | | | | | | This is a preparation step to make Drawer compatible with touch events. It will eventually override handlePress/Move/Release() to deal with both touch and mouse input. Change-Id: I8ae21f6909ca51f86f19dbe68a3e820e9af676ab Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Forward focus to the contentItem of editable spinboxesMitch Curtis2017-04-242-0/+11
| | | | | | | | | | | | This fixes the scenario where a SpinBox is shown for the first time with focus, but its editor (TextInput) doesn't have active focus. tst_focus' keyNavigation.qml had to be adjusted, as an editable spinbox will now consume key events. Task-number: QTBUG-60356 Change-Id: I3af0260a22e9633ab6110d6adab7b39a22b849de Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickDrawer: don't jump when dragging openJ-P Nurmi2017-04-241-1/+9
| | | | | | | | | | | | | | | | Typically drawer's drag margin is so small that one can barely notice that it jumps when dragging begins. On systems with larger start drag distance, or when drawer's drag margin is manually increased, the jump was noticeable and disturbing. Unfortunately several tests had to be adjusted accordingly, because they were assuming that pressing at the edge and then dragging in the middle would immediately snap the drawer. Now the tests are sending a press at the edge, first moving past the start drag distance, and then moving to the actual tested position. Change-Id: Id8badf256fd4dd51f34db76ebe03bf6b15203cd9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickRangeSlider: don't crash on press with null handlesJ-P Nurmi2017-04-241-9/+11
| | | | | | | | The handle visuals should be optional. There were a few missing checks for null pointers. Change-Id: I13e38f373428dbe0c8e338442370fbe7bb02c15a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Implement QQuickOverlay::touchEvent()v5.9.0-beta3J-P Nurmi2017-04-214-37/+94
| | | | | | Task-number: QTBUG-58389 Change-Id: I59b2936fd0c984c2dc7c1d3c49fb78c1fa950be7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Update plugins.qmltypesJ-P Nurmi2017-04-212-9/+19
| | | | | Change-Id: I106f1efad34b74af68dc59323aa6739212a78976 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix QQuickApplicationWindow::isComponentComplete()J-P Nurmi2017-04-211-1/+2
| | | | | | | | | | It has to default to true to ensure that a QQuickApplicationWindow instantiated in C++ is not stuck to false forever. When instantiated by the QML engine, it is set to false during the QML component initialization phase from classBegin() to componentComple(). Change-Id: Ieba2bbfb8fc0296b8cb28df91b12bcc55dd31bf4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix QQuickPopup::isComponentComplete()J-P Nurmi2017-04-212-2/+3
| | | | | | | | | | | | | | | It has to default to true to ensure that a QQuickPopup instantiated in C++ is not stuck to false forever. When instantiated by the QML engine, it is set to false during the QML component initialization phase from classBegin() to componentComple(). NOTE: QQuickPopupItem's visibility has to be now set outside of QQuickPopupItem constructor, because QQuickPopupItem::itemChange() calls back to QQuickPopup::itemChange(). At that point QQuickPopupPrivate::popupItem should be set. Change-Id: I96fa4ab4b2f29344c4a0d5bce5f8c7642e9db1a6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: allow passing a touch event to startDrag()J-P Nurmi2017-04-212-24/+53
| | | | | | Task-number: QTBUG-58389 Change-Id: I4fbdcc2ff4e45a4cbda3e4904c610ab1b269cba3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawerPrivate::startDrag(): remove superfluous argumentJ-P Nurmi2017-04-213-3/+3
| | | | | | | | | | Popups used to have a valid window-pointer only when they were visible, but now the window is automatically looked up from the parent item. There is no need to pass the window pointer from the overlay anymore, because the drawer already knows the window. Change-Id: I9652607217a82af2be89f6ab4490431556e3d17c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopup: implement tryClose() for touch eventsJ-P Nurmi2017-04-213-8/+41
| | | | | | Task-number: QTBUG-58389 Change-Id: I40aef785cabda228f19c74a064187df509aa9916 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Prepare QQuickPopup for touch event handlingJ-P Nurmi2017-04-213-7/+111
| | | | | | | | | Add acceptTouch() and handlePress/Move/Release/Ungrab() to QQuickPopupPrivate, similarly to the recent changes to QQuickControl. Task-number: QTBUG-58389 Change-Id: I45bc0c51f7db79d0d3291f4beee6dab45b158e8a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add .qml files to OTHER_FILES to force them visible in Qt CreatorJ-P Nurmi2017-04-203-8/+12
| | | | | Change-Id: I50f26b1a0fd5d6bc79e125e46fe9a546a3441db3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Override QQuickControlPrivate::handleXxx()J-P Nurmi2017-04-2018-557/+147
| | | | | | Change-Id: I5c5be24142a758637e18df24b43847a8c6079346 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQuickSpinBoxPrivate::handleXxx(): remove unused return valuesJ-P Nurmi2017-04-201-13/+8
| | | | | | | | Match the signature of the upcoming QQuickControlPrivate::handleXxx() virtuals. Change-Id: Iad5f5d87e1abed37880e8682175214123b0df5c7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickAbstractButton: align handleXxx() with QQuickControlJ-P Nurmi2017-04-202-19/+18
| | | | | | | | Match the signature of the upcoming QQuickControlPrivate::handleXxx() virtuals. Change-Id: Ieed3587443bea715b1b6eb2cc334130b2df7deb8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickControl: implement focus handling on touchJ-P Nurmi2017-04-2011-41/+119
| | | | | | | | | | | | | | | | | | | | QQuickControl::focusPolicy was only managed in mousePressEvent() and mouseReleaseEvent(). All controls call the base class implementations of these event handlers to get the focus policy handling "for free". Move focus policy handling to handlePress() and handleRelease() that can be re-used for touch events, and make sure that various controls call the base class implementation of touch event handlers. There's still a bit of duplication in QQuickControl::touchEvent() and the overridden handlers in sub-classes, but this will be improved step by step. QQuickControlPrivate::handlePress/Move/Release/Ungrab() are planned to be made virtual, overridden in subclasses, and only called from QQuickControl event handlers. Most mouse and touch event handlers in QQuickControl subclasses can be removed later when we get there. Task-number: QTBUG-58389 Change-Id: I7e82dc2ef49762a005c482ce1353e03cc841659f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>