From f32d1d2c85f5fcc342303077d300070c6aae4754 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 6 Jul 2019 21:17:03 -0500 Subject: [PATCH] added qt 5.13 compatibility --- .../projectexplorer/projectexplorericonviewitemdelegate.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/widget/projectexplorer/projectexplorericonviewitemdelegate.cpp b/app/widget/projectexplorer/projectexplorericonviewitemdelegate.cpp index ee14c89b1..bdcce74d9 100644 --- a/app/widget/projectexplorer/projectexplorericonviewitemdelegate.cpp +++ b/app/widget/projectexplorer/projectexplorericonviewitemdelegate.cpp @@ -61,7 +61,13 @@ void ProjectExplorerIconViewItemDelegate::paint(QPainter *painter, const QStyleO painter->setPen(text_fgcolor); QString duration_str = index.data(Qt::UserRole).toString(); + +#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0) int timecode_width = fm.width(duration_str); +#else + int timecode_width = fm.horizontalAdvance(duration_str); +#endif + int max_name_width = option.rect.width(); if (timecode_width < option.rect.width() / 2) {