From ffe04642f8cf77279c51707ff66dd7fbb8f5241b Mon Sep 17 00:00:00 2001 From: liufeijin <1290689371@qq.com> Date: Sun, 20 Mar 2022 21:12:28 +0800 Subject: [PATCH] Update lrchartitem.cpp Qt6.2.4 has no width() to be use boundingrect().width() --- limereport/items/lrchartitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/limereport/items/lrchartitem.cpp b/limereport/items/lrchartitem.cpp index 357b8cb..ed22eee 100644 --- a/limereport/items/lrchartitem.cpp +++ b/limereport/items/lrchartitem.cpp @@ -1022,14 +1022,14 @@ void AbstractSeriesChart::paintGrid(QPainter *painter, QRectF gridRect) if (m_chartItem->horizontalAxisOnTop()) { painter->drawLine(x, gridRect.top() - gridOffset.height(), x, (drawFullLine ? gridRect.bottom() : gridRect.top())); - painter->drawText(QRectF(x - painter->fontMetrics().width(text) / 2, + painter->drawText(QRectF(x - painter->fontMetrics().boundingRect(text).width() / 2, gridRect.top() - (fontHeight + gridOffset.height()), hStep, fontHeight), text); } else { painter->drawLine(x, gridRect.bottom() + gridOffset.height(), x, (drawFullLine ? gridRect.top() : gridRect.bottom())); - painter->drawText(QRectF(x - painter->fontMetrics().width(text) / 2, + painter->drawText(QRectF(x - painter->fontMetrics().boundingRect(text).width() / 2, gridRect.bottom() + halfFontHeight * 0 + gridOffset.height(), hStep, fontHeight), text);