aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
Commit message (Collapse)AuthorAgeFilesLines
* Amend d1fec8f050fc8f60b2cc2bf0e22a1e478f0e9048 to account for the theme5.13Andy Shaw2019-11-111-0/+2
| | | | | | Fixes: QTBUG-79929 Change-Id: I153684fa9c4e40d220986391671b0945b66393e1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Unset the resolved font's families if it was not set beforeAndy Shaw2019-11-085-4/+22
| | | | | | | | | | | | When the font is resolved, if the font does not have families set then it will set it to be the family to ensure that it has the right precedence. Therefore we need to reset the families setting so that it does not act like a font has changed after being resolved when it really hasn't. Fixes: QTBUG-79790 Change-Id: I03c6f1456dbe5f136181b1c3a0e22fdc0fa66679 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopup: try to grab shortcut when component completedWang Chuan2019-10-291-0/+7
| | | | | | | | | | | | | | | If closePolicy of Popup is set to CloseOnEscape and the Popup is completed, shortcut will register to QGuiApplication to let Popup respond to Escape key. However if Popup is set to visible in creation, even if we set closePolicy to CloseOnEscape, the shortcut won't be registered. [ChangeLog][Controls][QQuickPopup] Fixed the issue that Popup doesn't respond to CloseOnEscape if the initial value of visible is true Fixes: QTBUG-79326 Change-Id: I90c6805e2b4d567a6e0d33d43a75fedcfc5416b3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* SplitView: fix issue where Repeater items were not createdMitch Curtis2019-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | SplitView's contentItem is lazily created whenever contentItem() is called. When adding regular, standalone items, they will go through QQuickContainer::addItem(), which eventually calls contentItem(). This case works fine. Repeaters, on the other hand, call setTransparentForPositioner(true), which QQuickContainerPrivate::contentData_append() checks for, and instead of calling addItem(), reparents the Repeater to effectiveContentItem() with this line: item->setParentItem(effectiveContentItem(p->contentItem)); If this happens before the contentItem is created, then the Repeater has no parentItem and won't generate any items. So, instead of using the contentItem member directly, call contentItem() to create it if it doesn't exist. Fixes: QTBUG-79302 Change-Id: I258f7420d2fea843ed045d569f80e92fe1f507d2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickContainer: stop creating duplicate content itemsMitch Curtis2019-10-242-2/+1
| | | | | | | | | | | | In most cases, getContentItem() will create a new content item when called. In addition, its only responsibility is to return the content item, not set it as the control's new contentItem; QQuickControl::contentItem() does that. Instead, QQuickContainer should simply call contentItem(). Change-Id: I1b8cb57f9f7b9e56074e99bed20ce5bcac70e1a6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* SplitView: fix cursor shape staying as Split*Cursor in some casesMitch Curtis2019-10-241-15/+11
| | | | | | | | | | | Don't return early before restoring the ArrowCursor shape. This is not testable in QML due to QWindow's cursor API not being available there. Task-number: QTBUG-79302 Change-Id: Idb59d9cfbf04fc12ebe0adfbb7285ae7155e195d Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QQuickMenuBar: let MenuBarItem lose highlight when Menu is dismissedWang Chuan2019-10-242-5/+5
| | | | | | | | | | | | | | | | When adding new MenuBarItem to MenuBar, MenuBar will first check the Menu pointer in MenuBarItem and then connect the Menu's signal [aboutToHide] to MenuBar's slot [onMenuAboutToHide] to unhighlight the MenuBarItem. In case of adding dynamic Menu, this operation will be performed before setting new Menu to MenuBarItem. So the Menu pointer in MenuBarItem is null, and the connection will not be performed. [ChangeLog][Controls][QQuickMenuBar] Fixed issue with dynamically menu bar items not losing their highlight when their menu was dismissed. Fixes: QTBUG-77306 Change-Id: Ibe987462505f65747b4290b3c206e9dfbcbbef57 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix assertion failure when hiding a SplitView with only one itemMitch Curtis2019-10-231-4/+8
| | | | | | | | Check for -1 when calling handleIndexForSplitIndex(). Change-Id: I81021b64265ace0c47269ea54e538a2725c84b79 Fixes: QTBUG-79270 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix a crash on exit when using ToolTip in a specific item hierarchyMitch Curtis2019-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickPopup connects its parent item's (MouseArea, in this case) windowChanged() signal to QQuickPopupPrivate::setWindow(). It does this so that: 1) QQuickOverlay can keep track of all of the popups that it manages. 2) Fonts, palettes and locales can be resolved. 3) If the QQuickPopup component has completed loading and the popup is visible with a valid window, start the enter transition. The problem arises only when using a very specific item hierarchy: Window { width: 640 height: 480 visible: true Item { anchors.fill: parent Item { anchors.fill: parent ColorOverlay { source: parent anchors.fill: parent } MouseArea { anchors.fill: parent hoverEnabled: true ToolTip.visible: containsMouse ToolTip.text: "ToolTip text" } } } } When the window is closed and hence begins to be destroyed, the following events occur: - QQuickWindow's destructor is called. - The window's root item (QQuickRootItem) begins destruction. - QQuickOverlay is destroyed. - QQuickWindow's destructor is done, so the QWindow and then QObject destructors are called. - The QQuickItem destructor for the outer Item is called. - The child items of the outer Item have setParentItem(nullptr) called on them, one of which being the inner Item. - The inner Item's setParentItem() function calls derefWindow(), which in turn calls derefWindow() on its children. One of those children is MouseArea. - Since the MouseArea's window is deref'd, it emits the windowChanged() signal. MouseArea is the parentItem of the popup, so its windowChanged() signal causes QQuickPopupPrivate::setWindow() to be called. - setWindow() tries to remove the popup from the old overlay, which has already been destroyed. One approach I tried involved using QQuickOverlay::itemChange() to remove all of the popups (via setWindow(nullptr), to ensure that their window pointer is nullified), since that was called much earlier than the windowChanged() signal is emitted. However, this still resulted in a heap-use-after-free in the same place when running the newly added setOverlayParentToNull() test. I also tried removing the popups in QQuickOverlay's destructor, but this resulted in another heap-use-after-free (when accessing a popup in the destructor) in tst_QQuickPopup::Universal::visible(). The remaining options were: store the window in a QPointer or return early in overlay() if the wasDeleted member of the window was true. Using QPointer seems like it would catch more issues than a single check in overlay(), so I went with that. Fixes: QTBUG-73243 Change-Id: Ieb5ce26dd76d45771d28297031ec43e27d958b5b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickToolTip: fix setTimeout() behavior when tool tip is visibleKonstantin Ritt2019-09-271-1/+2
| | | | | | | by applying the passed timeout value prior to re-starting the timer Change-Id: I27953dbb4781b5cb0c2039d56faa56f3c000206f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Tumbler: fix displacement calculation when wrap is falseMitch Curtis2019-09-241-3/+14
| | | | | | | | | | | | Use the position of the item and the currentItem in the calculation in order to get reliable results. This fixes the displacement being off by a small margin, which increased as the delegate height became smaller. Fixes: QTBUG-66799 Change-Id: Ieca5033fb4c0ed62f5965a21fcab7aa558bd40e6 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: clarify autoRepeat/pressAndHold() behaviorMitch Curtis2019-09-241-0/+4
| | | | | Change-Id: Ia0dea6060be7ffd1c4a16348f166e7cde7ef2df2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* TextArea: prevent changing size of background recursivelyKonstantin Ritt2019-09-191-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the x/y position of background depends on the height/width of background and these values are not constant, the if statement in the method resizeBackground() will always pass. And since `resizingBackground` guard wasn't checked, any geometry change will always call resizeBackground() and then call themself recursively (via the change listener), that means the height/width of background will always be reset, no matter what value you set. Another part of the issue was in determining the extra bits too late: in case the background gets parented by the flickable, the new child caused the flickable to re-calculate its metrics and thus resize the background *prior* to remembering if it has w/h set. As a side effect, this fix also brings the possibility to reset previously set w/h to get the default background sizing behavior. Inspired by da06da57002b64cf4bcde0ca708b3275a5f919ae [ChangeLog][QtQuick][QQuickTextArea] prevent changing size of background recursively in construction Fixes: QTBUG-76369 Change-Id: Ide51ec1ebab63605ae3bfcc10a76a28be960ef36 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Revert "QQuickTextArea: prevent changing size of background recursively"Konstantin Ritt2019-09-191-7/+3
| | | | | | | | | This reverts commit da06da57002b64cf4bcde0ca708b3275a5f919ae. Reason for revert: the change removes symptoms leaving a cause unfixed Change-Id: I0a91409230c521da73ed53e2a00a4ccd8dca7335 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TextArea: correctly resize background when there is no flickableKonstantin Ritt2019-09-131-1/+6
| | | | | Change-Id: Idaf385d12ca9388c0bb0b3f8a47c8e75c620b7eb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickOverlay: micro optimization for disabled multitouch supportKonstantin Ritt2019-09-131-6/+14
| | | | | | | | avoid checking every press event to be one of touch events type when touch events are not delivered at all Change-Id: I1ed91fa124608d8a006cf2f5256ad68294dd465f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix timer events handlingKonstantin Ritt2019-09-122-1/+7
| | | | | | | | if the timer event's timerId isn't recognized, make sure control passes to the base class Change-Id: If5988dbf4ccda6a9887805961b439f93640f71ea Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* DialogButtonBox: fix standard buttons not being translatedMitch Curtis2019-09-112-1/+45
| | | | | | | | | | | | | When calling QQmlEngine::retranslate() after component completion, buttons in a DialogButtonBox were not being retranslated. For now the only way to be notified of language change events is by installing an event filter on the application, but in the future we can use the solution to QTBUG-78141 instead. Change-Id: Ibc435c3829945489adcbaa8a813013fe735a9c38 Fixes: QTBUG-75085 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QQuickIcon: prevent detach-ing when there is nothing to changeKonstantin Ritt2019-09-102-1/+14
| | | | | | | saves a bunch of pointless detach attempts on each deep-copy Change-Id: Ibb1ae99bd54b2d35f9c9aa9e541fb03891ad94ec Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickIcon: properly resolve implicit values - take 2Konstantin Ritt2019-09-101-6/+6
| | | | | | | | | | | This is a follow up of 382531ab5e2270833d3805c57c00ebcf6b24d635, and amends 1241c80eca725c9ac46a0b94d6bdec11a5d00302 . when the property has not been set explicitly, the resolved mask must not contain a respective bit set either Change-Id: I45a334b51fce09ead8e30fe3326a94f35b0f4f56 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-09-081-5/+5
|\ | | | | | | Change-Id: Ifa88045268cdaa1adc0b1e206d5e20a3721d3837
| * QQuickIcon: properly resolve implicit valuesKonstantin Ritt2019-09-061-5/+5
| | | | | | | | | | | | | | | | when the property has not been set explicitly, the resolved mask must not contain a respective bit set either Change-Id: Iab0bd600b5bf458e26ed4601d4d2f608021f1518 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-09-063-19/+19
|\| | | | | | | Change-Id: I859406dc779e59ee5d8e2980e04f8be28b1a69aa
| * ComboBox: document the behavior surrounding the accepted() signalMitch Curtis2019-09-061-18/+17
| | | | | | | | | | | | | | | | Change-Id: I65be8e54ded284d2f80b5a1f301b75223bd81bb3 Fixes: QTBUG-75338 Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * QQuickPopup: fix compiler warningKonstantin Ritt2019-09-051-0/+1
| | | | | | | | | | | | | | | | > warning: unannotated fall-through between switch labels > note: insert 'break;' to avoid fall-through Change-Id: Ia70fb6b666f874a245a113d61a6cb3e8e7aa2712 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Minor typo fixKonstantin Ritt2019-09-051-1/+1
| | | | | | | | | | Change-Id: I335e59f09c48a8b52c7f690cedba95952c5adfa3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Doc: Replace the "Qt Quick Controls 2" instancesVenugopal Shivashankar2019-08-2217-18/+18
| | | | | | | | | | | | | | | | | | Now that Controls 1 is deprecated, it's ideal to use "Qt Quick Controls" instead of "Qt Quick Controls 2". Task-number: QTBUG-70333 Change-Id: Ie745db4b61071ddb5e06150d4e739cda74c59f41 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-301-3/+7
|\| | | | | | | Change-Id: Ib1c507845cae7f354fe5a5fb9d71ee6963949bd0
| * QQuickTextArea: prevent changing size of background recursivelyWang Chuan2019-07-241-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the x/y position of background depends on the height/width of background and these values are not constant, the if statement in the method resizeBackground() will always pass. And since a change listener is set before calling setHeight()/setWidth() in background, these two method will always call resizeBackground() and then call themself recursively, that means the height/width of background will always be reset, no matter what value you set. [ChangeLog][QtQuick][QQuickTextArea] defer adding change listener and prevent changing size of background recursively in construction Fixes: QTBUG-76369 Change-Id: I2ec37cad7f35cb1c756276326fe69e860c6b8de5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickComboBox: emit countChanged signal when model is updatedWang Chuan2019-07-111-0/+1
| | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick][QQuickComboBox] countChanged signal now will be emitted when a new model is set to the ComboBox Fixes: QTBUG-75972 Change-Id: Ic26718453ba06ba284ac5903fc6f55ddf3523331 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-07-048-32/+37
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/accessibility/tst_accessibility.cpp Change-Id: I0bc187e2a8edb4e357c1bf114dd9b1977d5c1e45
| * Fix crash in QQuickContainerPrivate::removeItemJüri Valdmann2019-07-031-0/+1
| | | | | | | | | | | | | | | | The count variable should be updated after removing the item. Fixes: QTBUG-76164 Change-Id: I141d720ffaa890002d98a7d2448adca9a7d7d2f3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Doc: correct name of property in snippetNico Vertriest2019-06-181-1/+1
| | | | | | | | | | | | Task-number: QTBUG-75558 Change-Id: Ic9856c6f6da4e0beefe2fe6f1bbaea8fdd67ea0d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Doc: Add specs about focus propertyNico Vertriest2019-06-181-0/+13
| | | | | | | | | | | | Task-number: QTBUG-75546 Change-Id: I6e672c3a8390c4cf10dc9576cc3bf1eb10a6246b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Accessibility: Remove redundant checkbox role codeFrederik Gladhorn2019-06-132-11/+0
| | | | | | | | | | | | | | | | To make switch work, the base class now returns checkbox when it has the checkable property. With that change, this is no longer needed. Change-Id: I41d8f774cb244f922b859fd9f2dde75913e965b6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * Accessibility: Switch should have checkbox as roleFrederik Gladhorn2019-06-131-0/+4
| | | | | | | | | | | | Fixes: QTBUG-76356 Change-Id: I8f8e8331adbe741be2c893f2140d793d1b901434 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Doc: Fix documentation warnings for Qt Quick Controls 2Topi Reinio2019-01-152-17/+15
| | | | | | | | | | | | | | | | | | | | | | - The correct module header name is QtQuickControls2 - Add dependency to qtgraphicaleffetcs - RangeSlider: Move \qmlsignal commands out of \qmlpropertygroup - Fix linking to content[Width|Height] for ScrollView Change-Id: I1636fef5f4365a8e9f80b0b8df17e78999bfd3f8 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Don't unnecessarily transform keysequences into stringsUlf Hermann2019-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | Otherwise we cannot interpret them as the original key sequence anymore. When passing them on they are interpreted as the number key that represents the numeric value of the key sequence enum. Change-Id: Idd94ef95bc693cb6d51162dd1994adc953b52e25 Fixes: QTBUG-75572 Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Container: Keep currentIndex at 0 when removing item 0 if possibleJüri Valdmann2019-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Current behavior is to always decrement the currentIndex when the current item is removed -- even when the current item is item 0. This means, for example, that in a TabBar with three tabs and the first tab selected closing the first tab will leave nothing at all selected. Change behavior to keep currentIndex at 0 if there are still items left in the container. Now closing the first tab will leave the next remaining tab selected. Change-Id: If4e1903366e29fcee8226b776d5b2e03cec189df Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.13.0' into 5.13Qt Forward Merge Bot2019-06-201-6/+6
|\ \ | | | | | | | | | Change-Id: I76cc3f99ecaca3eebe49fd129e3b3562ebd6ea09
| * | Doc: fix import versions in SplitView documentationv5.13.0-rc3v5.13.0-rc2v5.13.0Mitch Curtis2019-06-041-6/+6
| | | | | | | | | | | | | | | | | | Change-Id: Ib491000bf2751f24e3dc635958bdf997193c225e Fixes: QTBUG-76077 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | SplitView: fix preferredHeight not being restored in restoreState()Mitch Curtis2019-06-101-4/+4
|/ / | | | | | | | | Change-Id: Icc236494f5df382d6bc49092d23a460822c835a1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-043-9/+26
|\| | | | | | | Change-Id: I1ec3d930d4131ba6d1de687250c0f4f698946af4
| * Fix MenuItem width not matching Menu's available widthMitch Curtis2019-05-031-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Short version: There are currently two problems with MenuItems: - Mirrored MenuItems don't fill the Menu's available width. - MenuItem does not fill the Menu's available width when changed after Component completion. This patch fixes both of them by listening to geometry changes in both the contentItem and individual menu items, and setting the explicit width of those menu items when either changes. Longer version: The first problem can be seen whenever the MenuItem's implicitWidth changes: - QQmlEngine::retranslate() is called, causing all bindings to be re-evaluated - The MenuItem's font size changes - The MenuItem's icon size changes - etc. We fix this by making Menu listen to the width of each of its MenuItems and call resizeItem() if it doesn't have an explicit width. The second problem can be seen when e.g. resizing a Menu to account for new items that are wider and hence require more space. This can be fixed by listening to width changes in Menu's contentItem, which was actually done in earlier versions but (probably accidentally) removed in 482ecb0f. I had tried to solve both issues by setting the explicit width of MenuItem to the width of its Menu, or undefined if it has none (which means it reverts to its implicit width). However, this does not account for e.g. MenuSeparator and custom items that can be added to Menu - they should also have their width fill the Menu automatically if they don't have an explicit width set. Change-Id: I95dd0da0919a1e297f2e2030da746ff1f1a17644 Fixes: QTBUG-75051 Fixes: QTBUG-75142 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * Doc: bindings to x/y/width/height of contentItem aren't respectedMitch Curtis2019-05-031-2/+3
| | | | | | | | | | | | Change-Id: Idecee26bcae178ed294c062819f55e12a65af37d Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Doc: fix currentText link, add more \sa linksMitch Curtis2019-05-021-3/+3
| | | | | | | | | | Change-Id: Ibde952a165c9e0fb40133ce554e90ba35c93feee Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-251-1/+15
|\| | | | | | | Change-Id: Ibf39232616ea6ef67242b70011aa683ce8dc0b4f
| * ScrollBar: fix value not changing when scrolling via VoiceOverMitch Curtis2019-04-241-1/+15
| | | | | | | | | | | | | | | | | | Connect to the QQuickAccessibleAttached::increaseAction() and QQuickAccessibleAttached::decreaseAction() signals. Change-Id: I9d6b37ac68d8790edcb3d4d72f155ec8511cabe2 Fixes: QTBUG-75072 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Fix building with qreal floatJeremy Powell2019-04-231-2/+2
| | | | | | | | | | Change-Id: I02ebf4277142ef426194da0992b3348bd3c83998 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta3Qt Forward Merge Bot2019-04-134-7/+54
|\| | | | | | | Change-Id: Ice7d2ed56c85521a946b218d84087b255d3613ae