aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix qdoc linking errorJ-P Nurmi2017-07-271-1/+1
| | | | | | | | | qtbase commit 237c867 removed the "Fusion Style Widget Gallery" topic. Link to "Qt Widget Gallery" which contains a screenshot of the Fusion style. Change-Id: I59a7fe238ea2090fed76a1ce022e7b844083e925 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: update MenuBar in the type comparison tableJ-P Nurmi2017-07-271-1/+3
| | | | | Change-Id: Icb63953315926d0126d2154ef2942791726621fd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Introduce MenuBarJ-P Nurmi2017-07-2631-12/+2109
| | | | | | | | | | | | | | MenuBar is an ordinary Item. It can be located basically anywhere, but the idea is to introduce a new ApplicationWindow::menuBar property in a follow-up commit. Currently the example snippets are using the header property. [ChangeLog][Controls][MenuBar] Introduced a MenuBar control. Task-number: QTBUG-60350 Change-Id: Ie66dc457a3d8edbe8362fab2a591dc49442c95e2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickMenu: make sure to stop the hover timer when closingJ-P Nurmi2017-07-211-0/+2
| | | | | | | | This seems to be one of the reasons why tst_QQuickMenuBar has had troubles in a busy CI environment. Change-Id: Ifa20c309eac86e8f47ba0a8c3da76a58f00465cb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-07-216-16/+18
|\ | | | | | | Change-Id: Idb1895dae2870dbed860ba3106fe52b01d733504
| * Fix QQuickControlPrivate::getContentItem() overridesJ-P Nurmi2017-07-144-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When no content item is explicitly assigned, container type of controls (Page, Pane, Popup...) create a default content item on demand. Notice that the content item is created from within the contentItem() getter, so it must not emit contentItemChanged() to avoid binding loops. QQuickControl::setContentItem_helper() was introduced in 1eaebd0 to mitigate basically the same problem with QQuickScrollView, which has its own special lazy creation of a Flickable content item. Now, the problem is that the other container controls are not executing setContentItem_helper(), because they have already assigned contentItem and therefore it returns right away. Fix the issue by returning the new content item without assigning it to let setContentItem_helper() do its job. The issue was spotted while debugging QTBUG-61434. Change-Id: Id6f84748ec08bbdfd3bd934dda627e2619af7d2a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Fix unused parameter errors in qwidgetplatform_p.hJason Erb2017-07-141-0/+6
| | | | | | | | | | | | | | Task-number: QTBUG-61950 Change-Id: Idbc6bcc8f08dcccc50b409a055ab6c35e1f9aef8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * QQuickDrawer: fix multi-touch leaking through modal overlayJ-P Nurmi2017-07-142-4/+4
| | | | | | | | | | | | | | | | | | | | The first touch point was blocked as appropriate, but the consequent touch points were leaking through to other popups below Drawers' modal overlay. Task-number: QTBUG-61581 Change-Id: I1c3e28e3d25b7489c4a9b684107fd1b5158e1674 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * QQuickPageIndicatorPrivate: add missing overrideJ-P Nurmi2017-07-111-1/+1
| | | | | | | | | | | | | | | | | | Somehow this passed the 5.9 CI, but the dev branch throws an error: qquickpageindicator.cpp:110:10: error: 'itemChildAdded' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] Change-Id: I2effeb908552fa2759057cf0953ea65737be3f9a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: get rid of openSubMenu()J-P Nurmi2017-07-142-19/+16
| | | | | | | | | | Change-Id: I8125971dd91614984379e734af21f5ff28852667 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Make QQuickMenu::popup() available in C++J-P Nurmi2017-07-132-24/+41
| | | | | | | | | | | | | | | | | | This is going to be used for sub-menus by QQuickMenu itself, by the upcoming QQuickMenuBar, and allows users to implement their own Menu navigation if desired. Change-Id: I29258e78fec27e8dd207ed649958df1a718bcd39 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: close non-cascading parent menu from prepareEnterTransition()J-P Nurmi2017-07-131-4/+3
| | | | | | | | | | Change-Id: I075241c07702d1e8bbc89c43cef35525d9e67cc7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: resolve the parent itemJ-P Nurmi2017-07-132-7/+33
| | | | | | | | | | | | | | | | | | | | | | | | A cascading sub-menu is parented to the menu item in its parent menu, but a non-cascading sub-menu is parented to the parent menu's parent item to be able to have the sub-menu visible while the parent menu is hidden (non-cascading menus are opened and closed one by one). Based on these conditions, resolve the parent item automatically instead of doing it by hand in openSubMenu(). Change-Id: I5dd38ee0978604cd604dabf6f40ac4fb5f3eebbe Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickMenu::countJ-P Nurmi2017-07-122-0/+18
| | | | | | | | | | | | | | [ChangeLog][Controls][Menu] Added "count" property. Change-Id: I42971a6bf8fd74b9f2d3df52f191b66cd7022b81 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: override reposition() to position sub-menusJ-P Nurmi2017-07-122-6/+18
| | | | | | | | | | Change-Id: Ia63148beee6b574e435a120be245601b3a0b3322 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: control allowHorizontalFlip from prepareEnterTransition()J-P Nurmi2017-07-121-3/+5
| | | | | | | | | | Change-Id: I0444e3e9137e1b71cdd16c35dc7cc47875937a22 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickMenuPrivate::setParentMenu()J-P Nurmi2017-07-123-6/+31
| | | | | | | | | | | | | | | | To help propagating the cascade-property automatically, instead of doing it manually in openSubMenu() that we're trying to get rid of. Change-Id: I3a3d59cafccc85d6affc325eb60e717e22b8f812 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: fix overlay change notifier signalJ-P Nurmi2017-07-121-1/+1
| | | | | | | | | | Change-Id: Ia8ffca05d6eba5214dec3a4675be0f7a109f06bd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: control close policy from prepareEnterTransition()J-P Nurmi2017-07-122-3/+16
| | | | | | | | | | | | | | Moving stuff away from openSubMenu() until we can remove it... Change-Id: I0a979a6a0de25584a213b59e1d29d3b9f78b184e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu::popup(): allow a parent argumentJ-P Nurmi2017-07-121-15/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parent argument is handy for sharing a single context menu instance for multiple listview items: ListView { delegate: ItemDelegate { onPressAndHold: contextMenu.popup(this) } Menu { id: contextMenu } } Change-Id: I77ff87ee03d2d1b53485863ab9c99f3226496dfc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickPopup: add reset-method for parentJ-P Nurmi2017-07-122-7/+12
| | | | | | | | | | Change-Id: Ia7d205bacf4da4cb13e31ab34fb62d13a77f7ddd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickMenu::dismiss()J-P Nurmi2017-07-113-36/+56
| | | | | | | | | | | | | | | | | | [ChangeLog][Controls][Menu] Added a dismiss() method. Unlike close() that only closes a menu and its sub-menus, dismiss() closes the whole hierarchy of menus, including the parent menus. Change-Id: Ibde2102bbb542a5deefdf17843496b7b80021db4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: cleanup focus handlingJ-P Nurmi2017-07-111-10/+3
| | | | | | | | | | | | | | | | Since 744164e6, there is no more need to manually transfer the focus when dealing with nested menus. Change-Id: I8e283b2ef4501aa36d57b3e06190237a1fee7133 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-07-1116-120/+218
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/controls/data/tst_scrollindicator.qml Change-Id: I1f5581ae7814c0d4152e4c9b79a30a8af5a3a17b
| * Fix focus handling for popupsJ-P Nurmi2017-07-111-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | When a popup is closed, if there are multiple popups open, restore focus to the next popup in chain instead of transferring focus to the window content. This allows us to cleanup the custom focus handling for sub-menus in dev. There is no more need to manually transfer focus to the parent menu or to a sub-menu, but calling open() or close() is enough and the focus is automatically transferred as expected. Change-Id: I54406c7c6b8dd25af261e00ebb1ae00ccbea8b9f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Add color and styleColor to property editor for LabelThomas Hartmann2017-07-101-0/+24
| | | | | | | | | | | | Change-Id: Ie8ecc3874a61b29083e53441c3f484b94195ec46 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Drawer: ignore and warn about invalid edge valuesMitch Curtis2017-07-072-6/+21
| | | | | | | | | | | | | | | | | | This fixes an issue where an application would crash when opening a drawer by dragging it after an invalid edge value had been set. Task-number: QTBUG-61843 Change-Id: Ie9b9ea0276b356b92927b858f2be355bfc042afb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Tumbler: fix regression with currentIndex and currentItemMitch Curtis2017-07-074-45/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2c4b2d48 made Tumbler's wrap property follow its count by default, but did so using updatePolish() to account for the use case where a items are appended to the model in a for loop, as is done in TumblerDatePicker.qml in Tumbler's auto tests. This (appending items one at a time in a for loop) is not a good idea, but it should work. The problem with the solution is that the delay means that the use cases mentioned in the referenced bug report were broken. This patch removes the delay. The recursion guards are necessary due to the complex nature of TumblerView (and its non-standard use of the Qt Quick views), as they prevent a memory leak in QQuickListView::createHighlight() from being introuduced. We now call deleteLater() to ensure we do not interfere with the views' internal operations, and hence we also perform a few extra operations at the same time as insurance (although it appears that simply unparenting the internal view from QQuickTumblerView is enough to get the tests to pass). Task-number: QTBUG-61374 Change-Id: Ifef9e99522ea183b282ac862f346beaed12d0c09 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Remove redundant code in touch event handlersJ-P Nurmi2017-07-072-26/+2
| | | | | | | | | | | | | | | | | | | | | | QEvent::TouchUpdate can contain touch points in any states. It iterates the list of points and calls handlePress/Move/Release(). We can re-use the same handling for QEvent::TouchBegin() (pressed) and QEvent::TouchEnd() (released). This change does not fix anything but makes the next steps easier. Change-Id: I29edd949579ab6a4bf923e455a1ef38adb05e3a5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Fix modal overlay to block multi-touchJ-P Nurmi2017-07-042-4/+9
| | | | | | | | | | | | Task-number: QTBUG-61698 Change-Id: I46db5e9816190ac7afd6b671198dff11089bc4f3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * ScrollIndicator: don't block touchJ-P Nurmi2017-07-042-0/+11
| | | | | | | | | | | | | | | | | | | | | | Unlike with mouse events there's setAcceptedMouseButtons(), currently there's no way to control whether a control receives touch events or not. As a temporary workaround until QQuickItem::setAcceptTouchEvents() has been added, we'll have to ignore touch events by hand. Task-number: QTBUG-61785 Change-Id: I9a678570bfdd104ae32b4040ecef7625dcfd1aee Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * BusyIndicator: don't block touchJ-P Nurmi2017-07-042-0/+11
| | | | | | | | | | | | | | | | | | | | | | Unlike with mouse events there's setAcceptedMouseButtons(), currently there's no way to control whether a control receives touch events or not. As a temporary workaround until QQuickItem::setAcceptTouchEvents() has been added, we'll have to ignore touch events by hand. Task-number: QTBUG-61785 Change-Id: I195d5ec3122ca0c7f2fade700b5b0c221472a243 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * PageIndicator: don't block touch when non-interactiveJ-P Nurmi2017-07-042-0/+15
| | | | | | | | | | | | | | | | | | | | | | Unlike with mouse events there's setAcceptedMouseButtons(), currently there's no way to control whether a control receives touch events or not. As a temporary workaround until QQuickItem::setAcceptTouchEvents() has been added, we'll have to ignore touch events by hand. Task-number: QTBUG-61785 Change-Id: I8e3bdc3df1c3b28afaf8f80965569135e6a53120 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * PageIndicator: fix touch supportJ-P Nurmi2017-07-042-45/+41
| | | | | | | | | | Change-Id: I00d4f6ed466e33be3f31b2cd0bcbae6707d84cb9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickPopup: add reset-method for closePolicyJ-P Nurmi2017-07-113-2/+15
| | | | | | | | | | Change-Id: I05357bf0605eb152531ded3788437b1d52022528 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Menu: leave transformOrigin to be defined in QMLJ-P Nurmi2017-07-112-7/+3
| | | | | | | | | | Change-Id: I960d90a7d1604f35a67dfe5f4adb57d4d62968f9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickPopup::mirroredJ-P Nurmi2017-07-114-1/+31
| | | | | | | | | | | | | | | | | | | | | | This allows taking RTL into account e.g. when defining transitions and transform origins. [ChangeLog][Controls][Popup] Added a read-only "mirrored" property that is true when the popup's locale is right-to-left. Change-Id: I12fe09d8ed3af2836c92631ae43752929b08feb5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: fix parent menu handlingJ-P Nurmi2017-07-111-5/+8
| | | | | | | | | | | | | | | | | | | | | | Set the parent menu when added as a sub-menu, and reset when removed from the parent menu, instead of waiting until the sub-menu is being opened and never reseting it. Furthermore, fix onItemTriggered() to not overwrite the original parentMenu value when iterating the parent menus to close them. Change-Id: If4cf9cd8794e34275f38a3b991e5c403725a8706 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: add actionAt() and menuAt() accessorsJ-P Nurmi2017-07-102-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | This complements the add/insert/remove/take API that was added for actions and menus. Unlike for menu items, there was no convenient way to access a specific action or menu directly without accessing the respective item first. [ChangeLog][Controls][Menu] Added actionAt() and menuAt() accessors. Change-Id: I5515441626b3a04b05265d5b42afdaea8e256709 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: use key press instead of key release eventsJ-P Nurmi2017-07-102-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | In general, when shortcuts override key press events, the respective key release events are still sent. Therefore, in order to respect shortcuts, key navigation should be based on key press events. Key release -based navigation is also not going to work with nested menus in a menubar, because a leaf menu may need to propagate key events up to the parent menus and finally to the menubar, but only if keys are not actually handled. Change-Id: Ia040a387adc782d8828250fbed393ef1794f2148 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickContainer: use get() instead of QQmlListProperty::data for d-ptrJ-P Nurmi2017-07-062-15/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | MSVC2015 has very strange issues with QQmlListProperty::data in release builds. The pointer is somehow lost between constructing the object and when it reaches a list-property function. It's probably somehow related to the qSwap() calls in QQmlObjectCreator::setupBindings(), but this is tricky to investigate, because adding qDebug() output anywhere near the qSwap() calls also makes the problem disappear. It's easier to use the standard Private::get() pattern instead. :) Change-Id: Iaa361f07023820bfe38191a100cebf64fadb4d62 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Doc: revise the custom menu exampleJ-P Nurmi2017-07-046-55/+110
| | | | | | | | | | | | | | | | | | Use a single example for the whole menu. We can now use Actions and the delegate property to use the styled menu item for the whole menu. The same structure will be used for the upcoming MenuBar example. Change-Id: Idbaa38cc536b27a4d64eb9ad72c07936bf160d6e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | qtquickcontrols2-menus.qdoc: fix indentationJ-P Nurmi2017-07-041-7/+7
| | | | | | | | | | Change-Id: Iaa20b703985b09200e4e5972b68a031b535d98dc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMenu: fix mnemonics for dynamic action/submenu itemsJ-P Nurmi2017-06-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously mnemonics worked only for "normal" menu items, but not for dynamically created menu items that present actions and sub-menus. This patch fixes the issue by specifying the menu as a QObject-parent for such dynamically created items, because QQuickShortcutContext is based on QObject-hierarchy. Change-Id: I3637ef06e9cb2a27673e4618c253279a0123b7c8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickAbstractButton: fix shortcut handling part 2J-P Nurmi2017-06-291-1/+1
| | | | | | | | | | | | | | | | Make sure to trigger the associated action if a button is activated via its shortcut. Change-Id: I73899a5540285c7c2b11a2481a9621ec6e83c6b8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-06-295-46/+47
|\| | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickmenu.cpp Change-Id: I595ed1671fcad6c3b87123be2b825bca09552f0f
| * QQuickMenu: fix press-and-hold supportJ-P Nurmi2017-06-291-1/+0
| | | | | | | | | | | | | | | | | | | | Remove the OnReleaseOutside close policy, just use the defaults from QQuickPopup. This way menus won't get immediately closed on release, when opened from an onPressAndHold signal handler. Task-number: QTBUG-61608 Change-Id: Ifedd596aa0e71ac5f4211fa42e2ae499918df1b2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Doc: fix from/to sentence in first & second docsMitch Curtis2017-06-291-2/+2
| | | | | | | | | | | | Task-number: QTBUG-61647 Change-Id: I090017082de3287fd59f825d1cff01842a5ab5f8 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Fix tooltips to not block shortcutsMitch Curtis2017-06-281-0/+3
| | | | | | | | | | | | | | Task-number: QTBUG-60492 Change-Id: Ic1f380f44593d4a8681bff874789692d17b9edf7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * QQuickMonthGrid: fix touch supportJ-P Nurmi2017-06-262-39/+40
| | | | | | | | | | | | | | | | | | | | | | | | QQuickMonthGrid lost its clicked() signal when multi-touch support was added to QQuickControl, because QQuickControl now accepts touch events and therefore QQuickMonthGrid no longer gets synthesized mouse events. Re-implement QQuickControlPrivate::handlePress/Move/Release/Ungrab() instead of QQuickControl::mouseXxxEvent() to gain multi-touch support. Task-number: QTBUG-61585 Change-Id: Ic6fb2ea0b43b2b44beb0d8fdd3335a20f7c028f6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>