From adcf6a572f1ccbb6c7a6a0a1c04d5c31f7c119e6 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 6 Apr 2010 15:07:33 +0200 Subject: [PATCH] QmlDesigner.propertyEditor: fixes painting bug --- .../qmldesigner/components/propertyeditor/basicwidgets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp index 21ed227ed9a..67d27b5a1ba 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp @@ -648,10 +648,10 @@ public: protected: void paintEvent(QPaintEvent *event) - { - QPainter p(this); + { QFontMetrics fm(font()); if (fm.width(text()) > (contentsRect().width() - 6) && text().length() > 4) { + QPainter p(this); QString elided_txt; elided_txt = this->fontMetrics().elidedText(text(), Qt::ElideRight, rect().width() - 6, Qt::TextShowMnemonic); p.drawText(rect().adjusted(12, 0, 0, 0), elided_txt);