summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstyleoption.h
Commit message (Collapse)AuthorAgeFilesLines
* QTabBar: draw text within moving tabAxel Spoerl2023-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | When a tab was moved by dragging, the tab's rectangle was drawn empty, without the tab text. When a tab was moved by animated snap back to its original position, the tab text was already drawn on the original position, while the rectangle was still moving due to animation. Adds the enum value QStyleOptionTab::TabPosition::Moving When this option is set, QCommonStyle draws the tab text at the current position instead of the original home position of the tab. The QMacStyle switches over the TabPosition enum. As a moving tab is laid out like the last tab in the given orientation, the enum value Moving is treated like End. Fixes: QTBUG-112277 Change-Id: I42a2d9c269dadfe9819c12dbc69e3ae995a45b09 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Widgets/Styles: pass correct style option struct to subelementsChristian Ehrlicher2023-04-041-0/+1
| | | | | | | | | | | | | | | QHeaderView is using QStyleOptionHeaderV2 which should later be used in the subelements drawings. But since the subelement rect must be adjusted, a copy is done - sadly only to QStyleOptionHeader so we're loosing the V2 information. Therefore explicitly check if it's a V2 and copy it over to the correct structure. Pick-to: 6.5 6.2 Fixes: QTBUG-97571 Change-Id: I1482f118e2114cd6ef21c2a800785bd9910c1c5b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Unbreak binary compatibility in QStyleOptionHeaderVolker Hilsheimer2021-02-191-4/+19
| | | | | | | | | | | | | | | | | 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 Pick-to: 6.1 Change-Id: I47e6841e6652e4b67f247b7b4514e90be5609156 Reviewed-by: David Faure <david.faure@kdab.com>
* QHeaderView: Mark the drop section during section moveChristian Ehrlicher2021-01-291-1/+2
| | | | | | | | | | | 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>
* QHeaderView: respect the font role while calculating the elided textChristian Ehrlicher2020-12-081-1/+3
| | | | | | | | | | | | | | | | | 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>
* QStyleOptionGraphicsItem: remove deprecated member matrix/levelOfDetailChristian Ehrlicher2020-09-061-2/+0
| | | | | | | | QStyleOptionGraphicsItem::matrix and levelOfDetail are deprecated and not used anywhere anymore. Change-Id: Id4b0fa8ac3ac53d771e858ecda5524a5e690342d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove QStyleOptionProgressBar::orientation memberVolker Hilsheimer2020-08-291-1/+0
| | | | | | | | | Address ### Qt 6 comment; the information is already stored in the state variable, using the QStyle::State_Horizontal bit. Change-Id: I61d143ba057776f9d622793a0592b5dd4726f25d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Rename QStyleOptionMenuItem::tabWidth to reservedShortcutWidthVolker Hilsheimer2020-08-271-1/+1
| | | | | | | As per ### Qt 6 comment, and the documentation for the variable. Change-Id: I58df784a72129dc97c5f13eb54e34cb7feb9748c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Reset version of QStyleOption types to 1 for Qt 6Volker Hilsheimer2020-08-161-10/+10
| | | | | | | | | Amends 7ff26c776201141e5be87ce24c3c1b1ee96aefcc and 729f1ab9a0b9fe6ffdefc02df490ec546db38d72. Change-Id: I7d3cea42318faffc9dee48d51ae9f890bb1e7a56 Fixes: QTBUG-84221 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Add keyboardModifiers member to QStyleOptionSlider, and use it for macVolker Hilsheimer2020-07-021-0/+1
| | | | | | | | | | Gets rid of a call to QApplication::keyboardModifiers in a method that is anyway only called from an input event handler, where we have that information already. Task-number: QTBUG-73829 Change-Id: I81753d6bf725e9db4918d831fac5b03a0b1940b9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove deprecated QStyleOption::init()Christian Ehrlicher2020-06-211-2/+1
| | | | | | | | Even it was not marked as deprecated the replacement function initFrom() is available since Qt4 times (and init() is deprecated since then) Change-Id: I09a4ebbf66b01fbe7aec67691dc68d2e42d1cd78 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove deprecated QStyleOptionFooVx typedefsChristian Ehrlicher2020-06-201-18/+0
| | | | | | | They were not used the whole Qt5 lifetime. Change-Id: I1452b90d63bbeed3cc9131b04ed5263b38ad89b3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add an option to set the alignment of the text in QComboBoxAndy Shaw2020-05-151-1/+2
| | | | | | Change-Id: Ic9dca8864643302b2b3ff7dbd86260efdb0ab1d5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge QStyleOptionTabV4 into QStyleOptionTabGiuseppe D'Angelo2020-05-081-9/+3
| | | | | | | | | We don't need the subclass any more now that we can break ABI. Merge it back into the "main" style option class, like already happened during Qt 4->5. Change-Id: Iba6d3df5f87b0c96f01746260f0a93951dad0e27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Get rid of QMatrixJarek Kobus2020-02-281-2/+2
| | | | | | Task-number: QTBUG-81628 Change-Id: Iad66bfdf49b9ee65558a451108c086fc40dc3884 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Stylesheet: Handle tabs with elide mode set correctlyAndy Shaw2020-01-061-0/+8
| | | | | | | | | | | | | | | | In order for SE_TabBarTabText to correctly calculate the space available for the text it needs to get the rectangle of the tab directly instead of relying on the option's rectangle as this may have been modified before this point. Therefore we introduce QStyleOptionTabV4 to be able to store the index as part of the option so it can be queried directly. [ChangeLog][QtWidgets] Added QStyleOptionTabV4 as a subclass of QStyleOptionTab so that the tab's index information can be obtained. Fixes: QTBUG-50637 Change-Id: If705f5069fdd14eeccf06bc63dba4e8d2e704359 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Fix GCC 4.8 buildVille Voutilainen2019-08-051-23/+23
| | | | | | Change-Id: I4994146b359e8e37f6c0fa1b27f03fb9e800fdd5 Fixes: QTBUG-77218 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix -Wdeprecated-copy warningsAllan Sandfeld Jensen2019-05-011-0/+23
| | | | | | | | | | Implicit copy constructors or methods are considered deprecated for classes that has one of the two or a destructor. The warning is enabled with -Wextra in gcc 9 Change-Id: Ic9be654f2a142fb186a4d5a7d6b4f7d6f4e611d8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-021-2/+2
|\ | | | | | | Change-Id: Ia082e20e2eb4b76afd4c1a1584ff4e5514655d7a
| * Convert features.toolbar to QT_[REQUIRE_]CONFIGStephan Binner2018-05-021-2/+2
| | | | | | | | | | | | | | | | 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>
* | Doc: Fix description of QStyleOptionMenuItem::tabWidthAlexander Volkov2018-03-271-1/+1
|/ | | | | | | | It is actually not the tab width but the width reserved for the menu item's shortcut. Change-Id: I801dff0c57256690f61c022156a80cf6ff530c43 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-09-261-4/+9
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h src/plugins/platforms/cocoa/qcocoawindow.h src/testlib/qtestsystem.h Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
| * Convert features.slider to QT_[REQUIRE_]CONFIGStephan Binner2017-09-121-2/+4
| | | | | | | | | | Change-Id: I03adb5e34071aa106bbfe7caa2d41a93e8d1e263 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.spinbox to QT_[REQUIRE_]CONFIGStephan Binner2017-09-121-2/+5
| | | | | | | | | | Change-Id: Idecb6927c20ff009795b0ad94bbb7199df98a8f8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-4/+4
|/ | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Convert features.tabbar to QT_[REQUIRE_]CONFIGStephan Binner2017-07-251-4/+6
| | | | | Change-Id: Id21a95cbc61b2559a8f517ee60548b61536e3cc4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.tabwidget to QT_[REQUIRE_]CONFIGStephan Binner2017-07-251-2/+4
| | | | | Change-Id: Iab985564fd2069188df01f8ff3e00add86eb86f4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.itemviews to QT_[REQUIRE_]CONFIGStephan Binner2017-07-251-3/+3
| | | | | | | The QT_NO_ITEMVIEWS queries in corelib/ seem to had no effect at all. Change-Id: I494ee2309a96b0cf25de18781fc9a675878a2ee9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.rubberband to QT_[REQUIRE_]CONFIGStephan Binner2017-07-111-2/+4
| | | | | Change-Id: I6d634bafa6d26c1e78069fddd412e6de24f5775c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Replace custom type traits with std one'sKai Koehne2016-11-081-4/+4
| | | | | | | | | | | | | | | | | | Remove most type traits from qtypetraits.h, but keep the custom implementation of is_signed/is_unsigned. This gets rid of BSD-3 licensed code from Google in a public header (hugh!). The custom implementations for is_signed/is_unsigned are kept because the implementations in gcc's standard headers do not work as we expect for enums - both is_signed and is_unsigned always returns false there - see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027 [ChangeLog][QtCore][General] Qt now relies on type traits from the C++ standard library. Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-211-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5971b88e is not needed in new configure. This merge also reverts "fix QMAKE_DEFAULT_*DIRS resolution with apple SDK", 2c9d15d7, because it breaks iOS build with new configure system. Conflicts: mkspecs/features/default_pre.prf mkspecs/features/mac/toolchain.prf mkspecs/features/toolchain.prf src/dbus/qdbusconnection.cpp src/plugins/sqldrivers/mysql/qsql_mysql.cpp src/sql/drivers/mysql/qsql_mysql.cpp src/widgets/widgets/qmenubar.cpp src/widgets/widgets/qmenubar_p.h tools/configure/configureapp.cpp tools/configure/environment.cpp tools/configure/environment.h Change-Id: I995533dd334211ebd25912db05b639d6f908aaec
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-161-4/+4
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp Change-Id: I0af32ee55936d523cbd259b6fe82eb9c409f9074
| | * QStyleOption: return Q_NULLPTR from qstyleoption_cast instead of 0Dyami Caliri2016-09-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | qstyleoption_cast should use Q_NULLPTR to represent a null pointer. Task-number: QTBUG-45291 Change-Id: I85078ceb435b310daf63db2ed771be2f36cf3e4f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Add qtwidgetsglobal.h and qtwidgetsglobal_p.hLars Knoll2016-07-141-0/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The new modular configuration system requires one global header per module, that is included by all other files in this module. That header will later on #include the configuration file for Qt Widgets. For now it defines the Q_WIDGETS_EXPORT macro for this library. Change-Id: I6698989b952b9bac94d086d9f219e03c000f7d53 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QStyleOption*V<N>: mark as Q_DECL_DEPRECATEDMarc Mutz2015-12-111-12/+12
|/ | | | | Change-Id: If9c5ec8193e51b2a8b091f46916fc74d2d03f1df Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-20/+12
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Widgets: remove references to QStyleOptionFrameV<n>Marc Mutz2014-09-261-1/+1
| | | | | | | | | | | | | | They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame. Change-Id: Icff45cbd3a47db8618a7f7a80f7252651969237c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
| * Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Deprecate the QStyleOptionProgressBar::orientation memberGiuseppe D'Angelo2014-09-181-1/+1
|/ | | | | | | | | | | | | | Its contents are already inside the "state" member. Fixes a "TODO" for Qt 5 (bumping it to Qt 6, where we will be able to break API). [ChangeLog][QtWidgets][Styles] The usage of the QStyleOptionProgressBar::orientation member has been deprecated. Task-number: QTBUG-25121 Change-Id: Ie531bb2f2733b15a213e83c9706468e2bf829359 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix error reported by address sanitizerOlivier Goffart2014-08-131-10/+14
| | | | | | | | It is not valid to dereference a null pointer, even if it's just in order to access enum constants Change-Id: Id404c308ae7ffd879afdd678302e3ac4e0c69001 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Fix license headers stating QtGui for QtWidgets files.Jake Petroules2013-03-191-1/+1
| | | | | Change-Id: I0ca49e3e1f9f603f0b0f7f3553e854b871efe303 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add feature to enable rounded line edit on macJens Bache-Wiig2012-11-151-1/+2
| | | | | | | | This will not currently be exposed in the widget API but we can make use of it for qt quick components. Change-Id: I08300a3bcd58e68df633fe9b36a988eb6176ef9c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* De-inline some destructors in QtWidgetsMarc Mutz2012-11-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | Destructors should be out-of-line so that the compiler doesn't generate one per translation unit. Apart from creating more work for the compiler, it can also lead to duplicated vtables if the dtor is the first virtual function (reimplementation), and all other virtuals are inline, too. Duplicate vtables then break RTTI. In addition, having virtual dtors de-inlined allows us to add code to them in a BC way. As a final argument, this change may lead to less code app-side, since a sequence of cross-DLL calls (to member variable dtors) is replaced by a single cross-DLL call to the new out-of-line dtor. Change-Id: Ifb8c4aa992c75d61ba9ac8de5ab41d1e96b0a0b1 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Add QObject* QStyleOption::styleObjectJ-P Nurmi2012-10-161-0/+1
| | | | | | | | | The object is used, amongst other things, as a target for sending style animation updates. Change-Id: Ic210e7ae2111bc08b70331a3a2030a494919a06d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Add HasFrame feature to QStyleOptionTabJens Bache-Wiig2012-10-161-0/+3
| | | | | | | | This makes it possible for styles like Fusion to draw tabbars different when they have a frame. Change-Id: I1bb21198c0c3caf44c757f6f39310bf2509054bf Reviewed-by: J-P Nurmi <jpnurmi@digia.com>