aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates
Commit message (Collapse)AuthorAgeFilesLines
* QQuickStackView: fix buildLiang Qi2016-05-202-1/+4
| | | | | | | | error: no matching function for call to 'QQmlComponentPrivate::initializeObjectWithInitialProperties(QV4::ScopedValue&, QQuickItem*&)' (cherry picked from commit 6fe784b9696fc19eb8f2ba24f187d2cea4434c53) Change-Id: Ic175bb290dcfbb944fee7545d3b97be8a202896a Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickContainer: fix invalid reads reported by ValgrindJ-P Nurmi2016-05-021-11/+17
| | | | | | Change-Id: I52cf46dab51382c9184a9dda7107154e52df74ef Task-number: QTBUG-52731 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickSwipeViewAttached: remove danling item change listenerJ-P Nurmi2016-04-271-5/+14
| | | | | | Change-Id: I40d3b50153bead01150284b2a5c3f45dbe486462 Task-number: QTBUG-52731 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickMenu: fix an uninitialized member variableJ-P Nurmi2016-04-271-0/+1
| | | | | | | | Also found with Valgrind. Change-Id: Ibde7714e15296d36f4cf34b5d004322531138271 Task-number: QTBUG-52731 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix QQuickApplicationWindowAttached::windowChange()J-P Nurmi2016-04-271-0/+9
| | | | | | | | | | | | QQuickWindow::windowChange() is emitted from QQuickWindow destructor. This means, that QQuickApplicationWindow destructor has been already executed, and thus, QQuickApplicationWindowPrivate has been deleted. The issue was found with Valgrind. A workaround is to explicitly reset the d-pointer so that we can test whether it's still valid. Change-Id: I82d388d8aae18886ec92ef09c745a1c045f46a39 Task-number: QTBUG-52731 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: fix ButtonGroup::buttons typeJ-P Nurmi2016-04-111-1/+1
| | | | | Change-Id: Id78ef819c56d4639c33e7b4823c2c2600486befa Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Fix ScrollBars with paddingsJoni Poikelin2016-04-011-2/+2
| | | | | | | | | | Padding was not taken into account when calculating the new position, which caused there to be small offset between the mouse press and the resulting handle position by the amount of padding used. Task-number: QTBUG-52233 Change-Id: Ibd8c4375b030a27a6124aefc4bc9af570d14d3a9 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* ComboBox: fix usage in an asynchronous LoaderJ-P Nurmi2016-03-231-4/+4
| | | | | | | | | | | | | The following comment in QQmlDelegateModel::object() helped to find a solution ie. using createdItem() instead of initItem(): If asynchronous is true or the component is being loaded asynchronously due to an ancestor being loaded asynchronously, item() may return 0. In this case createdItem() will be emitted when the item is available. [...] Change-Id: If3bf8e60834534ca07c8db8f502f4f11969057e8 Task-number: QTBUG-51972 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Fix QQuickPopupPositionerJ-P Nurmi2016-03-221-3/+3
| | | | | | | | | | | tst_tooltip revealed a bug that QQuickPopupPositioner wasn't cleaning up its ancestor listeners properly. When QQuickPopup was destructed, it left a listener on the window root item. When the root item got later destructed, it tried to call a listener (the popup) that was already deleted. Change-Id: If041458da24be927f0bad19b9549dcabd1931977 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Popup: fix marginsJ-P Nurmi2016-03-211-1/+13
| | | | | | Change-Id: I09f974a00a5a2a8f14645ff5d9bfbd6bad03d324 Task-number: QTBUG-51990 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QQuickOverlay: fix background visibility for multiple modal popupsJ-P Nurmi2016-03-171-1/+1
| | | | | | | | | | | | The idea of the "modalPopups > 1" check was to avoid calling QQmlProperty::write(), but it missed the fact that one modal popup might be still closing while a new modal popup is already opened. Thus, there's temporarily 2 modal popups visible, and we must transition the overlay background according to the state of the last shown modal popup. Change-Id: If25d83ccaa5adc29a9bc8d660f41fb66f90fb167 Task-number: QTBUG-51916 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Change locale inheritance for popupsJ-P Nurmi2016-03-174-24/+14
| | | | | | | | | | The last one in the series of making Popup inherit its properties from the parent window instead of the parent item. The same change was done for font and style already. Change-Id: I7024cce13f501e92024e9110e87ed33bbae6533d Task-number: QTBUG-50984 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Store explicit and resolved font separatelyJ-P Nurmi2016-03-158-109/+91
| | | | | | | Change-Id: I80bd45244077cd75f24c4ca1af6485f4c6a23b39 Task-number: QTBUG-50984 Task-number: QTBUG-51696 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* QQuickControlPrivate::themeFont(): clear system font's explicit attrsJ-P Nurmi2016-03-151-3/+7
| | | | | | | | | | | | The default system font must not have explicit attributes that would mess with font inheritance. This is already handled by the QFont() default constructor, but we must do it ourselves when we call QPlatformTheme::font(SystemFont) directly. Change-Id: Ia52e135411618e72cbf4618cffb9eec7924dc612 Task-number: QTBUG-50984 Task-number: QTBUG-51696 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Doc: fix a typo for Control.localeLiang Qi2016-03-111-1/+1
| | | | | | Change-Id: I37ad466462d42101fd16e8a09fe0c8486115f422 Reviewed-by: Nico Vertriest <nico.vertriest@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix popup fontsJ-P Nurmi2016-03-113-18/+4
| | | | | | | | | | | This is a partial revert of a405919. This change makes popups inherit the window font instead of the parent item font. Change-Id: Ie360e3831aadbd167859e17d381edf3a28945300 Task-number: QTBUG-50984 Task-number: QTBUG-51696 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Revert "QQuickControl: delayed the call of resolveFont()"J-P Nurmi2016-03-112-1/+8
| | | | | | | | | | | | | | | This reverts commit 3cba8b19c4e67cbcd6977bf141d7ddf2e54aae85. The change was done to implement font inheritance for popups, but it broke theme fonts for other controls. Since the former was a mistake (see comments in the linked bug report), it's best to revert back to what worked with theme fonts. Change-Id: I863765c5061b02607cfe04a848ff39e3243bd25f Task-number: QTBUG-50984 Task-number: QTBUG-51696 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Fix font comparisonsJ-P Nurmi2016-03-115-13/+35
| | | | | | | | | | | | | | | | | | | | When inheritance of explicitly set font attributes is involved, it is important to compare the resolve mask in addition to comparing the attribute values to avoid losing the information whether a specific attribute is set explicitly. For example, QFont::operator==() returns true for two fonts that are both bold regardless of whether only one of them has explicit weight set. Therefore, setFont() must not ignore fonts resolve mask. Furthermore, the fontChanged() notifier must be emitted only if the actual attribute values change, not if only the resolve mask changes. Change-Id: I2eb7a071c0eaecd2f8d2f6074c4ce6ed6764a6e9 Task-number: QTBUG-50984 Task-number: QTBUG-51696 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* QQuickPopup: fix possible referencing of a destroyed parent itemJ-P Nurmi2016-03-101-0/+1
| | | | | | | | | | The internal popup positioner is already listening for itemDestroyed() of the parent item, so it may as well reset the parent item pointer of the popup to avoid having the popup referencing a destroyed parent in complex tooltip auto test cases coming up in 5.7. Change-Id: I463403e528c33285ea7d51b68d0f5020a239e98e Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Fix QQuickPopupItemPrivate::implicitWidthChanged()J-P Nurmi2016-03-101-1/+1
| | | | | Change-Id: Ib822b57da21b338c7b11cae115f1bb6a178d7328 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* QQuickSpinBox: add missing null checkJ-P Nurmi2016-03-091-4/+7
| | | | | | | In auto tests, the engine might be null during destruction. Change-Id: I0556c746f6c47198afc937da052106d3f8c35558 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* SwipeView: cull items outside the viewJ-P Nurmi2016-03-071-0/+1
| | | | | | | | | | | | This hides them until they become visible in the view. Hiding them explicitly is not an option, because then they will never show up. This technique is used in QQuickItemView::initItem() and FxViewItem::setVisible(). Change-Id: I3a3779e11a57c6dcf94ffc834f6e920449aea74a Task-number: QTBUG-51078 Task-number: QTBUG-51669 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* ComboBox: fix activationJ-P Nurmi2016-03-071-1/+1
| | | | | | | | | | The highlighted index is always -1 when the popup is hidden. Thus, when pressing enter/return, it should only activate the highlighted index when the popup is visible to avoid setting the current index to -1. Change-Id: I7a66e347bf2e4b62a67eb39b119ca1de299f16ef Task-number: QTBUG-51645 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Fix QQuickPopup::setParentItem()J-P Nurmi2016-03-021-1/+1
| | | | | | | | Don't call naturalControlFont() or calcLocale() with a null pointer, because it will crash. Change-Id: Ib4b6dba85e6c55832c30b5178b74ebf39429a5f8 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* QQuickPopup: fix uninitialized variableJ-P Nurmi2016-02-251-0/+1
| | | | | Change-Id: I339fdb284d65859b5df3a120fc806beaf950031b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Implement accessibility support for Popup and MenuJ-P Nurmi2016-02-256-4/+48
| | | | | | Change-Id: I55067bb1cb9888be8e0e991fb73c9365d93d04f4 Task-number: QTBUG-51316 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Fix QQuickPopup to respect explicit sizeJ-P Nurmi2016-02-241-1/+4
| | | | | | | | | Don't resize the popup (clamping to its implicit size) unless the popup really has to be resized in order to fit the screen. Change-Id: I81201b77a1001ac22291ede1fc685f7208ff2916 Task-number: QTBUG-51322 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* RangeSlider: forward focus to the handlesJ-P Nurmi2016-02-242-0/+19
| | | | | | | | | | The active focus ends up to RangeSlider when using forceActiveFocus() or QML KeyNavigation. We must forward the focus to one of the handles, because RangeSlider handles key events for the focused handle. If neither handle has active focus, RangeSlider doesn't do anything. Change-Id: I61a53d0c7203fad64306b54c1f96093bd9312416 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Popup: use available size and paddings from the popup itemJ-P Nurmi2016-02-194-187/+71
| | | | | | | | | | | | | | | | Now that the internal popup item inherits Control, which already provides these features, we may use them directly instead of re-doing them in Popup. NOTE: QQuickMenu code has lots of direct references to the content item, which used to be stored in QQuickPopupPrivate, which is the base class of QQuickMenuPrivate. Now that the content item is stored by QQuickPopupItem instead, the direct references don't work. Thus, as a temporary solution to avoid this patch growing large, we'll store the content item in QQuickMenuPrivate. Change-Id: I80a16d34432131a4326c1b6ae54419470be53f96 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Recommend the use of ApplicationWindow with popupsMitch Curtis2016-02-192-1/+38
| | | | | | | | It's important to mention that ApplicationWindow provides some extra support for popups. Change-Id: Iecea78d9d4446bbc4694fcde0166d1b1c2fb62ee Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* Controls: fix locale inheritance for popupsLiang Qi2016-02-193-10/+28
| | | | | | | | | QQuickPopup is a QObject, not a QQuickControl. Then need to make QQuickPopup::popupItem() inherit its locale from QQuickPopup::parentItem(). Task-number: QTBUG-50984 Change-Id: Ie5908f86a154502962d6406dd4067b46cc527de7 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Controls: fix font inheritance for popupsLiang Qi2016-02-183-5/+23
| | | | | | | | | QQuickPopup is a QObject, not a QQuickControl. Then need to make QQuickPopup::popupItem() inherit its font from QQuickPopup::parentItem(). Task-number: QTBUG-50984 Change-Id: I7f417474172b533b744eb668a0476cdcbabba868 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* QQuickControl: delayed the call of resolveFont()Liang Qi2016-02-182-8/+1
| | | | | Change-Id: Iadfbc3a39de102825c9dde60a236883b88834b34 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* clear parentItem of old header and footer itemsJochen Seemann2016-02-172-4/+12
| | | | | | | | | This patch completes the support in QQuickApplicationWindow and QQuickPage to dynamically change the header and footer item. Change-Id: Id230db135ca2957d94aa126e9d58ac486c88557c Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* SpinBox: fix JS callback accessJ-P Nurmi2016-02-151-1/+1
| | | | | | | | | | Avoid calling an uninitialized JS callback. This is a regression caused by lazy creation of the JS callbacks in 1f146d9. Change-Id: I1816b491ada0509c5664cffbcaa32ca987095b31 Task-number: QTBUG-51114 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Test and fix AbstractButton::pressAndHold()J-P Nurmi2016-02-121-2/+5
| | | | | | | | | | | Using the same auto test that already exists for TextField and TextArea nicely exposed some difference in the behavior: - the signal wasn't canceled on second press - the signal was canceled right away on any tiny move. now it allows the same little threshold than TextField and TextArea Change-Id: I6b9bd19c614b36dd0ec7b232f821af3aa929d02a Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* SwipeView: warn the user for using anchorsJ-P Nurmi2016-02-121-1/+16
| | | | | Change-Id: I49b951f8382277ee9ea86f487ee70fe954cf1ece Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* StackView: warn the user for using anchorsJ-P Nurmi2016-02-122-0/+14
| | | | | Change-Id: I6c977e4bdc62820589a94700291d93b290d796ae Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Revert "Fix accessing StackView attached properties via popped item"J-P Nurmi2016-02-111-2/+1
| | | | | | | | | | | | This reverts commit 1cf60c89a8711103a37b0511f4e91ee28d984b45. The fix wasn't good. It leaves a dangling pointer around, which makes tst_stackview fail and often crash. Unfortunately the problem wasn't caught by the CI, because it didn't run qmltestcases at all. :) Change-Id: I7348f1b79a45715f8c5abec416e8a9864b0288e1 Task-number: QTBUG-50937 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix accessing StackView attached properties via popped itemJ-P Nurmi2016-02-101-1/+2
| | | | | | Change-Id: I98d84668ce42687577539cb6356b87be9e2bdd98 Task-number: QTBUG-50937 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* RangeSlider: choose the nearest handleJ-P Nurmi2016-02-091-0/+25
| | | | | | | | | The handles were hard to touch. This change makes it choose the nearest handle, so that the interaction becomes similar to what Slider has. Change-Id: Ie94eeed6a8466f44e8eee0ce0ba0a45cfb3f6924 Task-number: QTBUG-50972 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Sliders: fix snapping on releaseJ-P Nurmi2016-02-082-2/+10
| | | | | | | | | If the value changes when snapped on release, the position is updated accordingly. However, if the value doesn't change, the position must be updated manually or the handle doesn't snap as it should. Change-Id: I3648e08c2f897d73c84c6d91510795e4aede41d7 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* RangeSlider: fix stepSize handling when snapping is enabledJ-P Nurmi2016-02-081-3/+8
| | | | | | | | Same as the recent fix for Slider. The step size needs to be normalized when added to or subtracted from the position. Change-Id: I490d105f88db361fb0e1888017e1717e9d79e4c8 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Slider: fix stepSize handling when snapping is enabledJ-P Nurmi2016-02-081-2/+8
| | | | | | | | | | | The value range and step size are configurable, whereas position is always in the range [0.0..1.0]. The snap handling was applying step size to the position as is, without taking the value range into account. Thus, snapping worked correctly only for the default [0.0..1.0] value range, which happens to match with the position range. Change-Id: If2f48d36c95554de25598d507842576a49e643b9 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add AbstractButton::pressAndHold() signalJ-P Nurmi2016-02-073-4/+54
| | | | | Change-Id: I41e96a61bfb25b81bad748f559894bf8e2984427 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Docs: fix typos in margins linksJ-P Nurmi2016-02-061-4/+4
| | | | | Change-Id: I26b519e03700d163af12ec2d08097b1d51d9e119 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add minimal docs for Control::contentItemJ-P Nurmi2016-02-061-1/+3
| | | | | | | | It deserves a wireframe to explain, but a minimal docs are better for now than a TODO comment. Change-Id: I3fa1bfb13478065e0c9f4a3f3693ad90a54b3385 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Docs: add missing \readonly tagsJ-P Nurmi2016-02-069-1/+25
| | | | | Change-Id: I314514bca07f9b23ac821d68ba8f3ce05341f1d9 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* QQuickPopup: add some missing propertiesJ-P Nurmi2016-02-062-6/+128
| | | | | Change-Id: I7df64587bf3ba289ba027f6dbe9872362532ec41 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Make popups work without ApplicationWindow, to some degreev5.6.0-rc1v5.6.0J-P Nurmi2016-01-306-92/+114
| | | | | | | | | | | | | | Using ApplicationWindow is highly recommended. First of all, with a plain Window, QQuickPopup attempts to set a high z-value, but cannot guarantee correct stacking order. Secondly, we cannot provide style- specific background dimming for modal popups, because it is styled as part of ApplicationWindow. Last but not least, QQuickPopup has to install a window-level event filter, which is far less efficient than how event handling done in QQuickOverlay. Change-Id: I08915abce7a1764177b92f7539eef77c054a405a Task-number: QTBUG-49921 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>