summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ehrlicher <[email protected]>2025-05-02 21:20:46 +0200
committerChristian Ehrlicher <[email protected]>2025-05-28 21:54:52 +0200
commitd34754ea81ffa8a25909ba56c2684da04fe722f8 (patch)
tree4e381ac0d68a136236a34c8895ab116aa8685a2f
parentda3422ca150ab52c1c2184cdd467ff105ba1de3c (diff)
QStyleSheetstyle: misc cleanup of QStyleSheetBorderImageData
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]>
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 5253a011c8f..bedf11b1b6f 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -333,16 +333,10 @@ static const PseudoElementInfo knownPseudoElements[NumPseudoElements] = {
struct QStyleSheetBorderImageData : public QSharedData
{
- QStyleSheetBorderImageData()
- : horizStretch(QCss::TileMode_Unknown), vertStretch(QCss::TileMode_Unknown)
- {
- for (int i = 0; i < 4; i++)
- cuts[i] = -1;
- }
- int cuts[4];
+ std::array<int, 4> cuts = {-1, -1, -1, -1};
+ QCss::TileMode horizStretch = QCss::TileMode_Unknown;
+ QCss::TileMode vertStretch = QCss::TileMode_Unknown;
QPixmap pixmap;
- QImage image;
- QCss::TileMode horizStretch, vertStretch;
};
struct QStyleSheetBackgroundData : public QSharedData
@@ -1015,9 +1009,9 @@ QRenderRule::QRenderRule(const QList<Declaration> &declarations, const QObject *
if (decl.d->propertyId == BorderImage) {
QString uri;
QCss::TileMode horizStretch, vertStretch;
- int cuts[4];
+ std::array<int, 4> cuts;
- decl.borderImageValue(&uri, cuts, &horizStretch, &vertStretch);
+ decl.borderImageValue(&uri, cuts.data(), &horizStretch, &vertStretch);
if (uri.isEmpty() || uri == "none"_L1) {
if (bd && bd->bi)
bd->bi->pixmap = QPixmap();
@@ -1029,8 +1023,7 @@ QRenderRule::QRenderRule(const QList<Declaration> &declarations, const QObject *
QStyleSheetBorderImageData *bi = bd->bi;
bi->pixmap = QStyleSheetStyle::loadPixmap(uri, object);
- for (int i = 0; i < 4; i++)
- bi->cuts[i] = cuts[i];
+ bi->cuts = cuts;
bi->horizStretch = horizStretch;
bi->vertStretch = vertStretch;
}
@@ -1229,7 +1222,7 @@ void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect)
const QStyleSheetBorderImageData *borderImageData = border()->borderImage();
const int *targetBorders = border()->borders;
- const int *sourceBorders = borderImageData->cuts;
+ const auto sourceBorders = borderImageData->cuts;
QMargins sourceMargins(sourceBorders[LeftEdge], sourceBorders[TopEdge],
sourceBorders[RightEdge], sourceBorders[BottomEdge]);
QMargins targetMargins(targetBorders[LeftEdge], targetBorders[TopEdge],