aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpopup.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Tie minor version of all imports to Qt's minor versionMitch Curtis2018-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes all Qt Quick Controls 2 imports match the current Qt minor version, which is 12 as of this patch. It also updates all other Qt Quick imports to match. This will also make future version bumps easier as all version numbers in existing code/docs will match. The following commands were used to verify that no old versions remain: for i in `seq 0 11`; do git grep "import QtGraphicalEffects.*1.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick 2.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick.Layouts 1.$i$"; done for i in `seq 0 5`; do git grep "import QtQuick.Controls.*2.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick.Templates 2.$i as T$"; done [ChangeLog] From Qt 5.12 onwards, all import versions in Qt Quick Controls 2 follow the same minor version as Qt's minor version number. For example, the import version for Qt 5.12 is: "import QtQuick.Controls 2.12". Change-Id: I6d87573f20912e041d9c3b7c773cc7bf7b152ec3 Fixes: QTBUG-71095 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickTheme: rename themeFont() and themePalette()J-P Nurmi2018-05-221-2/+2
| | | | | | | We don't have the conflicting virtual getters anymore. Change-Id: Ia20bfa0a0b1aa67c35a23270eb0241018f8e0ada Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-071-50/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickabstractbutton_p_p.h src/quicktemplates2/qquickcombobox.cpp src/quicktemplates2/qquickcontainer.cpp src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickcontrol_p_p.h src/quicktemplates2/qquickdialog_p_p.h src/quicktemplates2/qquickdialogbuttonbox.cpp src/quicktemplates2/qquickdialogbuttonbox_p_p.h src/quicktemplates2/qquickdrawer.cpp src/quicktemplates2/qquickmenubar.cpp src/quicktemplates2/qquickmenubar_p_p.h src/quicktemplates2/qquickpage.cpp src/quicktemplates2/qquickpage_p_p.h src/quicktemplates2/qquickpane.cpp src/quicktemplates2/qquickpane_p_p.h src/quicktemplates2/qquickpopup.cpp src/quicktemplates2/qquickpopup_p_p.h src/quicktemplates2/qquickrangeslider.cpp src/quicktemplates2/qquickscrollview.cpp src/quicktemplates2/qquickslider.cpp src/quicktemplates2/qquickspinbox.cpp src/quicktemplates2/qquickswipeview.cpp src/quicktemplates2/qquicktabbar.cpp src/quicktemplates2/qquicktextarea_p_p.h src/quicktemplates2/qquicktextfield_p_p.h src/quicktemplates2/qquicktheme_p.h Change-Id: I6e2b8fe99e51e3e26c87546aa66af045bc429ec4
| * Templates: use C++11 default member initializationJ-P Nurmi2018-05-041-51/+4
| | | | | | | | | | | | | | | | | | | | | | The code is more readable and less error-prone (this patch caught a few uninitialized members) when the members are initialized in the same place where they are declared. In many cases, empty default destructors can be entirely removed, and we get faster implicitly declared inline default constructors defined by the compiler. Change-Id: I14c5448afc901f9b2ac5965f28c1c26c0b646c08 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Fix QQuickPopupPositionerJ-P Nurmi2018-05-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a double-regression caused by commits bcd1bed and 03a8c88. Both of these changes caused dangling pointers being left on the list of item change listeners. First, bcd1bed made QQuickPopupPositioner use QQuickItem::isAncestorOf() without noticing the difference that the old self-made isAncestorOf() conveniently returned true for the item itself, whereas the new built-in QQuickItem::isAncestorOf() doesn't. This had a nasty side effect that when the popup's parent item was removed from its parent, QQuickPopupPositioner::itemChildRemoved() no longer removed the ancestor listeners. Then, 03a8c88 made things worse by changing the stack allocation of QQuickPopupPositioner to heap allocation without ever deleting the positioner object. Valgrind output for tst_tooltip: ==14391== Invalid read of size 8 ==14391== at 0x79EFB9A: QQuickItemPrivate::itemChange(QQuickItem::ItemChange, QQuickItem::ItemChangeData const&) (qquickitem.cpp:6206) ==14391== by 0x79F3D98: QQuickItem::setParentItem(QQuickItem*) (qquickitem.cpp:2791) ==14391== by 0x79F3E87: QQuickItem::~QQuickItem() (qquickitem.cpp:2385) ==14391== by 0x7A16073: ~QQmlElement (qqmlprivate.h:103) ==14391== by 0x7A16073: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (qqmlprivate.h:103) ==14391== by 0x7A9CFEE: QQuickView::~QQuickView() (qquickview.cpp:218) ==14391== by 0x4038215: quick_test_main_with_setup(int, char**, char const*, char const*, QObject*) (quicktest.cpp:512) ==14391== by 0x4038CFF: quick_test_main(int, char**, char const*, char const*) (quicktest.cpp:330) ==14391== by 0x400BD7: main (tst_default.cpp:44) ==14391== Address 0x1f2d3f10 is 0 bytes inside a block of size 32 free'd ==14391== at 0x4C2F29C: operator delete(void*) (vg_replace_malloc.c:576) ==14391== by 0x29CA2641: QQuickPopupPositioner::~QQuickPopupPositioner() (qquickpopuppositioner.cpp:68) ==14391== by 0x29CA004C: QQuickPopup::~QQuickPopup() (qquickpopup.cpp:783) ==14391== by 0x2A1A4CEE: ~QQuickToolTip (qquicktooltip_p.h:59) ==14391== by 0x2A1A4CEE: ~QQmlElement (qqmlprivate.h:103) ==14391== by 0x2A1A4CEE: QQmlPrivate::QQmlElement<QQuickToolTip>::~QQmlElement() (qqmlprivate.h:103) ==14391== by 0x6397A65: QObjectPrivate::deleteChildren() (qobject.cpp:1997) ==14391== by 0x6398DDA: QObject::~QObject() (qobject.cpp:1025) ==14391== by 0x79F41FA: QQuickItem::~QQuickItem() (qquickitem.cpp:2378) ==14391== by 0x7A897D5: QQuickMouseArea::~QQuickMouseArea() (qquickmousearea.cpp:452) ==14391== by 0x7A1699D: ~QQmlElement (qqmlprivate.h:103) ==14391== by 0x7A1699D: QQmlPrivate::QQmlElement<QQuickMouseArea>::~QQmlElement() (qqmlprivate.h:103) ==14391== by 0x639082D: qDeleteInEventHandler(QObject*) (qobject.cpp:4603) ==14391== by 0x6392478: QObject::event(QEvent*) (qobject.cpp:1242) ==14391== by 0x79F1D77: QQuickItem::event(QEvent*) (qquickitem.cpp:8006) ==14391== Block was alloc'd at ==14391== at 0x4C2E226: operator new(unsigned long) (vg_replace_malloc.c:334) ==14391== by 0x29C9F939: QQuickPopupPrivate::init() (qquickpopup.cpp:280) ==14391== by 0x29C9FD4E: QQuickPopup::QQuickPopup(QQuickPopupPrivate&, QObject*) (qquickpopup.cpp:771) ==14391== by 0x29CC6CBB: QQuickToolTip::QQuickToolTip(QQuickItem*) (qquicktooltip.cpp:171) ==14391== by 0x2A1A58DD: QQmlElement (qqmlprivate.h:98) ==14391== by 0x2A1A58DD: void QQmlPrivate::createInto<QQuickToolTip>(void*) (qqmlprivate.h:107) ==14391== by 0x5D0186D: QQmlType::create(QObject**, void**, unsigned long) const (qqmlmetatype.cpp:915) ==14391== by 0x5D81EFF: QQmlObjectCreator::createInstance(int, QObject*, bool) (qqmlobjectcreator.cpp:1163) ==14391== by 0x5D85AE2: QQmlObjectCreator::create(int, QObject*, QQmlInstantiationInterrupt*) (qqmlobjectcreator.cpp:203) ==14391== by 0x5D82230: QQmlObjectCreator::createInstance(int, QObject*, bool) (qqmlobjectcreator.cpp:1202) ==14391== by 0x5D82F65: QQmlObjectCreator::setPropertyBinding(QQmlPropertyData const*, QV4::CompiledData::Binding const*) (qqmlobjectcreator.cpp:825) ==14391== by 0x5D85105: QQmlObjectCreator::setupBindings(bool) (qqmlobjectcreator.cpp:777) ==14391== by 0x5D857C5: QQmlObjectCreator::populateInstance(int, QObject*, QObject*, QQmlPropertyData const*) (qqmlobjectcreator.cpp:1456) Change-Id: Id368e79146f4673708a84253a009fcdf24ab4a2c Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickPopup: prepare for overriding the positionerJ-P Nurmi2018-05-021-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Create the positioner lazily to make it possible for QQuickPopup sub-classes to override the positioner, and give the upcoming QQuickPopupPositioner sub-classes access to the popup instance. - QQuickDrawer has custom positioning along the window edges - QQuickMenu has custom positioning for cascading sub-menus - in the future, native menus, native tooltips, and top-level popups/dialogs will also need different positioners. Change-Id: I7c3ac2c38b00ef92410b2cdf4e51fa974efb534f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Cleanup QQuickPopupAnchorsJ-P Nurmi2018-05-021-4/+3
| | | | | | | | | | | | | | | | Don't access QQuickPopupPositioner directly, but call QQuickPopup's reposition() method instead so that we can lazy-create the positioner. Change-Id: Ieb6a6adf187fba8b4829e32e7656a25c5e82cfc3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Popup: add support for background insetsJ-P Nurmi2018-04-231-4/+148
| | | | | | | | | | | | | | | | | | | | [ChangeLog][Controls][Popup] Added topInset, bottomInset, leftInset, and rightInset properties to control the geometry of the background similarly to how paddings control the geometry of the contentItem. Task-number: QTBUG-60156 Change-Id: I02873f129d2a804986d0db52d1b94899f9219c03 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Popup: add implicitBackground|ContentWidth|Height propertiesJ-P Nurmi2018-04-161-0/+72
| | | | | | | | | | | | | | | | | | [ChangeLog][Controls][Popup] Added implicitBackgroundWidth, implicitBackgroundHeight, implicitContentWidth, and implicitContentHeight properties. Change-Id: I3881b337bbd46b29873e8c00832006eec8b2836a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickPopupItem: inherit QQuickPaneJ-P Nurmi2018-04-061-14/+12
| | | | | | | | | | Change-Id: Ia32f3004cf540f995344286683d754558369f279 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Use Q_PRIVATE_PROPERTY for QQmlListPropertyJ-P Nurmi2018-04-041-7/+5
| | | | | | | | | | | | | | | | Hide QQmlListProperty, which is close to unusable in C++, from the templates C++ API. Change-Id: I9720fc3297fc625076a8a7553245852b641bc65a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add anchors property to Popup to allow centering in parent/windowMitch Curtis2018-03-221-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, users must manually position their Popup using x and y bindings: Popup { x: (parent.width - width) / 2 y: (parent.height - height) / 2 } This patch adds an anchors property so that you can do this instead: Popup { anchors.centerIn: parent } It's also possible to conveniently center within the window from anywhere within the scene (106e7b63 also documents an alternative way of doing this using Overlay): Window { id: window Pane { Popup { anchors.centerIn: window } } } QQuickAnchors were never used with Popup, because we cannot use the QQuickAnchors implementation as-is, as the visual QQuickItem parent is not the actual parent item of QQuickPopupItem. Currently just centerIn is supported, as that's the most common use case. [ChangeLog][Controls][Popup] Added anchors.centerIn to Popup to allow a covenient way of centering a popup. Task-number: QTBUG-60354 Change-Id: Ia030f812df9da646fea8f373ef6199a21205ffbd Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add QQuickTheme::ScopeJ-P Nurmi2018-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | Replace the old enums that were originally copied from QPlatformTheme, including irrelevant entries for DockWidget, MdiSubWindow, MessageBox, with a unified enum that will be matched to cover everything needed for theming fonts and palettes for Qt Quick Controls 2. Task-number: QTBUG-67062 Change-Id: Ia99d092f28c00210c0c7f24d4241eb5a5d9ceb5b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-101-0/+1
|\| | | | | | | Change-Id: Id5cd236e14238612647f7a897886be0202863132
| * Doc: add a "Focus Management in Qt Quick Controls 2" pageMitch Curtis2018-03-061-0/+1
| | | | | | | | | | | | | | | | This will list each control that is a focus scope, and have some relevant information about focus in Qt Quick Controls 2. Change-Id: I3126452bf73f7d7730d0522d616d61ad0da0dd74 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devJ-P Nurmi2018-02-191-0/+9
|\| | | | | | | Change-Id: Id375217229c7f7dc7a8a2dc7edcfd56bbe403952
| * Document how to position a popup in the center of the windowMitch Curtis2018-02-161-0/+9
| | | | | | | | | | | | | | | | | | This was already in Overlay's docs, but not Popup's, so this patch moves the example to a .qdocinc and includes it in both places, creating a new Popup Positioning section in the process. Change-Id: I8e8438919fd849a8466b3a28133d22bb45f7dc19 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Move QQuickControlPrivate::themeFont|Palette() to QQuickThemeJ-P Nurmi2018-02-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlatformTheme is too limited for our theming purposes. We need support for separate palettes (and later, icon colors) in dark and light themes. Also, the fact that Qt Quick Controls 2 injects a platform proxy theme does have undesired side effects in Qt Widgets and Qt Quick Controls 1. Therefore, we start separating QPlatformTheme and QQuickTheme. The first step is to eliminate some direct QPlatformTheme access in QQuickControl and route it via QQuickTheme instead. Task-number: QTBUG-51921 Change-Id: I055471a75ed6f26968796496efd1892975447c98 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devJ-P Nurmi2018-02-151-5/+4
|\| | | | | | | Change-Id: Id3333e9bb67ced4c6dbae5845512fe1927a7b858
| * Merge remote-tracking branch 'origin/5.9' into 5.105.10Liang Qi2018-02-091-5/+4
| |\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ia407f277cccfdd96242ebfdbe294d699e26e6b1d
| | * Popup: fix restoring focus for popups that did not request focusJ-P Nurmi2018-02-061-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a popup closes, if it has active focus, it should restore focus back to where it was regardless of whether the popup originally requested focus. Even if a popup does not request focus on open, it may gain focus programmatically or when a control with click-focus is clicked, for example. Task-number: QTBUG-66113 Change-Id: I9a7c467abe781bbef390d74898d13b9a30b2695b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Add Popup::horizontal|verticalPaddingJ-P Nurmi2018-02-131-10/+76
|/ / | | | | | | | | | | | | | | | | | | | | | | This commit is just exposing the newly added Control properties in Popup. See the previous commit for details. [ChangeLog][Controls][Popup] Added horizontalPadding and verticalPadding properties as a convenient way to set both left and right, or top and bottom paddings in one go. Change-Id: I19a8190d323e63b5b3365aecdd81006cdd81f981 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2018-01-101-4/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/BusyIndicator.qml src/imports/controls/CheckBox.qml src/imports/controls/CheckDelegate.qml src/imports/controls/ComboBox.qml src/imports/controls/DelayButton.qml src/imports/controls/Dial.qml src/imports/controls/ItemDelegate.qml src/imports/controls/MenuItem.qml src/imports/controls/RadioButton.qml src/imports/controls/RadioDelegate.qml src/imports/controls/SwipeDelegate.qml src/imports/controls/Switch.qml src/imports/controls/SwitchDelegate.qml src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc src/imports/controls/material/CheckDelegate.qml src/imports/controls/material/ItemDelegate.qml src/imports/controls/material/MenuItem.qml src/imports/controls/material/RadioDelegate.qml src/imports/controls/material/SwipeDelegate.qml src/imports/controls/material/SwitchDelegate.qml src/imports/controls/qquickdefaultbusyindicator.cpp src/imports/controls/qquickdefaultbusyindicator_p.h src/imports/controls/qtquickcontrols2plugin.cpp src/imports/controls/universal/CheckDelegate.qml src/imports/controls/universal/ItemDelegate.qml src/imports/controls/universal/MenuItem.qml src/imports/controls/universal/RadioDelegate.qml src/imports/controls/universal/SwipeDelegate.qml src/imports/controls/universal/SwitchDelegate.qml src/quickcontrols2/quickcontrols2.pri src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickmenu.cpp src/quicktemplates2/qquickpopup_p.h Change-Id: Ib25c8b4a7fe018b7c0ade9b02bfaaa6980118c15
| * Popups: use deferred executionJ-P Nurmi2017-12-191-4/+7
| | | | | | | | | | | | | | | | | | | | | | QQuickPopup is backed by a QQuickControl subclass aka QQuickPopupItem. However, since the QML engine sees "background" and "contentItem" as properties of QQuickPopup, we must ensure that the deferred properties are executed for the QQuickPopup wrapper object. Task-number: QTBUG-50992 Change-Id: I2ec055b382e41530a6f4a740cb80853c0181c21a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Document palette as a basic QML typeJ-P Nurmi2017-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | Unfortunately we need to manually add some \sa "palette QML Basic Type" links as a workaround until auto-linking to basic QML types in QML property headers is fixed in QDoc. Task-number: QTBUG-63469 Change-Id: I2ea853bfeda31905468741eb720f4daa242e703d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2017-10-121-2/+2
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/quicktemplates2/qquickbuttongroup.cpp src/quicktemplates2/qquickoverlay.cpp tests/auto/controls/data/tst_buttongroup.qml Change-Id: Iae23aaf039c6095007966475294e93220dbead84
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-07-211-3/+3
|\| | | | | | | Change-Id: Idb1895dae2870dbed860ba3106fe52b01d733504
| * Fix QQuickControlPrivate::getContentItem() overridesJ-P Nurmi2017-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * QQuickDrawer: fix multi-touch leaking through modal overlayJ-P Nurmi2017-07-141-2/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | QQuickPopup: add reset-method for parentJ-P Nurmi2017-07-121-6/+10
| | | | | | | | | | Change-Id: Ia7d205bacf4da4cb13e31ab34fb62d13a77f7ddd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-07-111-15/+9
|\| | | | | | | | | | | | | | | 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>
| * Remove redundant code in touch event handlersJ-P Nurmi2017-07-071-13/+1
| | | | | | | | | | | | | | | | | | | | | | 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-041-3/+3
| | | | | | | | | | | | Task-number: QTBUG-61698 Change-Id: I46db5e9816190ac7afd6b671198dff11089bc4f3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickPopup: add reset-method for closePolicyJ-P Nurmi2017-07-111-1/+12
| | | | | | | | | | Change-Id: I05357bf0605eb152531ded3788437b1d52022528 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickPopup::mirroredJ-P Nurmi2017-07-111-1/+20
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Add Overlay attached properties and signalsJ-P Nurmi2017-06-261-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Controls][ApplicationWindow] Deprecated the overlay grouped property in favor of the newly introduced Overlay attached properties. [ChangeLog][Controls][Overlay] Introduced Overlay attached properties and signals that supersede the overlay grouped property in Application Window. The Overlay attached type allows providing background dimming for popups without requiring an ApplicationWindow instance. Task-number: QTBUG-61336 Change-Id: I9df11bcb167e7725014d5f058fe24d70da4a10b3 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Move visual overlay background management to QQuickPopupJ-P Nurmi2017-06-231-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | During the early days, there was only one visual overlay background dimmer, so QQuickOverlay was the natural choice to manage it. It was soon realized that multiple modal popups and drawers needed each their own background dimming. Now the implementation becomes simpler when each popup manages its own background dimming. This paves the road for the upcoming changes making it possible to provide background dimming without ApplicationWindow. Task-number: QTBUG-61336 Change-Id: I621db4efe4aa74c147f81f7aee8affebddb00d49 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add Popup::enabledJ-P Nurmi2017-06-221-0/+21
| | | | | | | | | | | | | | [ChangeLog][Controls][Popup] Added "enabled" property. Change-Id: Icc1b2be2a0e73c392189efcd67167da4177cbe9e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-06-081-7/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/src/qtquickcontrols2-index.qdoc src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc src/quicktemplates2/qquickapplicationwindow.cpp src/quicktemplates2/qquickmenu.cpp src/quicktemplates2/qquickmenu_p.h src/quicktemplates2/qquickpopup.cpp tests/auto/auto.pro Change-Id: I856a022d38abd84763127539f46ef032ddc53c3d
| * Fix font inheritance for popupsJ-P Nurmi2017-06-071-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-06-061-12/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | Fusion style ComboBox popup height was adjusted according to 90a0d402 to make tst_controls::ComboBox::test_emptyPopupAfterModelCleared pass with the Fusion style. Conflicts: src/imports/controls/ComboBox.qml src/imports/controls/material/ComboBox.qml src/imports/controls/universal/ComboBox.qml Change-Id: I2bad826dc56de9d8952ea2a9ace950c7cf3cbc58
| * Doc: improve margin documentationMitch Curtis2017-05-311-11/+16
| | | | | | | | | | | | | | | | | | | | - 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-311-1/+1
| |\ | | | | | | | | | Change-Id: Iba044084bf82f6b2b8ceba4aa2a80bdcf8fc38e0
| | * Drawer: fix dragging from the inside over interactive contentsJ-P Nurmi2017-05-081-1/+1
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-60598 Change-Id: I65e6e9440c9450fbec4a53b9ee60e11b919c090a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Add Popup::openedJ-P Nurmi2017-06-061-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Controls][Popup] Added an "opened" boolean property that holds whether a popup is fully open. That is, the popup is visible and neither the enter nor exit transitions are running. Change-Id: I18a1403be381c113fdbcc4211e267f68632984b7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Doc: add the Qt version to "\since QtQuick.Controls 2.3"J-P Nurmi2017-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | For the earlier versions, this was already done in the 5.9 branch. Change-Id: I3fd3840aca0f5aadd7aa77eba358ac0f6c94f942 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-05-301-1/+1
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickrangeslider.cpp Change-Id: I7eb990cfdc91173f86552841ba16536b35ea09cf
| * | Doc: add the Qt version to "\since QtQuick.Controls 2.x"J-P Nurmi2017-05-301-1/+1
| |/ | | | | | | | | Change-Id: Ia7f237cb580bf9c332ff4741569a57fef4eb6079 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>