QPointF pos = ratingTextInfo->pos;
const Qt::Alignment align = ratingTextInfo->staticText.textOption().alignment();
if (align & Qt::AlignHCenter) {
- pos.rx() += (size().width() - m_rating.width()) / 2 - 2;
+ pos.rx() += (size().width() - m_rating.width() / m_rating.devicePixelRatioF()) / 2 - 2;
}
painter->drawPixmap(pos, m_rating);
}
QString ret = m_customizedFontMetrics.elidedText(text.chopped(extensionLength),
Qt::ElideRight,
elidingWidth - extensionWidth);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
ret.append(text.rightRef(extensionLength));
+#else
+ ret.append(QStringView(text).right(extensionLength));
+#endif
return ret;
}
}
requiredWidth = m_customizedFontMetrics.horizontalAdvance(elidedText);
} else if (role == "rating") {
// Use the width of the rating pixmap, because the rating text is empty.
- requiredWidth = m_rating.width();
+ requiredWidth = m_rating.width() / m_rating.devicePixelRatioF();
}
}
layout.endLayout();