Skip to content

Commit

Permalink
Merge pull request #13067 from ronso0/bpm-display-locale
Browse files Browse the repository at this point in the history
(fix) Library: BPM display uses decimal separator of selected locale
  • Loading branch information
daschuer authored Apr 15, 2024
2 parents 17d4f26 + 6842ead commit 6dcc33c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/library/basetracktablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,9 @@ QVariant BaseTrackTableModel::roleValue(
if (role == Qt::ToolTipRole || role == kDataExportRole) {
return QString::number(bpm.value(), 'f', 4);
} else {
// custom precision, set in DlgPrefLibrary
return QString::number(bpm.value(), 'f', s_bpmColumnPrecision);
// Use the locale here to make the display and editor consistent.
// Custom precision, set in DlgPrefLibrary.
return QLocale().toString(bpm.value(), 'f', s_bpmColumnPrecision);
}
} else {
return QChar('-');
Expand Down
2 changes: 1 addition & 1 deletion src/library/bpmdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BpmEditorCreator : public QItemEditorCreatorBase {
QDoubleSpinBox* pBpmSpinbox = new QDoubleSpinBox(parent);
pBpmSpinbox->setFrame(false);
pBpmSpinbox->setMinimum(0);
pBpmSpinbox->setMaximum(1000);
pBpmSpinbox->setMaximum(9999);
pBpmSpinbox->setSingleStep(1e-3);
pBpmSpinbox->setDecimals(8);
pBpmSpinbox->setObjectName("LibraryBPMSpinBox");
Expand Down

0 comments on commit 6dcc33c

Please sign in to comment.