| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Simplify the logic for CE_MenuBarItem - there is no need to check for
hasFocus since all paint stuff inside is only done when the menu is
active.
Change-Id: I6c66f80dd0ee13cfd3b788264cfcb8f6147513c5
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
- use QPainterStateGuard instead QPainter::save/restore()
- move calculations inside loops where they are really needed
- avoid double calls to QRect::topLeft() & others
- fix indentation
Change-Id: Ib4bec9ed7751e951c364e549039779494a2341e1
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid QPainter::brushOrigin() since it returns a QPoint instead QPointF
so it might loose precision. Use QPainterStateGuard instead to make
sure the correct QPainter state is restored later on.
Pick-to: 6.10
Task-number: QTBUG-137885
Change-Id: I3f49c72c0425e22ffb1246b42d926e704dc9d8dd
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
| |
Replace some c-arrays with std::array<> for easier handling.
Pick-to: 6.10 6.9
Change-Id: I34766a2aad603d83187515626982adc976667d48
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
| |
Replace some for loops with range-based ones.
Pick-to: 6.10 6.9
Change-Id: Ib11fb4ec5785b8ec4c9c297684f90d7f5031fe58
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
| |
There were some artifacts added (white pixels and bad anti aliasing)
when the icon was changed in e771e5e2d7ae77f46d01f087242e0f777fdc02ac
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I12a8658090a1f081321e53433d17fc19ad3e5f12
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
| |
Fixes: QTBUG-136960
Pick-to: 6.8 6.9 6.10
Change-Id: I606fd034ba83011624ff9a38a8c973659c241c26
Reviewed-by: Matthias Rauter <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Don't create a QString when comparing the strings from
knownPseudoElements - a QLatin1StringView is enough.
Pick-to: 6.10 6.9
Change-Id: I69e207bac0fb3d3df12ae9d4bebc9cd30cde30de
Reviewed-by: Volker Hilsheimer <[email protected]>
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't paint through stylesheet code when a combobox label has no
stylesheet set at all.
This should be done also for others but may break existing painting
stuff so only fix this here as it's a regression from
a77a7c157d5cdcc88bf0a02caed2aa5ff8850d06.
Pick-to: 6.10 6.9 6.8
Task-number: QTBUG-131761
Fixes: QTBUG-137108
Change-Id: I462ba198821692aa60e6869df9c8e92332422c44
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Remove unused member 'image' from QStyleSheetBorderImageData and replace
c array with std::array<>.
Pick-to: 6.9
Change-Id: I149ef72e443027a6b6d30f25e8c7b1adf4138fc5
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
| |
Change-Id: I9bafda9058e2e48b8040f4d43c68b3eeac476594
Reviewed-by: Oliver Eftevaag <[email protected]>
Reviewed-by: MohammadHossein Qanbari <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Replace all standard media icons with the icons from Figma/Qt Icon
Library.
Pick-to: 6.8
Task-number: QTBUG-128665
Change-Id: I8e3944f6536cac81a415e4891dcd2e0203fc2863
Reviewed-by: Axel Spoerl <[email protected]>
Reviewed-by: Richard Moe Gustavsen <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Move the usage of the corresponding QStyleOption classes into a
QT_CONFIG() guard to fix compilation when these options are disabled.
Pick-to: 6.9
Change-Id: I68e791f20bbc8389974878e765b08a97eb347b92
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
| |
Change-Id: Ia61888f9189b3b3284c91ff91bceef0770e6cb5a
Reviewed-by: MohammadHossein Qanbari <[email protected]>
Reviewed-by: Oliver Eftevaag <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QProxyStyle's ctor arguments are not QObject parents, but the proxied
style, which becomes the proxy's QObject ... get this ... _child_.
What a broken concept... It means that this test function took
ownership of QApplication::style(), and the only way it wasn't going
to wreak havoc on the rest of the test functions was to leak it after
use.
To fix, create the style on the stack, so it gets automatically freed
by the compiler on all exists from the function. As a drive-by, use {}
instead of () to call the ctor (not to prevent C++' Most Vexing Parse,
just because it's easier on the eye).
The meat of the change, however, is in making the helper proxy-style
defend against QProxyStyle's grabbing of the baseStyle() as its child,
and managing baseStyle()->d->proxyStyle so we properly dissociate from
qApp->style() after we're done. Needed to use ctor delegation to
extract original parent and proxy model from the incoming style before
QProxyStyle, our first subobject, gets first picking on the style,
destroying the very state we're trying to preserve.
This should be become some QTest::LocalProxyStyle, if we find more
users of this pattern.
Amends 5cff7d2b679d48a247b4630cb9e3d5b04fab0b55.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I2abf4a0bf54158254fd8d526de55ad486ca4e296
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SH_EtchDisabledText is not widely used in fusion style and where it is
used it
- does not make any real difference for light mode
- makes the text look like one missed the glasses
Therefore disable this hint for fusion.
Pick-to: 6.9 6.8
Fixes: QTBUG-134533
Change-Id: I42fc20349603cf610ee725802f1095008eafd183
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Cleanup the drawing code to avoid useless drawings by only calling
drawRect once with the correct parameters. This also removes rendering
artifacts due to e.g. rounding errors with a dpr != 1.
Fixes: QTBUG-132187
Pick-to: 6.9 6.8
Change-Id: Ib5eff89c8bdcbd0c86954e78dadaad83346c92ff
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
When certain features are disabled, qguiapplication.h does not get
included which results in a compiler error. Therefore add it directly.
Pick-to: 6.9 6.9.0 6.8
Fixes: QTBUG-134235
Change-Id: I7836fc52c5037ca15c7ce48617c9f814d71963aa
Reviewed-by: Liang Qi <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Replace all standard arrow icons with the icons from Figma/Qt Icon
Library.
Task-number: QTBUG-128665
Change-Id: I8b0c3426eaba7f55436f942428eef73fac827483
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a menu has a custom font size set, the size was adjusted to reflect
this *after* the additional widths for icon or checkmark was added.
When the used font is larger, the additional width added for the icon or
checkmark will not be honored then.
Therefore the size with the new font has to be added before adding the
size for the icon/checkmark.
Pick-to: 6.9 6.8
Fixes: QTBUG-115356
Change-Id: I33e83022bea9e3a531ac8e1651d8655076d88b4b
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the drawing of the SC_TitleBarCloseButton for fractional dpr by only
drawing two lines with a width of 2 instead 6 single ones as the single
ones might get disturbed due to rounding.
Pick-to: 6.9 6.8
Fixes: QTBUG-133834
Change-Id: I711cef885ed04fa695c24ee3e536697a0ebb3868
Reviewed-by: Wladimir Leuschner <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
The painting of the various icons for CC_TitleBar was done with the idea
to do some fancy alpha blending. But it actually was never used and just
makes the drawing code a lot more complex than needed. Therefore merge
the drawing code for textColor and textColorAlpha into one.
Fixes: QTBUG-131492
Change-Id: I89ac7bcf76f5264cb85cd8a00f0d74da4b85fd7c
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
QStyle::styleHint() take the QWidget as optional third parameter. Add
this to calls to styleHint() where appropriate.
Task-number: QTBUG-2501
Pick-to: 6.9 6.8
Change-Id: I62aa251f7dd9d78178ea8aefc1e2882d3ac040be
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although char16_t string literals implicitly convert to QStringView,
there are corner-cases where one may want to explicitly create a
QStringView out of them.
A couple of examples I've found is where these string literals decay
into pointers:
// range is a std::initializer_list<const char16_t *>
for (QStringView v : { u"foo", u"bar" }) { ... }
// ternary will decay arguments
void print(QStringView);
print(check ? u"hi" : u"there");
When this happens the resulting code gets pessimized and polluted by
runtime calls to qustrlen in order to build the QStringView objects [1].
We can restore optimal codegen by directly dealing with QStringView
objects instead. Adding explicit conversions may make the code
cumbersome to read, so I'm introducing a UDL for QStringView, matching
the one for QString (and std::string_view).
[1] for instance: https://gcc.godbolt.org/z/eY7xvEje3
Apply the new operator to a couple of places.
[ChangeLog][QtCore][QStringView] Is it now possible to create
QStringView objects by using the u""_sv user-defined literal.
Fixes: QTBUG-123851
Change-Id: I8af7d2e211b356d284de160a222eab9e91d09500
Reviewed-by: Thiago Macieira <[email protected]>
|
|
|
|
|
|
|
|
| |
This lifts QStyle::SH_Menu_SelectionWrap to Qt GUI so it
can also be honored from Qt Quick Controls.
Change-Id: I78eb2dd9fe6ad9329d40f7962bf7ad5f07dd4685
Reviewed-by: Richard Moe Gustavsen <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Use QPainter::setPen(QColor) overload instead creating a temporary QPen
to gain advantaged of the newly introduced QPen operator=(QColor)
function from ab53500cfa11b988e7e4234583fa6eb5027b4c08
Pick-to: 6.9
Change-Id: Ib29a932a183b629f2c5f3ce32f4e00bd7ab24a03
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add two new enum values:
IsDecoratedRootColumn: notifies the style that the current cell also
contains place for the tree column branch indicator so it can e.g.
properly draw rounded edges in a cell or complete row.
IsDecorationForRootColumn: the item contains the information to draw
the tree column branch indicator.
Pick-to: 6.9
Task-number: QTBUG-131585
Change-Id: Iee2823fe3a227630f926d0448095a10fad2b0ba7
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous patch to not modify the CT_SpinBox by QStyleSheet when
nothing was added for QStylesheet also removed the additional margins &
paddings handling for the size calculation. This patch re-adds this.
This amends 96adebed606cdbc73c73778917d777dc04c6e93e.
Pick-to: 6.9 6.8
Task-number: QTBUG-130642
Fixes: QTBUG-132431
Change-Id: Iff1f0febeca90d3154e61fd80e4b359bc7766b84
Reviewed-by: Volker Hilsheimer <[email protected]>
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Change the remaining calls to QIcon::pixmap() to pass a valid
devicePixelRatio parameter.
Pick-to: 6.9
Change-Id: I0e71e20c8109e296446e9e13cddba31d53c05df9
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Replace the internal PainterStateGuard class with the now public
QPainterStateGuard.
Pick-to: 6.9
Change-Id: I9c072ce6e45ddfe2d0a8aba789311193788dee5a
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Replace the internal QPainterStateSaver class with the now public
QPainterStateGuard.
Pick-to: 6.9
Change-Id: I56285cb469cec43071320e87ac378674fd99c06b
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the style and use PainterStateGuard instead own save/restore
functionality because PainterStateGuard is already available and used in
those functions.
Pick-to: 6.9 6.8
Task-number: QTBUG-132187
Change-Id: Ie454b6cffe03444d88f13d15adb19a7e7783a493
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
| |
- CT_MenuItem: Use qCeil()
- CE_MenuItem: Add 0.5 to width for elidedText(), because of qRound() in the QFontMetrics::horizontalAdvance()
Fixes: QTBUG-132102
Change-Id: Iaced11905357abb496d4ad3c20be0babb17cf121
Reviewed-by: Christian Ehrlicher <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a compound widget is styled with a font through a property and the
default styling has no font settings, the font was not reset to the
parent font but left it the styled state.
Fix it by not resolving the current font when the style rule has no font
settings - use the parent font directly instead.
Fixes: QTBUG-131685
Pick-to: 6.9 6.8
Change-Id: I8e79423cfeff24143cd051b282503c4565125b4d
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
These two members were added during Qt4 times but never documented.
Pick-to: 6.9 6.8 6.5
Change-Id: Ife4abfc6d8883f4c26ce5b95d5c0cfd3adcbd6bf
Reviewed-by: Volker Hilsheimer <[email protected]>
Reviewed-by: Wladimir Leuschner <[email protected]>
Reviewed-by: Samuel Gaist <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
CE_ComboBoxLabel did not apply any attributes if the render rule has no
box. Remove the check.
Fixes: QTBUG-131761
Pick-to: 6.8
Change-Id: I603ae6c459303f0d3a5bcc9572f12acca32bc575
Reviewed-by: Friedemann Kleint <[email protected]>
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Move the text a little bit further away from the horizontal border.
[ChangeLog][QtWidgets][Styles] PM_ButtonMargin is now respected for
QPushButton in fusion style.
Fixes: QTBUG-94860
Change-Id: I2447de0b8fca048eb2efe1a309969fad61f6bd29
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Avoid double lookups to QRenderRule::styleHints by simply checking if
the returned QVariant from styleHint() is default-constructed.
Pick-to: 6.8
Change-Id: I4ca657662c2af66582fb4fc7c2ed1b77258ab050
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Otherwise the hardening with initializing all buffers causes serious
performance regressions
Pick-to: 6.8
Change-Id: I3f7a0b7f0e0d08644b1dbb520cf1f6d5e052b270
Reviewed-by: Thiago Macieira <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Don't go through the brush's color just to construct a new (solid)
brush. It removes other brush information, unnecessarily constructs
a temporary QBrush object.
Change-Id: I0a02034225f8f1025c7395b31e2f32119f77a37c
Reviewed-by: Doris Verria <[email protected]>
Reviewed-by: Christian Ehrlicher <[email protected]>
|
|
|
|
|
|
|
|
| |
Is easier to read and more bool-trap safe. Old form header deprecated from 6.10
Fixes: QTBUG-129575
Change-Id: Id785b9ce159007ce745c04120b2112c8bb9b0802
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Merge the drawing code for PE_FrameDockWidget and PE_FrameWindow as they
actually draw the same except for one pen color.
Pick-to: 6.8
Change-Id: I1647474166af6c9a188531fcc0780e388729ab87
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
When drawing an indeterminate progress bar, QPainter::drawLine() is
called very often. Avoid it by first calculating all lines and then call
QPainter::drawLines() once with all lines to draw.
Pick-to: 6.8
Change-Id: I51ce23236b945b30da649fd06aad60676321e403
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Cleanup drawing of PE_IndicatorToolBarSeparator - there is no need to
call QRect::topLeft/bottomRight() and then only use x or y. No need to
stress the optimizer that much.
Pick-to: 6.8
Change-Id: I477dcea6c9bebd981777fdc1eb53963074257e01
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
| |
Amend b92b7c69a93e1df61ec1bf59580eae51662c1ea6, which has set
PM_ButtonMargin to 4 and caused a baseline deviation.
Change-Id: I4097e6a4789a5e123442ad3954b9de41b0f82ad3
Reviewed-by: Christian Ehrlicher <[email protected]>
|
|
|
|
|
|
|
|
| |
They look blurry if we do, paint only the rest antialiased.
Amends 032db29bbc8c98462494d7a4e942af7a990e43f8.
Change-Id: I480f10943214f94afa52454de43c3b7f836a6def
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Push buttons' optics can be optimized by adding vertical margin.
Implement it in QFusionStyle.
Change-Id: Iaa66738e5f854de11ef317ffba4df2b2bbee5da2
Found-by: Alessandro [email protected] <[email protected]>
Task-number: QTBUG-94860
Reviewed-by: Christian Ehrlicher <[email protected]>
|
|
|
|
|
|
|
|
|
| |
A lookup to QHash<QString,...> works perfectly fine for a
QLatin1StringView so no need to create a QString first.
Pick-to: 6.8
Change-Id: I4cd5f3c0bab8f9af696e8ae2d3eefad77f2e8722
Reviewed-by: Marc Mutz <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Amends e5f9738385d8fc49492bc759472a571e241a5501, which removed the
turning on of anti-aliasing, under the assumption that QCachedPainter
always turns on anti-aliasing (which was initially the case, but then
reverted in 1ad9330a9c56a59d407f5644fe547ba69c1a205b). On the other
hand, the later QCachedPainter instances still turned on anti-aliasing
explicitly.
Now we do so again consistently, but setting it on the painter we get;
QCachedPainter will then use the same render hints.
As a drive-by, constify the variables with the old painter states
consistently.
Change-Id: I2ed31ae42c77f07d8496dcb16b767def29203973
Reviewed-by: Axel Spoerl <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Amends e70cc743bc89afa7f36cd6afa520af2dab763c3a by fixing a
copy/paste from CC_SpinBox handling.
Task-number: QTBUG-129680
Change-Id: Ib122feedeed7cb502d4d1f789e3c83573cacb402
Reviewed-by: Axel Spoerl <[email protected]>
|