forked from qt-creator/qt-creator
QmlDesigner.propertyEditor: fixes painting bug
This commit is contained in:
@@ -649,9 +649,9 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *event)
|
void paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
QPainter p(this);
|
|
||||||
QFontMetrics fm(font());
|
QFontMetrics fm(font());
|
||||||
if (fm.width(text()) > (contentsRect().width() - 6) && text().length() > 4) {
|
if (fm.width(text()) > (contentsRect().width() - 6) && text().length() > 4) {
|
||||||
|
QPainter p(this);
|
||||||
QString elided_txt;
|
QString elided_txt;
|
||||||
elided_txt = this->fontMetrics().elidedText(text(), Qt::ElideRight, rect().width() - 6, Qt::TextShowMnemonic);
|
elided_txt = this->fontMetrics().elidedText(text(), Qt::ElideRight, rect().width() - 6, Qt::TextShowMnemonic);
|
||||||
p.drawText(rect().adjusted(12, 0, 0, 0), elided_txt);
|
p.drawText(rect().adjusted(12, 0, 0, 0), elided_txt);
|
||||||
|
|||||||
Reference in New Issue
Block a user