Skip to content

Commit

Permalink
Merge pull request #2001 from benis/bpmRound
Browse files Browse the repository at this point in the history
Round BPM display value in library table
  • Loading branch information
daschuer committed Feb 7, 2019
2 parents e0ea6d6 + 3179882 commit ae392c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/library/basesqltablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit ae392c9

Please sign in to comment.