summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qcommonstyle.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix wrong DPI used by QStyle::pixelMetric()Friedemann Kleint2020-02-221-21/+21
| | | | | | | | | Pass on the option or the widget in order to ensure usage of the correct DPI for High DPI scaling. Task-number: QTBUG-82356 Change-Id: I5df903a83f88adebd143e514e2fead367d39f015 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QPushButton: fix text truncating when icon+text+menu is drawnChristian Ehrlicher2020-02-061-1/+2
| | | | | | | | | When a QPushButton has an icon, text and menu, the text is truncated. In RTL mode the menu indicator is also drawn on the wrong side. Fixes: QTBUG-81784 Change-Id: I27ecb67d12c68ac939540f0f836b2e2875706b4b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QCommonStyle: make sure to pass the widget to pixelMetric()Christian Ehrlicher2019-12-281-6/+6
| | | | | | | | | | | QStyle::pixelMetric() expects the affected QWidget as third parameter. Some (external) styles rely on this to return the correct value. Therefore add the widget to the function calls where possible. Fixes: QTBUG-80971 Task-number: QTBUG-1857 Change-Id: I768ebb61a914cdba6e0549f841d46cf3edb0a2a6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QPushButton: fix icon + text layouting in RTL modeChristian Ehrlicher2019-12-091-11/+11
| | | | | | | | | | | | | | The fusion style did not properly handle the text layouting for a QPushButton in RTL mode. Also the menu indicator was not adjusted in this case. Fix it by calling the base class implementation as QCommonStyle does it mostly right. Since Fusion does not handle State_On or State_Sunken but QCommonStyle does, explicitly mask them out. Fixes: QTBUG-80083 Change-Id: Ide7bf997b4f4a5b61fcb8ea4a1a152122daef1e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QCommonStyle: Add SP_DialogNoButton case in standardIconKai Uwe Broulik2019-09-281-0/+1
| | | | | | | | It is present in standardPixmap but missing from standardIcon resulting in QMessageBox using the fallback PNG provided by Qt for the "No" button. Change-Id: If4f14c7de26eb32277cd19a7be75360dba4f4e29 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Widget style: Use per-screen DPI in QStyleHelper::dpiScaled()Friedemann Kleint2019-08-231-57/+58
| | | | | | | | | | | | | | | | | Pass the style option to dpiScaled() in order to get the correct screen DPI. The style option contains the font, which again contains the current DPI value. Add QFontMetrics::fontDpi() accessors to get the DPI from the QFont. This DPI will/should be updated on screen change. Replace hardcoded Q_OS_MAC DPI with hardcoded base DPI. This makes per-screen DPI testable on macOS, too. Task-number: QTBUG-45055 Change-Id: I75f8b37d45eb50c3334b46b8469a546d29712f1b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QtWidgets: Fix static method invocationsFriedemann Kleint2019-06-281-10/+10
| | | | | | | | | | | | | | | | | | | | | Apply fixits by Creator and results of manual search focusing on QCore/Gui/Applicaton(Private) methods and variables to prepare for splitting out some classes. Task-number: QTBUG-69478 Task-number: QTBUG-76497 Task-number: QTBUG-76493 Change-Id: Iaf468166793e0cabb514b51c827b30317bf45a2d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Fix build without features.itemviewsTasuku Suzuki2019-05-121-4/+1
| | | | | | Change-Id: I9a7c3b2a3ad68ea76b1d6b79192b936e7cd1d44e Reviewed-by: David Faure <david.faure@kdab.com>
* QAbstractSpinBox: fix some ui glitchesChristian Ehrlicher2019-05-101-1/+2
| | | | | | | | | | | | | | | Fix some ui glitches for QAbstractSpinBox: - update geometry when buttons are toggled on/off - calc button size with subControlRect instead hardcoded 20px - when buttons are not shown, don't add the button size in sizeFromContents for common and macOS style Fixes: QTBUG-39713 Fixes: QTBUG-75303 Task-number: QTBUG-67126 Change-Id: Ibf330c76deb16358a481bba6bd429fff6a5d57ae Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-091-4/+21
|\ | | | | | | Change-Id: Ica3f89ace33585ad7854417a328156f5a68e2a00
| * QAbstractItemView: make v-aligned items texts more user-friendlyChristian Ehrlicher2019-03-081-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 25133a1b77c059e32760f3d288c985183d86da4a fixed the item view text layouting correctly in a technical way. For a vertically aligned text which does not fit into the given rect it is not user-friendly to show some parts of the text. It is better to display the start of it and show an elide marker in the last visible line. Fixes: QTBUG-73721 Change-Id: Ia7453133ea0a229b24196467168c8371585c4d8f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QtWidgets: Fix deprecation warningsFriedemann Kleint2019-03-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix deprecation warnings where possible or add warnings scopes, fixing: dialogs/qdialog.cpp:783:41: warning: ‘void QDialog::showExtension(bool)’ is deprecated [-Wdeprecated-declarations] ^~~~~~~~~~~~~ widgets/qcombobox.cpp:1386:37: warning: ‘void QComboBox::currentIndexChanged(const QString&)’ is deprecated: Use currentTextChanged() instead [-Wdeprecated-declarations]= dialogs/qfiledialog_p.h:168:38: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:590:38: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:617:27: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:617:27: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:645:27: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:1730:17: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:2637:43: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:2750:10: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:2786:49: warning: ‘bool QFileDialog::confirmOverwrite() const’ is deprecated: Use !testOption(DontConfirmOverwrite) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:3654:27: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:3843:48: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] dialogs/qfiledialog.cpp:3895:72: warning: ‘DirectoryOnly’ is deprecated: Use setOption(ShowDirsOnly, true) instead [-Wdeprecated-declarations] styles/qwindowsstyle.cpp:836:19: warning: ‘PE_IndicatorViewItemCheck’ is deprecated [-Wdeprecated-declarations] graphicsview/qgraphicswidget.cpp:2309:51: warning: ‘PM_MDIFrameWidth’ is deprecated [-Wdeprecated-declarations] styles/qstylesheetstyle.cpp:4302:10: warning: ‘PE_FrameStatusBar’ is deprecated [-Wdeprecated-declarations] styles/qfusionstyle.cpp:3676:10: warning: ‘SH_ScrollBar_StopMouseOverSlider’ is deprecated [-Wdeprecated-declarations] Change-Id: I9e15f4a0996476ec88d8823b72f0c537dce97b9c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | Replace QWidget::margin() with QWidget::contentsMargins()Christian Ehrlicher2019-02-131-3/+7
| | | | | | | | | | | | | | | | Replace deprecated QWidget::margin/setMargin() calls with contentsMargin/setContentsMargins(). Change-Id: I7fe8056196d73d1be97446d40a438cd0b1a13817 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-081-63/+101
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml src/network/ssl/qsslsocket_mac.cpp src/widgets/styles/qstylesheetstyle.cpp tests/auto/corelib/kernel/qtimer/BLACKLIST tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp tests/auto/testlib/selftests/expected_blacklisted.lightxml tests/auto/testlib/selftests/expected_blacklisted.tap tests/auto/testlib/selftests/expected_blacklisted.teamcity tests/auto/testlib/selftests/expected_blacklisted.txt tests/auto/testlib/selftests/expected_blacklisted.xml tests/auto/testlib/selftests/expected_blacklisted.xunitxml tests/auto/testlib/selftests/expected_float.tap tests/auto/testlib/selftests/expected_float.teamcity tests/auto/testlib/selftests/expected_float.txt tests/auto/testlib/selftests/expected_float.xunitxml Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
| * QToolButton: fix handling multi-line textsChristian Ehrlicher2019-02-071-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | The patch to elide the QToolButton text when there is not enough space introduced a regression with multi-line text. Fix it by using the newly introduced common function to elide multi-line text. Fixes: QTBUG-72226 Change-Id: I066ebbd2f360add93406cc29bb4bbbebf599ba42 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QCommonStyle: factor out elided text calculationChristian Ehrlicher2019-02-071-61/+81
| | | | | | | | | | | | | | | | | | | | Factor out the calculation of the elided text from QCommonStylePrivate::viewItemDrawText() so it can be used by other painting functions. Change-Id: I28e6bfd2fe4d7c552848446fa9913df78589d15b Reviewed-by: Christian Andersen <csandersen3@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QtGui: mark obsolete QPixmapCache::find() functions as deprecatedChristian Ehrlicher2019-02-021-1/+1
| | | | | | | | | | | | | | | | | | QPixmapCache::find(QString) and QPixmapCache::find(QString, QPixmap&) are deprecated since Qt4 times. Explicit mark them as deprecated so they can be removed with Qt6. Change-Id: Iaf185f69afe02203559a1c812fbb4a95c9049a1d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-261-13/+23
|\| | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp Change-Id: I4c9679e3a8ebba118fbf4772301ff8fde60455b9
| * QAbstractItemView: fix rendering centered/right aligned item textChristian Ehrlicher2019-01-241-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 5712c62d1cfdcf56c772d8a63d52ad58945f194c introduced a regression for item texts which were aligned right or horizontally centered. The layoutRect was calculated wrong and started below zero and later the correct x offset could not be calculated since QTextLine::x() does not return a calculated value. Fix it by first calculating the complete string and pass it completely to QTextLayout::draw() instead trying to draw the single lines on our own - QTextLayout has a better working algorithm so no need to reinvent the wheel here. [ChangeLog][QtWidgets][ItemViews] Fixed a regression with wrongly drawn centered/right aligned item texts Fixes: QTBUG-34133 Fixes: QTBUG-56759 Fixes: QTBUG-72805 Fixes: QTBUG-72869 Change-Id: I0ed521c3a9d35446d190ac22aa9f2374814fd278 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Don't treat the ampersand in a titlebar as a mnemonicAndy Shaw2019-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | As the mnemonic has no meaning when it is in a dockwidget title, we should just treat it as a literal ampersand instead and display it as such. Fixes: QTBUG-54485 Change-Id: I96c856ce2771a68d226f48f8f47affc24f1c53cd Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-041-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also blacklist tst_QRawFont::unsupportedWritingSystem() and tst_QGlyphRun::mixedScripts() on windows for now. Conflicts: qmake/generators/makefile.cpp src/corelib/itemmodels/qstringlistmodel.cpp src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp tests/auto/gui/text/qglyphrun/BLACKLIST tests/auto/gui/text/qrawfont/BLACKLIST Task-number: QTBUG-72836 Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
| * Pass the alignment to QFontMetrics::elidedText()Andy Shaw2018-12-211-1/+2
| | | | | | | | | | | | | | | | | | When the text is elided, it needs to account for the mnenomic if there is one so it does not end up eliding the text unnecessarily. Change-Id: I77c15067f3e8d57d8deca83090bcb80554c3733f Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QTabWidget: properly horizontally align tab iconChristian Ehrlicher2018-12-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | When an icon used for a QTabWidget is smaller than the default size, it was not properly aligned horizontally although it was done for the vertical alignment. Therefore also align it horizontally to be consistent. Fixes: QTBUG-38108 Change-Id: I0e2e3af7ead699f2834aed1d8b67cbe775c897af Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Styles: replace deprecated QPalette functionsChristian Ehrlicher2018-12-171-13/+13
| | | | | | | | | | | | | | | | QPalette::foreground()/background() are deprecated since 5.13 - replace those functions with their successors. Change-Id: I158b6403437d3d48c0859360823133ca4ced2c23 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QCommonStyle: fetch `flat` property from style optionAlberto Mardegan2018-12-111-2/+2
| | | | | | | | | | | | | | | | | | | | The same information is available both from the QGroupBox API and from the QStyleOption; we should prefer the latter, because this makes it easier to use QStyle from QQuick.Controls (where a QGroupBox is not instantiated). Change-Id: I05ed1e3406676bde5d124d395d43caa0961c4f2d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-091-2/+2
|\| | | | | | | Change-Id: I10ae61ec6867b38601d85d6fc34e1f6a6ba0cc11
| * QToolButton: Don't elide text if an icon is presentChristian Ehrlicher2018-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous fix which adds an automatic text elision when the QToolButton is not large enough brought up an inconsistency between QToolButton::sizeHint() and QCommonStyle::drawControl(). Fix it by syncing the magic numbers between QToolButton::sizeHint() and QCommonStyle::drawControl(). Fixes: QTBUG-72226 Change-Id: If4a76792cb97bcdb918e18c6b29cb637730acec0 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-221-0/+2
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qdir.cpp src/corelib/kernel/qtimer.cpp src/corelib/kernel/qtimer.h Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
| * Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-191-0/+2
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
| | * Modernize the "settings" featureLiang Qi2018-11-151-0/+2
| | | | | | | | | | | | | | | | | | Change-Id: I9b8a61ecb1413b513ae5c9e77d3ee1b3e8b6562c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-251-1/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-171-1/+3
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platformthemes/platformthemes.pro src/printsupport/kernel/qplatformprintdevice.cpp Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
| | * Modernize the "animation" featureLiang Qi2018-10-121-1/+3
| | | | | | | | | | | | | | | | | | Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | Fix drawing of QGroupBox's title when check box is higher than textAlexander Volkov2018-10-091-11/+16
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-70623 Change-Id: I36c3b3e0250a4d2b0a2a2f03793f0eae3d868de2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | QSideBar: take the icon size from a styleAlexander Volkov2018-10-091-1/+11
| | | | | | | | | | | | | | | Change-Id: I9c4677b42cc920b7bb016b61b8c1fd34fe67aa30 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | remove internal use of SE_ViewItemCheckIndicatorRolf Eike Beer2018-09-031-1/+1
|/ / | | | | | | | | | | | | | | | | | | This is marked to be removed in Qt6, so switch to SE_ItemViewItemCheckIndicator internally and define the old value as copy of the new one instead of the other way round. Change-Id: I9e9804a7ff0e9b2ae1e24698d45b2cbd44423420 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-071-8/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/doc/src/objectmodel/signalsandslots.qdoc src/plugins/platforms/cocoa/qcocoamenuloader.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp tests/auto/gui/image/qimage/tst_qimage.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
| * QCommonStylePrivate::viewItemSize: Fix text width bounds calculationAles Erjavec2018-08-021-8/+11
| | | | | | | | | | | | | | | | | | | | | | The width of the icon was subtracted out of the available text area width even when the value of the `decorationPosition` was Top/Bottom. Task-number: QTBUG-69404 Task-number: QTBUG-30116 Change-Id: I501ffc0dab0cff25e525c26adf9bdb060408927b Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Add QStyle::SH_SpinBox_StepModifier style hintNathan Collins2018-07-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows the developer to pick which keyboard modifier increases the number of steps a QAbstractSpinBox takes when the user interacts with it. The modifier can be either Qt::ControlModifier (default), Qt::ShiftModifier or Qt::NoModifier. Qt::NoModifier disables the step modifier. Note that on macOS, Control corresponds to the Command key. Holding the modifier increases the step rate when: - scrolling; - pressing the up/down keys; - pressing the spin box up/down buttons. [ChangeLog][QtWidgets][QStyle] QStyle::SH_SpinBox_StepModifier allows the developer to pick which keyboard modifier increases the number of steps a QAbstractSpinBox takes for the following interactions: scrolling, up/down keyboard keys and the spin box buttons. The Qt::ShiftModifier can now be used, or the feature can be disabled using Qt::NoModifier. Previously, only Qt::ControlModifier could be used as the modifier. Change-Id: Ib5518127e86a8f67798a9a1d6e860c6e35896e6f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QCommonStyle: properly elide last visible lineChristian Ehrlicher2018-06-251-40/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite QCommonStylePrivate::viewItemDrawText() to be able to elide lines which are too long and the last visible line. The painting is now done in one pass instead of two and lines which are not visible due to a size constraint are not painted at all. [ChangeLog][QtWidgets][Itemviews] Fixed eliding of multi-line items Task-number: QTBUG-12129 Task-number: QTBUG-14949 Task-number: QTBUG-57891 Change-Id: I3a41938e442663ecd7e5ca56bf6bbd857edafb7d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-021-10/+12
|\| | | | | | | Change-Id: Ia082e20e2eb4b76afd4c1a1584ff4e5514655d7a
| * Convert features.toolbar to QT_[REQUIRE_]CONFIGStephan Binner2018-05-021-10/+12
| | | | | | | | | | | | | | | | Move declaration of pick/perp helpers up the dependency chain Change-Id: I7084ed829a057a0c45d60445c416fb07f2cb5624 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | QToolButton: Elide text when constraints prevent from showing whole textChristian Ehrlicher2018-04-261-1/+2
| | | | | | | | | | | | | | | | | | | | When a QToolButton has a fixed width and the text is too long, the text was cropped which made the button look ugly. Fix it by eliding the text in the middle in this case. Task-number: QTBUG-64132 Change-Id: I7bc46d1edcf4e67b5e1a5b651d4793f9ffa15310 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | QCommonStyle: use proxy pixelMetric for SE_TabBarScrollLeft/RightButtonChristian Ehrlicher2018-03-301-4/+4
| | | | | | | | | | | | | | | | | | | | When calculating the subElementRect for SE_TabBarScrollLeft/RightButton and SE_ToolBarHandle, the frameRect() was not taken from the proxyStyle. Task-number: QTBUG-66933 Change-Id: I7ae78d7050a6500f39e4741345283e1bf590e9cb Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | QAbstractSpinBox: honor QAbstractSpinBox::NoButtons in sizeHint()Christian Ehrlicher2018-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | QCommonStyle::sizeFromContents() did not check if a spinbox has buttons or not and returned a to wide width when no buttons are displayed. Task-number: QTBUG-67126 Change-Id: I9f97a31a89a0986023316b02e11017e620c0f614 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | QCommonStyle: Add title bar and tool bar extension iconsFriedemann Kleint2018-03-171-5/+37
| | | | | | | | | | | | | | | | | | | | Add larger pixmaps for the title bar and tool bar extension icons. Task-number: QTBUG-38776 Change-Id: If2514f7aa66fa46d25133165ca45318a5045d387 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-131-1/+1
|\| | | | | | | Change-Id: Iaec2e57d6bf33355ddfa61d25133580a8740335f
| * Fix typosJarek Kobus2018-02-131-1/+1
| | | | | | | | | | Change-Id: Id625efea998f2b4dce9970b903830dc3b3efcd3d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-02-111-0/+3
|\| | | | | | | Change-Id: Ia443f6eb1c854c99c68127a376b78c1986675a9d
| * Merge remote-tracking branch 'origin/dev' into 5.11Liang Qi2018-02-101-14/+13
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvarlengtharray.qdoc src/corelib/tools/qvector.qdoc Resolved documentation changes in favor of 017569f702b6dd0, which keeps the move overloads along with its const-ref sibling. Change-Id: I0835b0b3211a418e5e50defc4cf315f0964fab79