summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
Commit message (Collapse)AuthorAgeFilesLines
* StyleSheet: Use rule for ComboBox in embedded QLineEditVolker Hilsheimer2021-08-121-6/+5
| | | | | | | | | | | | | | | | | | An editable combobox uses an embedded QLineEdit as an implementation detail. That lineedit should use the rules that are set for the combobox to render itself, similar to what was already implemented for the lineedit used in a QAbstractSpinBox. The containerWidget helper function provides the logic for identifying the container of the rendered widget, returning the QAbstractSpinBox or the QComboBox for an embedded QLineEdit. Use that method rather than duplicating the logic. Fixes: QTBUG-95631 Change-Id: I50bc92a62715608b11c2c923f8f9215f56bfd15e Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit adafa5ee1f37739f33f6417f27c8ee7308aaad9c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add high-resolution pixmaps for macOS dock widget title iconsVolker Hilsheimer2021-07-1921-8/+8
| | | | | | | | | | | | The macOS style falls back to the QCommonStyle for those, and that style loads the macstyle pixmaps. Weird, but cleaning that up is for another commit. Fixes: QTBUG-38776 Change-Id: Ie1fe721387e64cb91ee5fc528667a63e6ddd6eed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 550e511ec8a1aa12ac75ebd71079511572840065) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use base style when drawing item view item with only indicator styledVolker Hilsheimer2021-07-141-5/+9
| | | | | | | | | | The base style should still draw the item and the selection highlighting. Fixes: QTBUG-83619 Change-Id: I1cd8c4fce48cb5543337415918fc99ffb5e19e00 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 1d48572b4ea765cb8d81bf227eabaf907a91e7de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make dockwidget title bar buttons show againVolker Hilsheimer2021-06-151-4/+6
| | | | | | | | | | | Amends f61304fc77a622170ef3bbcbcb37c5a90c6f87ea, which renamed the files but didn't adjust the code. Task-number: QTBUG-38776 Change-Id: If54dd986975dd28f147a98628317b1369d0c690f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 22571c21c9be10d9ada756c598f519f74273579a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Correctly support style sheet for toolbutton menus and arrowsVolker Hilsheimer2021-06-101-25/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | QToolButton can show an arrow instead of an icon, and that arrow can, as per the documentation, styled via the ::down/up/left/right-arrow pseudo element. This was not working at all, as the implementation confused the down-arrow with the menu arrow. Implement this correctly for all arrow types. A QToolButton can also have different ways to show a menu, either by using a separate section of the button that can be clicked; this section can be styled via ::menu-button and ::menu-arrow. Or by instant or delayed menu popup when clicking the button itself, in which case the button shows an indicator in the button itelf; that indicator can be styled via the ::menu-indicator pseudo element. The old implementation confused the various options, and the name of the PseudeoElement_ToolButonDownArrow didn't help with that. So rename that element to PseudoElement_ToolButtonMenuIndicator, and render it when there is no separate drop down. Fixes: QTBUG-27640 Change-Id: Ia142a5d7498fa717e70f4e5382305e305b29effa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 2b2e7b2ac50e5b4f6e1888e594f6e32338dd2a80) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Calculate space requirement of menu items based on widest elementsVolker Hilsheimer2021-06-081-4/+5
| | | | | | | | | | | | | | | | | | | Since icon, checkmark, text, and shortcut are each rendered aligned within their own column, we need to take the widest of each element into account when calculating the size requirement of each item. Otherwise an item with very long text but no icon will get enough space for the text, but no space for the icon, resulting in the text running over the shortcut or edge of the menu. Fortunately, QStyleOptionMenuItem provides us with the necessary information. Fixes: QTBUG-86754 Change-Id: I0cf0e9adfe480d1004106e7475e498e718bf027b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit c8cb2409477bdc3bc41d6bbdfc5055441cda084f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't draw focus frame if widget has style rules that affect borderDoris Verria2021-05-071-0/+9
| | | | | | | | | | | | | | Skip drawing the focus ring if the widget has a custom styled border, custom focus ring, or any rule that affects the border. For QPushButton, if the style rule has a background set, the bevel will be drawn in the Windows style. Skip drawing the Mac focus frame in that case too. Fixes: QTBUG-93032 Change-Id: I7c4d4bf6f6ce7bbcd17cd620586c5efa44f2b8d6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 05f7dd5ead5927ef7b3301380b81d7194d9e0593) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QTabBar: take a style sheet's font into account when laying out tabsVolker Hilsheimer2021-05-061-3/+18
| | | | | | | | | | | | | | | If a tab has a font assigned to it through a style sheet, then take the font size into account when calculating the contents rectangle. Add a test, which hardcodes the windows style to avoid flaky behavior when e.g. macOS lays tabs out in the center. Fixes: QTBUG-92988 Change-Id: Ifb0ac97db7647cc25367972737be8878e50f6040 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit e3b2b12a912361af309302a4b1fc27c2206322af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix read-only pseudo-state in QPlainTextEdit stylesheetEirik Aavitsland2021-05-061-1/+7
| | | | | | | | | | | Was implemented for the other text edit widgets, but not for QPlainTextEdit. Fixes: QTBUG-92490 Change-Id: Idd2a1b5c743fc030d3f2d4dd24e98f806b58f4d9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f3a042c5ab998c0d283017f3569bb72c392580b7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix label margins for pulldowns with custom styled menu indicator on macOSDoris Verria2021-04-061-0/+7
| | | | | | | | | | | | | Don't apply the QMacStyle's pulldownButton titlemargins to the QPushButton's contents rect if the button has a custom styled menu indicator. This causes the button's text/icon to be misaligned. Fixes: QTBUG-86134 Change-Id: I6ef95d51071c1d79f1cc07425a46958f50091b7e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 37f9f2e7afb2539ead355f1115e10835c2df9f92) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "QPushButton: fix support of style sheet rule for text alignment"Volker Hilsheimer2021-03-111-4/+2
| | | | | | | | | | | | | | | | | This reverts commit 6269438af95bbd988ead08829fa3bc9dc25891e8, and adds a test. This change introduced QTBUG-91735, without fixing QTBUG-86857 correctly. The code already interprets the textAlignment values from the rule, also if no icon is set. Adding the same, or some default textAlignment to the text flags if there is no icon doesn't work. Fixes: QTBUG-91735 Task-number: QTBUG-86857 Change-Id: Iee07e63a40e72909275f32e1caa28b33a595f879 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 674747bac1c8b57d4940de2ee68b6b562dfcad61) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't access data in moved-from objectVolker Hilsheimer2021-03-031-2/+2
| | | | | | | | | | | | | | | It's undefined behavior, esp since we leave it to the compiler to implement a move constructor for the ButtonInfo struct. So read the data that we need first. Fixes static analyzer warning de76eedae524c86f89d6369c0f5af8c7. Change-Id: I8fc458b7e9ba8904ec7a3b1c26aac0628e336ea2 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 4daf83a0dc05f944c066237aa95c388f29ce890a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Initialize QStyleOptionHeaderV2 with correct versionVolker Hilsheimer2021-02-221-1/+1
| | | | | | | | | | Amends 4c6579eacded086ad014b0fd2432095362c1d131 Task-number: QTBUG-91224 Change-Id: I9a41db9354bff2fa706cf6053aa229cdca16759e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 85af149c9b69772ad8c559bd9d771803383c5d05) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Complete documentation for QStyleOptionHeaderV2Volker Hilsheimer2021-02-221-22/+33
| | | | | | | | | | | | Document the isSectionDragTarget variable, and add \inmodule command. Put code and documentation together. Amends 4c6579eacded086ad014b0fd2432095362c1d131. Change-Id: Id8837ca75cd6af13c8dc4c028b304b279e507ade Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit 7f1dc4bb750f412482a55e4f52e29751d2b4120d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Unbreak binary compatibility in QStyleOptionHeaderVolker Hilsheimer2021-02-194-13/+52
| | | | | | | | | | | | | | | | | | 4d943846128118e1b9932a17ce6f977a0f4127a5 introduced a new data member to QStyleOptionHeader, and reduced the size of the orientation member. This changed the binary layout of class instances, and breaks ABI. 180c662b0790c6eceffdcb4661681d7df1541a2d added another member within the new bitfield. Introduce a new QStyleOptionHeaderV2 class instead with the new members, and use that in QHeaderView, and the styles using the new members. Fixes: QTBUG-91224 Change-Id: I47e6841e6652e4b67f247b7b4514e90be5609156 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 4c6579eacded086ad014b0fd2432095362c1d131) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QDial: fix painting QDial when the rect has an offsetChristian Ehrlicher2021-01-292-6/+6
| | | | | | | | | | When the QDial should be painted with an offset, the dial was not draw correct. Fixes: QTBUG-89574 Change-Id: I646c3d42fba34e8c603a8f81f363ed827f04d5de Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QHeaderView: Mark the drop section during section moveChristian Ehrlicher2021-01-293-4/+9
| | | | | | | | | | | Currently there is no visual feedback where the section move will end up. Therefore mark the drop section to show where the dragged section will be inserted. Fixes: QTBUG-673 Fixes: QTBUG-1114 Change-Id: I3e45a9a9c0604342bb0286fc7cd4c89c757c28cd Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QComboBox/Fusion style: elide text when it's too longChristian Ehrlicher2021-01-231-1/+2
| | | | | | | | | | The fusion style did not elide a very long text in a QComboBox as it's done in other styles / non-popup mode. Fixes: QTBUG-86632 Pick-to: 6.0 5.15 Change-Id: I356a61809220d41717a9039d2b33dd706d034941 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QPushButton: fix drawing pushbutton with a menuChristian Ehrlicher2021-01-201-8/+9
| | | | | | | | | | | | | | | | | Drawing a QPushButton with a menu results in a clipped label text and a wrong aligned decoration and menu button. The position of the menu button was calculated wrong (spacing has to be subtracted since the start position is the right side). Also the text label alignment was done before it was adjusted for the menu button which results in an unaligned (in constrast to a pushbutton without a menu) label and decoration. Fixes: QTBUG-89619 Change-Id: I872d39ff2d8eb685fe6843e38c7f727868e1ee9a Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Funning <huangyub@uniontech.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Make QStyle::proxy() always return the leaf proxySergio Martins2021-01-201-2/+4
| | | | | | | | | | | | | For example: fusion -> proxy1 -> proxy2 Now returns proxy2. Fixes: QTBUG-85556 Pick-to: 6.0 5.15 Change-Id: I2a60329f948b59ef7d0752d273bee3854a200547 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Correct item indent in checkable menus in stylesheet styleEirik Aavitsland2021-01-201-2/+2
| | | | | | | | | | Not only the checkable items need to be indented, but all items in the same menu, so that they line up. Pick-to: 6.0 5.15 Fixes: QTBUG-90242 Change-Id: I559005f753b5cd19eaeeeb6658178d62de93b4ef Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* control scrolling of QTabBar using StyleHintSophie Kums2021-01-193-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mouse wheel/touchpad scroll signals sent to the tab bar trigger cycling through the tabs. In applications where the tab bar is close to "mouse click hotspots", the cursor may accidentally be left over the tab bar instead of the main content of the window. When the user wants to scroll up/down the main conten, the scroll signals are thus sent to the tab bar and instead of scrolling, the focus switches to another tab. This is confusing to the user, because not only does the application not carry out the desired action (scrolling through the main content), it jumps to a different tab. Two common examples of applications affected by this nuisance are Konsole and any kind of browser (file browser or web browser), where the address bar is right below the tab bar. Moreover, on macOS, scroll events do not have an effect on the tab bar widget of the native UI. Currently, the code makes use of preprocessor directives to achieve consistent behavior on macOS (`#ifndef Q_OS_MAC`). This patch implements the check of a StyleHint in order to determine if scroll events on the tabbar should have an effect. This approach is more consistent with Qt coding style than OS-dependent preprocessor directives and, in addition, makes the behavior configurable according to the user's preferences. [ChangeLog][QtWidgets][QStyle] Added SH_TabBar_AllowWheelScrolling as a style hint to enable/disable cycling through tabs using the scroll wheel. This defaults to true in all styles except the macOS one so there is no change in existing behavior. Change-Id: I99eeb5a1aab03cbc574fac7187d85a8a2d60cf34 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QTabBar/Windows: Fix close button icons being too small on high-res screensFriedemann Kleint2021-01-155-11/+29
| | | | | | | | | | Add 32x32 versions. Move the icon creation to a helper function. Fixes: QTBUG-88230 Pick-to: 6.0 Pick-to: 5.15 Change-Id: I6dda2084e0122234eacea17ac191a19f6855f466 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QPushButton/fusion style: don't ignore QIcon::On iconChristian Ehrlicher2021-01-141-8/+0
| | | | | | | | | | | | | | | The fusion style did ignore the QIcon::On icon because it reset State_On to avoid the visual shift of a pressed button. But it's not needed to reset this flag - the shift does not happen because the fusion style does return 0 as offset for PM_ButtonShiftHorizontal/PM_ButtonShiftVertical so no shifting will happen. Fixes: QTBUG-86736 Fixes: QTBUG-82110 Change-Id: Ie2aaddb14bc67874f5a9a23d9f04d7a08c6d070f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QStyle: add name() to return the name of the styleChristian Ehrlicher2021-01-145-1/+41
| | | | | | | | | | | | Currently there is no way to get the name of the current style to e.g. create a QProxyStyle for a specific widget only. Therefore add QStyle::name() so QProxyStyle(const QString &) can be called without hard-coding the style name. Remove an unused doc snippet as drive-by. Fixes: QTBUG-8004 Change-Id: I466c5e870a5392b238365bdc930f6a2ecee50cdb Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix read-only pseudo-state in QTextEdit/Browser stylesheetEirik Aavitsland2021-01-131-0/+13
| | | | | | | | | Was implemented for QLineEdit but not QTextEdit. Fixes: QTBUG-83056 Pick-to: 6.0 5.15 Change-Id: I1e67ad0f1c230a062a1e12e8bc0b209c5289dc32 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Set the PlaceholderText color in the palette from the stylesheet as wellAndy Shaw2021-01-121-0/+1
| | | | | | | | | | The color should be used across the board, so the PlaceholderText color should also be respecting the one passed for Text and so on. Fixes: QTBUG-89815 Pick-to: 6.0 5.15 Change-Id: I2accb3db35488f95a1c8ebacf2316a08ee416fac Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-49/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* 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>
* QHeaderView: respect the font role while calculating the elided textChristian Ehrlicher2020-12-101-0/+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>
* QWidget: mark obsolete function isTopLevel() as deprecatedChristian Ehrlicher2020-12-091-1/+1
| | | | | | | | 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>
* QHeaderView: respect the font role while calculating the elided textChristian Ehrlicher2020-12-083-8/+13
| | | | | | | | | | | | | | | | | 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>
* 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-051-1/+1
| | | | | Change-Id: I45c18fd45c20b226e44d16315e3ebb6c305d4ab0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-301-1/+1
| | | | | | | | | | | | | | 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>
* 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>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-165-20/+20
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Adjust the format of code blocks in function pixelMetric()Xu Shitong2020-11-161-13/+16
| | | | | Change-Id: I1ef3c1beb686af090311297523d5d69380a62fbe Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Remove Qt4Compatible paintingAllan Sandfeld Jensen2020-11-122-12/+0
| | | | | Change-Id: Ie54206ca9b509875568f2158e229fca9cb1860a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix qstylesheetstyle clip border errorLu YaNing2020-11-081-2/+2
| | | | | | | | | | | | The left border path clip error when border size is odd. That because borderClip calc path with border with divide 2. It should be 2.0 that make result to accurately real number. Pick-to: 5.15 Change-Id: I8c6f358afa4f3c8c9e5b263707ee145f6e5491c0 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't show QPushButton as hovered unless the mouse is within the bevelVolker Hilsheimer2020-10-221-0/+1
| | | | | | | | | | | | | | | Previous fixes made QPushButton correctly respect the style sheet boxing model (as it's documented to do), ignoring clicks that were within the margin area of the button (ie outside the bevel). However, a hover state selector in the style sheet would still be used for the entire widget. Turn on mouse tracking for widgets that have a hover state selector, and handle mouseMoveEvent to set an explicit hovered state only when the mouse hits the button. Use that state to initialize the style option. Fixes: QTBUG-87706 Change-Id: I2f423b760c85cfab9faac4be44a5c7dcf2ba1c23 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-071-2/+2
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename the new platform APIs from QPlatformInterface to QNativeInterfaceTor Arne Vestbø2020-10-071-1/+1
| | | | | | | | | | | | We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fusion: Don't add unnecessarily extra padding for a groupboxAndy Shaw2020-09-251-1/+6
| | | | | | | | | | | | | If there is not a title or an indicator for a groupbox, then there is no reason to add extra padding for it when placing the contents of the groupbox. So this accounts for when one or the other is not set so that the space is used more evenly. Fixes: QTBUG-86411 Change-Id: I536798b57e1195c5a13218f1f82431c4e91f6852 Pick-to: 5.15 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix some qdoc warnings: typosVolker Hilsheimer2020-09-211-1/+1
| | | | | | | | It's \reimp, not \reimpl, and this particular textAlignment variable documentation is for QStyleOptionComboBox. Change-Id: I90f1519410a4378c54777e29acce70b55975e70e Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix conversion warnings when setting alpha to QColorFriedemann Kleint2020-09-152-2/+2
| | | | | | | Adapt to 5bb4baae0379d5903f547f0399be9620f5ab06a0. Change-Id: Id65f87740f9de8e0d3624ff63c431dcad642f3a5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QStyleSheetStyle: Fix push button hit testing with paddingVolker Hilsheimer2020-09-151-2/+5
| | | | | | | | | | | | | Amends f9940b15f7f0fde731431626172939b9821fd660, which amended 6e1d70ae12baae4610356ec7b69635ad75a97b4e. The bevel of the button is not defined by the contentsRect, but by the borderRect that the stylesheet style calculates. Change-Id: I9a0d5bf29a06ce2270014f0d144e33cc3a1a7473 Pick-to: 5.15 Fixes: QTBUG-86587 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Make QStringList an alias to QList<QString>Lars Knoll2020-09-121-1/+0
| | | | | | | | | | | | | | | | | | Fix our API, so that QStringList and QList<QString> are the same thing. This required a bit of refactoring in QList and moving the indexOf(), lastIndexOf() and contains() method into QListSpecialMethods. In addition, we need to ensure that the QStringList(const QString&) constructor is still available for compatibility with Qt 5. Once those two are done, all methods in QStringList can be moved into QListSpecialMethods<QString>. Change-Id: Ib8afbf5b6d9df4d0d47051252233506f62335fa3 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Clean up widget snippets projectPaul Wicking2020-09-101-1/+1
| | | | | | | | | | The main snippets project must be a subdirs project. Move some files and update the affected documentation. Task-number: QTBUG-86497 Pick-to: 5.15 Change-Id: I60073d1b8bd53aa09600eeccf06ba8457ac7c708 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>