aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Doc: reorganize the style imagesJ-P Nurmi2017-06-0716-71/+40
| | | | | | Task-number: QTBUG-60995 Change-Id: I3083a7a2bb39d242f31a9c5d0bfed66dbdb88202 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix font inheritance for popupsJ-P Nurmi2017-06-073-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) First of all, Popup's QObject-parent depends on the way the Popup is declared in QML, or what is passed as a parent to createObject() when creating dynamic instances. For example: - Popup becomes a QObject child of of the contentItem: ApplicationWindow { Popup { } } - Popup becomes a QObject child of the window: ApplicationWindow { Item { Popup { } } } - Popup becomes a QObject child of the specified parent: ApplicationWindow { Component { id: component Popup { } } Component.onComplete: component.createObject(overlay) } Since QQuickWindow and QQuickView did not set the QObject-parent of their contentItem and rootObject, respectively, we had troubles finding popup instances, because window->findChildren<QQuickPopup>() and window->contentItem()->findChildren<QQuickPopup>() would produce inconsistent results. This has been fixed in qtdeclarative commit af6655885, so now we can use window->findChildren() reliably. 2) Popups inherit font from the associated window, not the parent item. It was wrong to call resolveFont() in setParentItem(), because the parent item might not change even though the associated window does. The piece of code was moved to setWindow() instead. 3) QQuickPopupItemPrivate::resolveFont() did not propagate the default font at all when the font was resolved before being associated to a window. 4) After the above fixes had been applied, to ensure that popups always inherit fonts and propagate them down to children as appropriate, we got a new test failure in tst_controls::Popup::test_font() indicating that there were extra font change notifiers triggered at creation time. This was fixed by associating "top-level" popups with the window as soon as they are appended to ApplicationWindow's default property, instead of waiting until the popup is complete and then doing a lookup in the parent hierarchy. Task-number: QTBUG-61114 Change-Id: I6185c76d50835cb7a06b03db0a3ac9ddad64bdd3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Let users disable the multi-touch supportJ-P Nurmi2017-06-0725-1/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | The newly added multi-touch support can create issues, especially together with Flickable that is unfortunately still not properly touch-compatible. The implementation is still based on synthesized mouse events, so things like Flickable::pressDelay that intercepts mouse presses and re-sends sends them after a delay, does not play well with touch-enabled controls. The easiest way we can disable the whole thing is to make multi- touch support a configurable feature, the same way hover support is. ./configure -no-feature-quicktemplates2-multitouch [...] Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... no [ChangeLog][Templates] Added a configure feature for disabling multi- touch support (configure -no-feature-quicktemplates2-multitouch). Task-number: QTBUG-61144 Change-Id: I0003ae925c2a499ecb3e2a5b720088bd963d9ad3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix QQuickStyle::availableStyles()J-P Nurmi2017-06-071-3/+6
| | | | | | | | | Filter out macOS debug symbol (.dSYM) directories from the list of available styles. Task-number: QTBUG-60973 Change-Id: I5b9c3f4af946d44b1601f32bf7da699c29a86689 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add missing QQuickMenu::defaultFont()J-P Nurmi2017-06-072-0/+8
| | | | | Change-Id: I74e512074cbc66378ffd71f8040ae8977a3ffeac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ComboBox: fix empty popup being shown after model is clearedMitch Curtis2017-05-313-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, ComboBox's popup is sized vertically in this way: implicitHeight: contentItem.implicitHeight Adding an item to a ComboBox with an empty model and then opening the popup results in the implicitHeight being used in the line below (in QQuickPopupPositioner::reposition()): QRectF rect(p->allowHorizontalMove ? p->x : popupItem->x(), p->allowVerticalMove ? p->y : popupItem->y(), !p->hasWidth && iw > 0 ? iw : w, !p->hasHeight && ih > 0 ? ih : h); An explicit height was never set on the popup, and ih (the implicitHeight of the popupItem) is greater than 0. This is fine. However, when a ComboBox's popup item grows large enough that it has to be resized to fit within the window, its explicit height is set. The problem occurs when the model is then cleared, as the implicit height of the popup item becomes 0. So, while "!p->hasHeight" is still true, "ih > 0" is not, and the explicit height of the popup item is used, which is still the previous "let's fill the entire height of the window" size. To fix this, we bind the height of the popup to a different expression: height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) This ensures that the popup has a zero height when the ListView's implicitHeight is zero (i.e the model is empty), and a height that fits within the window in all other cases. Ideally, we'd have a maximumHeight property that controls this, but for 5.9, we have to fix it this way. Task-number: QTBUG-60684 Change-Id: Ied94c79bb7b0e693be34e9c7282d991f6f704770 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Page: fix initial layouting of dynamically created instancesJ-P Nurmi2017-05-312-0/+9
| | | | | | Task-number: QTBUG-61109 Change-Id: I43d28a80ec1a46e836fa8a0f76ee65b0c1a24228 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: improve margin documentationMitch Curtis2017-05-313-151/+436
| | | | | | | | | | - Add margins to the Popup Layout diagram. - For each margin property, mention that margins are the distance between the popup edge and the window edge. - Link to Popup Layout from each margin property. Change-Id: I8226ea341f6825b7cfe67e1427ce853671e5a54e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-315-18/+32
|\ | | | | | | Change-Id: Iba044084bf82f6b2b8ceba4aa2a80bdcf8fc38e0
| * QQuickComboBox: fix crash on popup destructionv5.9.0-rc2v5.9.0-rc1v5.9.0J-P Nurmi2017-05-191-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f19e2d5f changed the QQuickComboBox destructor to call setPopup(null) instead of deleting the popup directly. The reason for this change was that setPopup() did not only destroy the popup but also disconnected the visibleChanged() signal to avoid spurious highlightedIndexChanged() signal emission during ComboBox destruction. There was an undesired side-effect with this change: it ended up calling destroyDelegate() during destruction, potentially accessing a destroyed QML context. Switch back to the old way, and disconnect visibleChanged() in place instead. Task-number: QTBUG-57650 Task-number: QTBUG-50992 Change-Id: I49d96710815dfc163e75a7ff82fe0e4742cfbb59 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Fix drawers not to be touch-draggable through modal popup shadowsJ-P Nurmi2017-05-082-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Material style popups have a shadow outside the popup. QQuickOverlay cannot block press events to children of a popup, because otherwise interacting with popup contents would be impossible. However, since the shadow is outside of the popup, touch events don't propagate to the popup and get naturally blocked by the popup background. Instead, the touch event propagates to the overlay. At this point, we must do an additional check whether we're allowed to start dragging a drawer. Task-number: QTBUG-60602 Change-Id: I9b5c81246bca7ea40bce0e46dc2e94558a0b9204 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Drawer: fix dragging from the inside over interactive contentsJ-P Nurmi2017-05-082-3/+6
| | | | | | | | | | | | Task-number: QTBUG-60598 Change-Id: I65e6e9440c9450fbec4a53b9ee60e11b919c090a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Doc: add the Qt version to "\since QtQuick.Controls 2.x"J-P Nurmi2017-05-3019-59/+59
| | | | | | | | | | Change-Id: Ia7f237cb580bf9c332ff4741569a57fef4eb6079 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Material: round ripple translation to avoid artifactsJ-P Nurmi2017-05-301-1/+1
| | | | | | | | | | | | Task-number: QTBUG-58646 Change-Id: Iae5777866099139ec850af8d2c6f5c095ef9f166 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add sections and update purposes of featuresStephan Binner2017-05-302-3/+6
| | | | | | | | | | | | Change-Id: I5beb6770ef3cea097c4baa8384e25f43190fdd9d Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickSpinBox: set "editable" accessible propertyJ-P Nurmi2017-05-222-0/+11
| | | | | | | | | | | | Change-Id: I8b627757f27e861d5f46c72631e6ad554551f607 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | QQuickComboBox: set "editable" accessible propertyJ-P Nurmi2017-05-221-1/+4
| | | | | | | | | | | | Change-Id: I6db93b5bbf46a8356ebb03f4e9c814cd00642026 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | QQuickStackView::clear(): don't emit depthChanged() when already emptyJ-P Nurmi2017-05-221-0/+3
| | | | | | | | | | Change-Id: Ib20995b86e776cb64a3d1fa6dea01dee4a802426 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Enable build time QML caching for the Material & Universal stylesJ-P Nurmi2017-05-202-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | We had troubles enabling Qt Quick Compiler support for these styles, because we wouldn't be able to select style-specific .qml files from the resources of an unloaded/uninstantiated plugin. Build-time QML caching doesn't seem to be a problem because the .qmlc files are not built into resources but are available on the file system. Task-number: QTBUG-58571 Change-Id: I93e7a82a72c4bcf3a92c7ca12186f24a22d4d342 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Enable the use of QML caching at build timeSimon Hausmann2017-05-192-0/+4
| | | | | | | | | | | | Task-number: QTBUG-58571 Change-Id: Ia6aeb27d4af695fcfc987e944c73d49364fd440e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | ScrollView: fix default Flickable content item creationJ-P Nurmi2017-05-193-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Short version: do not emit contentItemChanged() while contentItem() is being called to avoid binding loops. Long version: ScrollView is a thin wrapper around Flickable, and when necessary, instantiates a Flickable behind the scenes. However, ScrollView cannot instantiate one unconditionally, because it has to work with existing Flickables, such as ListView and GridView, too. ScrollView { Item { } } // creates a Flickable ScrollView { Flickable { } } // does not create a Flickable ScrollView { contentItem: Flickable { } } // does not create a Flickable When a Flickable is created behind the scenes, it is assigned as the contentItem of the ScrollView. However, when the Flickable is created lazily as a result of ScrollView::contentItem being accessed, it must NOT emit contentItemChanged() while the contentItem() getter is being called, because that results to a binding loop. This problem was exposed by the recent attempts to enable QML caching at build time (QTBUG-58571). Change-Id: I712f2f30da454a6c22a722afe8a00ae240733571 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Doc: add missing "is" to the Default style docsJ-P Nurmi2017-05-191-1/+1
| | | | | | | | | | Change-Id: I85d28c1a0651317a684b2cc34f1f032e8221b27c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | qtquickcontrols2-styles.qdoc: align indentationJ-P Nurmi2017-05-191-1/+1
| | | | | | | | | | Change-Id: I42bbc0f491653f45a19455a2e4c5afbd7be008ef Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | ApplicationWindow: fix access to revisioned members in base classesJ-P Nurmi2017-05-184-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The inheritance hierarcy is: QWindow <- QQuickWindow <- QQuickWindowQmlImpl <- QQuickAppWindow Each base class has its own set of revisioned members. Import the revisioned members in the base classes to the templates/controls namespace by calling qmlRegisterRevision() with the revision of the base class and the respective templates/controls version. Task-number: QTBUG-60893 Change-Id: I6d91209dc5b2eb17c2b3845675a5ddbffb7e8b72 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | controls.pri: cleanup a superfluous backslashJ-P Nurmi2017-05-151-1/+1
| | | | | | | | | | Change-Id: Ie762b157591f200624c4393246478edb67a9077e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Doc: make the list of topic pages lighter to readJ-P Nurmi2017-05-151-9/+9
| | | | | | | | | | Change-Id: I9b46b32f0f2dc48c45c4e83d44cdc8bf3fc56184 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Default: fix typo in RangeSlider::second.handleJ-P Nurmi2017-05-151-1/+1
| | | | | | | | | | Change-Id: If09b6ecd7426ddfd5a80fc33acf17894bf9e7af5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix unresolved external symbols for -no-feature-shortcutStephan Binner2017-05-061-0/+8
|/ | | | | Change-Id: I3ddef9df6100b8837d1bdc81f3fd1dc7cf37babf Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* 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>