aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QQuickSpinBox: emit valueModified() on long pressJ-P Nurmi2017-06-161-23/+28
| | | | | | | | | | Move the emit inside QQuickSpinBoxPrivate::setValue() to avoid having to store and compare the old value in so many places where the value changes are interactive (mouse, keys, wheel). Task-number: QTBUG-61426 Change-Id: I7f42fc09cafc403eb55a9748e3a93c2e9bf6df62 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ScrollBar: fix flashing in Material & Universal stylesJ-P Nurmi2017-06-162-0/+2
| | | | | | | | | | | | | | | Ensure a suitable starting opacity for the inactive state transition. When calling increase() and decrease() from key-handlers, as the docs suggest, we flash the scrollbar by turning the active state on, and then back off immediately. If there is an opacity animation when the scrollbar becomes active (Material & Universal), the opacity animation is stopped right away, because the state changes back to inactive. This state changing trick worked only with the Default style, because it changes the opacity without animating when it becomes active. Change-Id: I4117de79c7145a710c0b6c43873ca2336b64e21e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix typo in code comment in qquicktumblerview.cppMitch Curtis2017-06-131-1/+1
| | | | | Change-Id: Ie12bbad5981af263d5dc8fcbb0e7674b9e823132 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* ComboBox: fix QObject list value modelsJ-P Nurmi2017-06-121-0/+4
| | | | | | | | | | | | | When ComboBox::model is bound to a QObjectList property, the effective type of the model is QVariant(QQmlListReference) and things work as expected. When a similar QObjectList is constructed by hand in JS, or returned from an invokable method, the effective type of the model is QVariantList(QObjectStar) instead. In this scenario, we have to help QQuickComboBoxDelegateModel::stringValue() to lookup the property that matches the given textRole. Change-Id: Ib44c912cf647e1cd98c5608436427d31caf80d97 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickMenu: fix key navigationJ-P Nurmi2017-06-092-9/+30
| | | | | | | | | | | Skip non-focusable separators, and use a key focus reason (Qt::TabFocusReason & Qt::BacktabFocusReason) to give the items visual focus. [ChangeLog][Controls][Menu] Fixed key navigation to skip separators. Change-Id: I99affabc50703c7363ab8146e5ced9b45111de00 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix QQuickMenuPrivate::itemSiblingOrderChanged()J-P Nurmi2017-06-081-1/+5
| | | | | | | | | | | QQuickContainer was fixed in the previous commit. Apply the same fix to QQuickMenu, because the code is based on QQuickContainer. I'm not able to make QQuickMenu crash with the same test case adapted to QQuickMenu, though. QQuickMenu already has tests for Repeater in tst_menu.cpp. Task-number: QTBUG-61310 Change-Id: I3fba1b7ef15659724880df080dab5015eae484a3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix QQuickContainerPrivate::itemSiblingOrderChanged()J-P Nurmi2017-06-081-1/+5
| | | | | | | | | Repeaters are not part of the content model. Exclude them when calculating the target index when the order of items changes. Task-number: QTBUG-61310 Change-Id: Iaedd59288ed38e985a34ed8e1f515fdfb50d74e6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make QtQuick.Controls::ButtonGroup a composite typeJ-P Nurmi2017-06-084-4/+49
| | | | | | | | | | | This is a backport (only the ButtonGroup part) of 1af7f8a59, which was already pushed to dev. The main motivator for the original patch was to cleanup the registration code, but this fixes also an issue with auto- completion in Qt Creator. Task-number: QTCREATORBUG-18321 Change-Id: I5e8e8122cb94c74f78445cce1a89f604634149b1 Reviewed-by: Marco Benelli <marco.benelli@qt.io>
* 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>