From 05d69ad42b4a2f3ba099dec9b0e2b600f88c4509 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 1 Nov 2023 10:10:28 +0100 Subject: [PATCH] FusionStyle: use std::array instead QVarLengthArray Replace QVarLengthArray with std::array since there is no reallocation needed. Change-Id: Ifd53763e230efd61683c08654f0741beae4b6df2 Reviewed-by: Axel Spoerl --- src/widgets/styles/qfusionstyle.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 7e88541cb26..7f0cafd8100 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -170,19 +170,19 @@ static void qt_fusion_draw_arrow(Qt::ArrowType type, QPainter *painter, const QS arrowRect.moveTo((rect.width() - arrowRect.width()) / 2.0, (rect.height() - arrowRect.height()) / 2.0); - QVarLengthArray triangle; + std::array triangle; switch (type) { case Qt::DownArrow: - triangle << arrowRect.topLeft() << arrowRect.topRight() << QPointF(arrowRect.center().x(), arrowRect.bottom()); + triangle = {arrowRect.topLeft(), arrowRect.topRight(), QPointF(arrowRect.center().x(), arrowRect.bottom())}; break; case Qt::RightArrow: - triangle << arrowRect.topLeft() << arrowRect.bottomLeft() << QPointF(arrowRect.right(), arrowRect.center().y()); + triangle = {arrowRect.topLeft(), arrowRect.bottomLeft(), QPointF(arrowRect.right(), arrowRect.center().y())}; break; case Qt::LeftArrow: - triangle << arrowRect.topRight() << arrowRect.bottomRight() << QPointF(arrowRect.left(), arrowRect.center().y()); + triangle = {arrowRect.topRight(), arrowRect.bottomRight(), QPointF(arrowRect.left(), arrowRect.center().y())}; break; default: - triangle << arrowRect.bottomLeft() << arrowRect.bottomRight() << QPointF(arrowRect.center().x(), arrowRect.top()); + triangle = {arrowRect.bottomLeft(), arrowRect.bottomRight(), QPointF(arrowRect.center().x(), arrowRect.top())}; break; }