summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Skip already closing widgets when checking whether application can quitTor Arne Vestbø2021-01-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | QApplication tries to close all windows on quit using closeAllWindows, but closeAllWindows skips windows that are already closing. This can happen when calling quit() from a close event for example. QApplication then tries to verify that all windows have been closed, and that logic should skip the same kind of windows as closeAllWindows does. The fact that these two logics diverge was identified earlier in 5af73cd9db52, but aligning them required further work. As that commit notes, the right fix to align them is building on top of tryCloseAllWidgetWindows(), which already returns true/false based on whether it could close all windows or not. But, unlike the existing logic in QApplication::event(), it doesn't skip Popups or Dialogs, so that discrepancy needs further research. Pick-to: 6.0 Fixes: QTBUG-89580 Change-Id: I87bff56f2eb8a539f1c859c957f5f239dc1eb93d Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* TableView: Trigger the resizing of editors resizing a row/columnAndy Shaw2021-01-051-0/+4
| | | | | | | | | | | If there is an editor in the table then this needs to be updated as the resize happens, otherwise it will not adapt to the new size correctly and can appear drawn over other cells. Fixes: QTBUG-85484 Pick-to: 5.15 6.0 Change-Id: I918c37f1ee1b0614c03c6b38f95f0f8b35a571f2 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* QTreeWidgetItem: fix documentation error for childIndicatorPolicy()Christian Ehrlicher2021-01-051-1/+1
| | | | | | | | | | | The default value is 'DontShowIndicatorWhenChildless' and not 'ShowForChildren'. Fixes: QTBUG-83648 Pick-to: 6.0 Pick-to: 5.15 Change-Id: I5d4dd9f3f58bcac09ed38d8ae451e3b771695ce7 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* QAbstractItemView: fix selectionCommand() with no eventChristian Ehrlicher2021-01-051-3/+3
| | | | | | | | | | | | QAbstractItemView::selectionCommand() returned the wrong SelectionFlags when no event is given since c4366ff0183a9a4a5c6eff0312b713e9c5eb97ea. Therefore re-add the call to QGuiApplication::keyboardModifiers() when no event is given and add a unittest for them so it's not removed again. Fixes: QTBUG-89711 Change-Id: I107357df08c4ff1b1a14d49523401c5e7b428f56 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Simplify and fix issues with QMenuPrivate::moveWidgetToPlatformItemTor Arne Vestbø2021-01-042-49/+35
| | | | | | | | | | | | | | | | | View embedding when QWidget is involved is a bit finicky. This change breaks down the steps needed to embed it into an NSMenu item, and simplifies the process by not relying on a container widget. The main issue is that QCocoaWindow::recreateWindowIfNeeded() will potentially create an NSWindow for the embedded view, resulting in a stray view. To prevent this we set the Qt::SubWindow flag on the window, but QWidget tends to reset this flag when the widget doesn't have a parent, so we need to be careful about which order we do the setup. Pick-to: 6.0 5.15 Change-Id: I505f7c0a2d8e4350511fdb01a5e9b9c623a40a41 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QAbstractButton: don't access nullptr in queryButtonList()Christian Ehrlicher2021-01-011-1/+3
| | | | | | | | | | | | When a button has no parent, QAbstractButtonPrivate::queryButtonList() unconditionally accessed parent which results in a nullptr access. Did not crash because qt_qFindChildren_helper checks for nullptr and therefore could only be found with a sanitizer. Fixes: QTBUG-83865 Change-Id: I591e546e96acba50770935b9c3baaf08b09b833d Pick-to: 6.0 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* QStylesheetStyle: fix push button label alignmentChristian Ehrlicher2020-12-241-1/+1
| | | | | | | | | | | Due to a copy'n'paste error in 01ec11507d7ef3de09bad9d1ef8e6d4a3d6c4428 the valign was not properly determined for text-align bottom. Fixes: QTBUG-89366 Change-Id: I081e1b24bba0edd9dd3754599a111c1658b18746 Pick-to: 6.0 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QStyleOption: avoid code duplicationChristian Ehrlicher2020-12-231-47/+21
| | | | | | | Use delegate constructors to avoid code duplication Change-Id: I5c7d3764966ec07d1e3d175ccb075c64408d2338 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Fix broken link in stylesheet examplesNico Vertriest2020-12-231-2/+4
| | | | | | Task-number: QTBUG-89211 Change-Id: Idde01e22dd57c37c78d8c86305d047562e5c1f64 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QListView: don't crash when an empty container is passed to itemsRect()Christian Ehrlicher2020-12-221-7/+3
| | | | | | | | | | QIconModeViewBase::itemsRect() is crashing with Qt6 when an empty container is passed. Fixes: QTBUG-89434 Change-Id: I324f1a34b62e67c7bbd3fe33227f4174df7d3d37 Pick-to: 6.0 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Doc: Don’t use \note when documenting enum valuesMorten Johan Sørvig2020-12-211-1/+1
| | | | | | | | | | qdoc does not render these nicely when outputting html: the enum value table table is split in two around the \note. Pick-to: 5.15 Change-Id: Ic2b8c5a247d1100a766e4ae10161aa6ee7644514 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Make QPushButton on macOS use QFocusFrame to fix alignment problemsDoris Verria2020-12-212-1/+8
| | | | | | | | | | | | | | Alignment problems occur for pushbuttons because they appear smaller then their actual widget geometry, which is used for their alignment in layouts. To fix, shift the pushbutton's rect to the left, adjust SE_PushButtonLayoutItem accordingly and use QFocusFrame to render the focus frame ring outside the widget's paintable area. Fixes: QTBUG-89133 Fixes: QTBUG-81452 Pick-to: 5.15 6.0 Change-Id: Iee885a4fb3674d966e5ff3b5c04a0845521b2d72 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove already-set option style feature for QCommandLinkButtonDoris Verria2020-12-111-2/+0
| | | | | | | | | The QStyleOptionButton::CommandLinkButton feature is already set in the QComnandLinkButton's initStyleOption() so remove its setting in the paintEvent. Change-Id: Ic1d723c0671d6d478825d7ba2173db72a8b39c36 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't show focus rect for QCommandLinkButtonDoris Verria2020-12-111-0/+1
| | | | | | | | | | | Since QPushButton sets WA_MacShowFocusRect attribute upon init, this will be set for QCommandLinkButton too. However, we do not want to draw the Mac focus frame for QCommandLink buttons so remove this attribute for them. Pick-to: 5.15 6.0 Change-Id: Ida7a437a54be078caaebc2c0744243d50e14a87f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Override initStyleOption() for QCommandLinkButtonDoris Verria2020-12-112-0/+7
| | | | | | | | | | | | | In QPushButton::initStyleOption() there is no style option feature set to distinguish QCommandLinkButtons. The QStyleOptionButton::CommandLink Button feature is only set during the paintEvent, but in some cases we need to check for this feature before painting. To fix, override initStyleOption for QCommandLinkButton and set the fea ture there. Pick-to: 5.15 6.0 Change-Id: I8831a6be7da642dcf8830812d99681213e7515dc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Remove setObjectName call from moveWidgetToPlatformItemTor Arne Vestbø2020-12-101-1/+0
| | | | | | | | It wasn't strictly necessary, and was causing a warning due to the use of a character literal. Change-Id: I3552ab06189b3a3f1a635b75bd6c4d8a5bce03f8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QTableView: honor spans when calculating height/width hintChristian Ehrlicher2020-12-101-0/+17
| | | | | | | | | | QTableViewPrivate::heightHintForIndex()/widthHintForIndex() did not honor spans and therefore returned too big values. Fixes: QTBUG-89116 Change-Id: I52948902b7eaaa27c092ed39da68950c3840e8e4 Pick-to: 5.15 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QHeaderView: respect the font role while calculating the elided textChristian Ehrlicher2020-12-102-10/+10
| | | | | | | | | | | | | Amends 4d943846128118e1b9932a17ce6f977a0f4127a5: - The macOS style must now elide the text by it's own since it is no longer done by QHeaderView - Add documentation of QStyleOptionHeader::textElideMode - Remove unused variables from QHeaderView::initStyleOptionForIndex() Task-number: QTBUG-86426 Change-Id: I98fc6771c0cd56d6002390125ffbab1269f6dd39 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Disable WA_QuitOnClose on menu item widget containerTor Arne Vestbø2020-12-101-0/+2
| | | | | | | | | Otherwise it will prevent quitting of the application when the last window is closed, on account of (seemingly) being a top level window. Pick-to: 5.15 6.0 Change-Id: Ib79615dd1e9394c96d39c8f9851005b4c073c165 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QWidget: mark obsolete function isTopLevel() as deprecatedChristian Ehrlicher2020-12-095-6/+9
| | | | | | | | QWidget::isTopLevel() is deprecated and can be replaced 1:1 with isWindow(). Sadly it's was not marked with Q_DECL_DEPRECATED in 5.15 Change-Id: I4508fbde41927f3b82e47a75011179548325029d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Don't refer to "this" in QToolTip documentationVolker Hilsheimer2020-12-091-1/+1
| | | | | | | | | All APIs are static, so there is no "this" pointer. Pick-to: 6.0 Task-number: QTBUG-89082 Change-Id: I4bfe6c14304d311b903878acd5b4c8169f4065c7 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QSplashScreen: draw pixmap with SmoothTransfromMorten Johan Sørvig2020-12-081-0/+1
| | | | | | | | | | | Use high-quality scaling to improve rendering in cases where the pixmap has to be scaled down, such as when drawing a @2x pixmap at 150%. Change-Id: I216b03b61dfa2cc2cc8c573e24a576424f6f5d17 Fixes: QTBUG-88982 Pick-to: 6.0 5.15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Restore pass-by-ref to QRect QCalendarWidget::paintCell()Edward Welbourne2020-12-082-2/+2
| | | | | | | | | | | Accidentally changed to pass-by-value while doing that to QDate, in commit af837734b2259201f126b206bd5299497e080f7b Task-number: QTBUG-86400 Change-Id: I8d2db532f537e5f82a5f3b36e72fcf7fefdd2ee5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 8db0d701e8b1fe00cdd5d71c18afff84de606013) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QHeaderView: respect the font role while calculating the elided textChristian Ehrlicher2020-12-084-12/+18
| | | | | | | | | | | | | | | | | The font role in the header view was not taken into account when the text for an item should be elided. This leads to a wrongly elided text esp. visible when the font size is different to the font of QHeaderView. Fix it by passing the elide mode to the style since only the style knows the used font (e.g. bold or not bold) and available rect. This is now in sync with CE_ItemViewItem where the eliding is also done by the style and not by the item view. [ChangeLog][QtWidgets][QHeaderView] QStyleOptionHeader got a new member textElideMode. Fixes: QTBUG-86426 Change-Id: If6914fe5aaa5d285e6da55d2129f9249d90da3d7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Android: Qml accessibility fixesPiotr Mikolajczyk2020-12-082-2/+30
| | | | | | | | | | | | | | | | | | - Accessibility focus can follow the position of the widget (for example when swiping on a scrollview) - controls are clickable directly after appearing on the screen after scroll (previously you had to click somewhere else on the screen, and after that you could focus the newly appeared control) - checkbox and switch react correctly on click action - fixed combobox behavior with accessibility enabled Task-number: QTBUG-79611 Pick-to: 6.0 5.15 Change-Id: If36914ab0165f33593e68fd7ecf168693f8538a7 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QStyleAnimation: make sure the last frame of animation is renderedWang Chuan2020-12-071-2/+2
| | | | | | | | | | Amend to 8738f09b9fc1b35e3dc78211368d87069f3071f7. The last frame of animation might be lacked if [_skip < fps]. Fixes: QTBUG-89118 Pick-to: 6.0 5.15 Change-Id: Ia0345e2aff7579afe2d60c4e7495bfaa1f36198c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Use (new) erase()/erase_if() algorithmsMarc Mutz2020-12-054-14/+6
| | | | | Change-Id: I45c18fd45c20b226e44d16315e3ebb6c305d4ab0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove non-existent function QApplication::desktop() from docsAndreas Buhr2020-12-031-1/+0
| | | | | | | | | | The method QApplication::desktop() was removed. This patch removes a line mentioning it in the documentation. Task-number: QTBUG-88533 Pick-to: 6.0 Change-Id: I123e41c342d64da347b9bd59378e52a8e0301c1a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Dialog: Fall back to transient parent to make dialog window get centeredYuya Nishihara2020-12-031-1/+14
| | | | | | | | | | | | | | | Unlike QWidget-based application, a dialog displayed in QML app doesn't have QWidget parent, so it would be centered in the current screen. Let's fall back to transient parent window if widgetParent() is missing. It's tempting to rewrite adjustPosition() to not depend on QWidget at all, but that seems not easy. Lookup path of window() and transientParentWindow() is slightly different for example, and QWidget::pos() is used instead of mapToGlobal({0, 0}) if the widget is embedded into a native window. Fixes: QTBUG-63406 Change-Id: If72d90aee8d972240243184de4d3c09d77f704ff Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Adjust the format of code blocks in function mouseReleaseEventQiang Li2020-12-031-1/+1
| | | | | | Pick-to: 6.0 Change-Id: I8441b1c4f22ec04e34e8c2c5e9ccc69d34c67e01 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Reduce the scope of variable in focusInEvent()Wang Yu2020-12-021-1/+1
| | | | | | | | | The scope of the variable 'frm' can be reduced if the variable 'd->formatExplicitlySet' is true. So declare the variable when the variable 'd->formatExplicitlySet' is false. Change-Id: I27cea412af827d30ad9188106b7f14025e5ddb68 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix links to Application ExampleVolker Hilsheimer2020-12-029-14/+16
| | | | | | | | | | The example was renamed in 6cb36d825d365988ea7a601218bdd3a329290469. Pick-to: 6.0 Change-Id: Ic9daac60002c9988dfeb5c7dcde74edb69388f37 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* QHeaderView: fix spurious sortingGiuseppe D'Angelo2020-12-012-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHeaderView sorting may be triggered when the user performs some mouse interactions that should really not result in sorting. Generally speaking, this happens when the user: * presses on a non-movable section (A) * moves on another section (B) * releases on that section resulting in B becoming sorted / flipping sorting. (Non-movable is required, otherwise dragging would cause section moving, not sorting.) To make the matter worse, QHeaderView doesn't check that the release happens within its geometry. This makes sense when moving sections: one is able to drag a section horizontally/vertically even if the mouse leaves the QHeaderView. But when not moving sections, this means that one can * press on section (A), * move the mouse anywhere vertically (for a horizontal bar, mut.mut for a vertical) above or below another section (B), that is, outside QHeaderView's geometry * release the mouse and cause B to be sorted. Fix it by 1) remembering which one was the section that the user originally clicked on; that's the only one that can possibly become sorted (if we're not moving and other conditions hold). No other variable seemed to remember this. 2) on release, check that it happens within that section's geometry. If so, sort. Pick-to: 6.0 5.15 Change-Id: Icfb67662221efbde019711f933781ee1e7d9ac43 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Fix various documentation warningsTopi Reinio2020-11-301-1/+1
| | | | | | | | | | | | | - QList iterators are now nested classes inside QList. - Drop reference to Qt OpenGL Widgets landing page, there is no such page. - Fix typos and linking issues. Fixes: QTBUG-86295 Pick-to: 6.0 Change-Id: I964843deb81aa55ff8ddb9a1c2b004cb72e68de9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QHeaderView: allow un-sorting of modelsGiuseppe D'Angelo2020-11-303-6/+81
| | | | | | | | | | | | | | | | | | | | | | If one clicks on a QHeaderView's section, the header view will sort the view by the respective column/row. By clicking multiple times, one is able to toggle the sorting between ascending and descending. Something that is NOT possible to do however is to un-sort the view -- that is, to restore the model's original sorting. This must be done via code, by asking the header or the view to sort by section -1. This commit adds new property to QHeaderView to make it possible to unsort models. Basically, the sort indicator becomes a tri-state: sort ascending, sort descending, unsort (sort by column -1). [ChangeLog][QtWidgets][QHeaderView] Added the sortIndicatorClearable property. Setting this property allows the user to clear the sort indicator on a section, resetting the model to its default ordering. Change-Id: Ibf4e280b2086b75ccd64d619ea4d70816dc3529f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-3012-14/+14
| | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Doc: Use explicit linkage with target_link_librariesKai Koehne2020-11-301-1/+1
| | | | | | | | | | | | | | The Professional CMake book suggests always using explicit linkage with target_link_libraries, so let's use that. Whether to use PUBLIC or PRIVATE depends on the context. But let's be conservative and advise on using PRIVATE by default. Task-number: QTBUG-88935 Pick-to: 6.0 Change-Id: I12b80ee85be9f6916f1e4dea6b1c9cb29e03c20f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Return an empty QStringList if the family string is emptyAndy Shaw2020-11-271-1/+1
| | | | | | | | Since doing a split will create an empty entry, then we can save time and just return an empty QStringList in this case Change-Id: I86a6532e7243151493ea4021bfcc05e4c2a9cbf0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix compiler warnings from deprecated methodVolker Hilsheimer2020-11-271-2/+2
| | | | | | | | | QTextCharFormat::fontFamily is deprecated in favor of fontFamilies, which returns a QStringList wrapped in a QVariant, whereas the setter expects a QStringList. Change-Id: I3333eaae4fc5ec3e3bdbec58047d6b3554b4a171 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QtWidgets: Propagate event device when translating mouse eventsFriedemann Kleint2020-11-275-6/+12
| | | | | | | | | | | There are a few places left over, for example the QTextEdit creating mouse events in a timer and notably QGraphicsView. Task-number: QTBUG-88678 Task-number: QTBUG-46412 Pick-to: 6.0 Change-Id: I7ed23911be3b86b4b39fb478b947ec3b7a60761f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QPushButton: fix support of style sheet rule for text alignmentXiang Xiaojun2020-11-261-2/+4
| | | | | | | Fixes: QTBUG-86857 Pick-to: 5.15 6.0 Change-Id: I7e3e2b5323b1e46f572cacfddae20cb6e7882a47 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename Application ExampleVolker Hilsheimer2020-11-261-1/+1
| | | | | | | | | | Prefix it with "Qt Widgets -" to make it a bit clearer in the list of highlighted examples which module this one is about. Pick-to: 6.0 6.0.0 Change-Id: I0bf65b02db72173f1adfe0bcf8657be7905dbd6c Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QStackedLayout: fix a memory leakGiuseppe D'Angelo2020-11-231-1/+3
| | | | | | | | A layout takes ownership of the QLayoutItem passed to addItem. Change-Id: Iea3c64453f3cbf4f1b5660e505c1a35dca537833 Pick-to: 6.0 5.15 5.12 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Drop a [[maybe_unused]] on a variableGiuseppe D'Angelo2020-11-231-1/+1
| | | | | | | Turn it into an inline variable. Change-Id: Iab7fa2d53259ced0b1a78bf7368e0e862ba2c799 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Update CMake functions in Qt Widgets for Qt 6Kai Koehne2020-11-233-80/+12
| | | | | | Pick-to: 6.0 6.0.0 Change-Id: I4110e8695c75c40cec6f94bb94879b07282b29d3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace qt_make_unique with std::make_uniqueAllan Sandfeld Jensen2020-11-234-18/+10
| | | | | | | We can depend on C++14 now. Change-Id: Iee9796cd22dbfbb70d4bdb25f0eee1662a026d6d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QLayout: add a way to unset user-defined contents marginsGiuseppe D'Angelo2020-11-202-0/+14
| | | | | | | | | | | | Once user-defined margins are set on a layout, there's no way to unset them, except by abusing setContentsMargins and passing -1, which is a total API abuse (does a negative margin mean that contents *overflow* the layout?). Add a proper function. [ChangeLog][QtWidgets][QLayout] Added unsetContentsMargins(). Change-Id: I089788a7470f9649a8f00e42914dafb7242f12cd Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* widgets: Don't report new focus object during clearFocus() unless neededTor Arne Vestbø2020-11-201-6/+7
| | | | | | | | | | | | | | | We do not unconditionally clear focus_child like the existing comment said. We only do it if the focus_child was the widget that is clearing focus. So in many cases we'll end up with the same focus object as before. We can not report that as a focusObjectChanged to the window, as that will potentially trigger a reset or cancel of the current input method for the (unchanged) focus object. Fixes: QTBUG-86976 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I54367e46eda7a94d967f58960bd926c195dc09cc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFont: Prefer setFamilies() over setFamily()Andy Shaw2020-11-203-9/+9
| | | | | | | | | | | | | | | | By depending on setFamilies() then we can be sure that font names with spaces, commas, quotes and so on are correctly handled without being misinterpreted. For now it will split on the comma when a string containing one is passed to setFamily. But from Qt 6.2 this will be removed to preserve the family string as a convenience function. [ChangeLog][QtGui][QFont] Indicated that setFamilies/families is preferred over setFamily/family to ensure that font family names are preserved when spaces, commas and so on are used in the name. Change-Id: Id3c1a4e827756a4c928fed461a4aafa5a0f06633 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* wasm: fix showing tooltipsLorn Potter2020-11-191-1/+1
| | | | | | | Change-Id: I4c82ccc2bfa1019ef105ccf20982786097c126b9 Fixes: QTBUG-87227 Pick-to: 5.15 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>