Bump required Qt version to 5.12

This commit is contained in:
Jonas Kvinge
2022-01-29 01:33:40 +01:00
parent e511b2faf9
commit f8d2c7eba3
31 changed files with 24 additions and 165 deletions

View File

@@ -99,11 +99,7 @@ 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);
@@ -183,9 +179,7 @@ PlaylistView::PlaylistView(QWidget *parent)
setHeader(header_);
header_->setSectionsMovable(true);
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
header_->setFirstSectionMovable(true);
#endif
header_->setSortIndicator(Playlist::Column_Title, Qt::AscendingOrder);
setStyle(style_);