forked from qt-creator/qt-creator
QML Observer: Print correct id in crumble path and elide text
This commit is contained in:
@@ -179,12 +179,15 @@ QString AbstractFormEditorTool::titleForItem(QGraphicsItem *item)
|
|||||||
if (!objectStringId.isEmpty()) {
|
if (!objectStringId.isEmpty()) {
|
||||||
constructedName = objectStringId + " (" + className + ")";
|
constructedName = objectStringId + " (" + className + ")";
|
||||||
} else {
|
} else {
|
||||||
if (!gfxObject->objectName().isEmpty())
|
if (!gfxObject->objectName().isEmpty()) {
|
||||||
constructedName = gfxObject->objectName() + " (" + className + ")";
|
constructedName = gfxObject->objectName() + " (" + className + ")";
|
||||||
|
} else {
|
||||||
|
constructedName = className;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return className;
|
return constructedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,10 @@ void CrumblePathButton::paintEvent(QPaintEvent *)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.setPen(StyleHelper::panelTextColor());
|
p.setPen(StyleHelper::panelTextColor());
|
||||||
p.drawText(QRectF(m_textPos.x(), 4, geom.width(), geom.height()), text());
|
QFontMetrics fm(p.font());
|
||||||
|
QString textToDraw = fm.elidedText(text(), Qt::ElideRight, geom.width() - m_textPos.x());
|
||||||
|
|
||||||
|
p.drawText(QRectF(m_textPos.x(), 4, geom.width(), geom.height()), textToDraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CrumblePathButton::tintImages()
|
void CrumblePathButton::tintImages()
|
||||||
|
|||||||
Reference in New Issue
Block a user