From 3179882fab415195ee83e21ca9ac0f54ca94abb3 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 7 Feb 2019 12:46:51 +0000 Subject: [PATCH] Show bpm in library at 1dp, show zero values as dashes --- src/library/basesqltablemodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/library/basesqltablemodel.cpp b/src/library/basesqltablemodel.cpp index 7ceff72de36..7d8300a818c 100644 --- a/src/library/basesqltablemodel.cpp +++ b/src/library/basesqltablemodel.cpp @@ -676,6 +676,11 @@ QVariant BaseSqlTableModel::data(const QModelIndex& index, int role) const { QDateTime gmtDate = value.toDateTime(); gmtDate.setTimeSpec(Qt::UTC); value = gmtDate.toLocalTime(); + } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM)) { + if (role == Qt::DisplayRole) { + value = value.toDouble() == 0.0 + ? "-" : QString("%1").arg(value.toDouble(), 0, 'f', 1); + } } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM_LOCK)) { value = value.toBool(); } else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_YEAR)) {