Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) Controller I/O table: sort Action column by display string #13039

Merged
merged 1 commit into from
Apr 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/controllers/controllerinputmappingtablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,16 @@ QVariant ControllerInputMappingTableModel::data(const QModelIndex& index,
return QVariant(mapping.options);
}
return QVariant::fromValue(mapping.options);
case MIDI_COLUMN_ACTION:
if (role == Qt::UserRole) {
// TODO(rryan): somehow get the delegate display text?
return QVariant(mapping.control.group + QStringLiteral(",") + mapping.control.item);
case MIDI_COLUMN_ACTION: {
if (role == Qt::UserRole) { // sort by displaystring
QStyledItemDelegate* del = getDelegateForIndex(index);
VERIFY_OR_DEBUG_ASSERT(del) {
return QString();
}
return del->displayText(QVariant::fromValue(mapping.control), QLocale());
}
return QVariant::fromValue(mapping.control);
}
case MIDI_COLUMN_COMMENT:
return mapping.description;
default:
Expand Down
Loading