forked from qt-creator/qt-creator
QmlDesigner: Fix shortcut text clip for the context menus
Task-number: QDS-9662 Change-Id: I7f9385e99c65b2201e36625b2094f04e6f6b701f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -155,7 +155,7 @@ private:
|
|||||||
void addText(const QString &txt, QPainter *painter = nullptr)
|
void addText(const QString &txt, QPainter *painter = nullptr)
|
||||||
{
|
{
|
||||||
if (txt.size()) {
|
if (txt.size()) {
|
||||||
int textWidth = fm.boundingRect(txt).width();
|
int textWidth = fm.horizontalAdvance(txt);
|
||||||
QSize itemSize = {textWidth, defaultHeight};
|
QSize itemSize = {textWidth, defaultHeight};
|
||||||
if (painter) {
|
if (painter) {
|
||||||
static const QTextOption textOption(Qt::AlignLeft | Qt::AlignVCenter);
|
static const QTextOption textOption(Qt::AlignLeft | Qt::AlignVCenter);
|
||||||
|
|||||||
Reference in New Issue
Block a user