QmlDesigner.propertyEditor: fixes painting bug

This commit is contained in:
Thomas Hartmann
2010-04-06 15:07:33 +02:00
parent c66b5c1806
commit adcf6a572f

View File

@@ -649,9 +649,9 @@ 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);