ifdef QFontMetrics::horizontalAdvance to make it work with older Qt
This commit is contained in:
@@ -100,7 +100,11 @@ void PlaylistProxyStyle::drawControl(ControlElement element, const QStyleOption
|
||||
const QFontMetrics &font_metrics = header_option->fontMetrics;
|
||||
|
||||
// Spaces added to make transition less abrupt
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
if (rect.width() < font_metrics.horizontalAdvance(text + " ")) {
|
||||
#else
|
||||
if (rect.width() < font_metrics.width(text + " ")) {
|
||||
#endif
|
||||
const Playlist::Column column = static_cast<Playlist::Column>(header_option->section);
|
||||
QStyleOptionHeader new_option(*header_option);
|
||||
new_option.text = Playlist::abbreviated_column_name(column);
|
||||
|
||||
Reference in New Issue
Block a user