diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2023-11-01 10:10:28 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2023-11-04 19:01:22 +0100 |
commit | 05d69ad42b4a2f3ba099dec9b0e2b600f88c4509 (patch) | |
tree | 22eb6f8d49301e92d4732318650c49724fea639e /src/widgets/styles/qfusionstyle.cpp | |
parent | 4a32f8b806cc6659dea79569a2e280ff62093711 (diff) |
FusionStyle: use std::array instead QVarLengthArray
Replace QVarLengthArray with std::array since there is no reallocation
needed.
Change-Id: Ifd53763e230efd61683c08654f0741beae4b6df2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src/widgets/styles/qfusionstyle.cpp')
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 7e88541cb2..7f0cafd810 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<QPointF, 3> triangle; + std::array<QPointF, 3> 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; } |