From f5da6d2eac08d97d3d68e28bf22bd52b633ab02f Mon Sep 17 00:00:00 2001 From: Ali Kianian Date: Wed, 12 Apr 2023 16:23:32 +0300 Subject: [PATCH] QmlDesigner: Fix shortcut text clip for the context menus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QDS-9662 Change-Id: I7f9385e99c65b2201e36625b2094f04e6f6b701f Reviewed-by: Reviewed-by: Henning Gründl --- src/plugins/qmldesignerbase/utils/studiostyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesignerbase/utils/studiostyle.cpp b/src/plugins/qmldesignerbase/utils/studiostyle.cpp index 4fd375cd105..ec0b0f4af52 100644 --- a/src/plugins/qmldesignerbase/utils/studiostyle.cpp +++ b/src/plugins/qmldesignerbase/utils/studiostyle.cpp @@ -155,7 +155,7 @@ private: void addText(const QString &txt, QPainter *painter = nullptr) { if (txt.size()) { - int textWidth = fm.boundingRect(txt).width(); + int textWidth = fm.horizontalAdvance(txt); QSize itemSize = {textWidth, defaultHeight}; if (painter) { static const QTextOption textOption(Qt::AlignLeft | Qt::AlignVCenter);