Skip to content

Commit

Permalink
Merge pull request #730 from lxqt/fixed_shortcut_setting
Browse files Browse the repository at this point in the history
Fixed shortcut setting when the Key column is sorted
  • Loading branch information
tsujan authored Nov 1, 2020
2 parents cc30dd7 + 2dde56d commit 2260088
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/propertiesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,12 @@ void PropertiesDialog::saveShortcuts()
const QString& keyValue = shortcutKeys.at(x);
QAction *keyAction = actions[keyValue];

QTableWidgetItem *item = shortcutsWidget->item(x, 1);
QTableWidgetItem *item = nullptr;
auto items = shortcutsWidget->findItems(tr(keyValue.toStdString().c_str()), Qt::MatchExactly);
if (!items.isEmpty())
item = shortcutsWidget->item(shortcutsWidget->row(items.at(0)), 1);
if (item == nullptr)
continue;

QList<QKeySequence> shortcuts;
const auto sequences = item->text().split(QLatin1Char('|'));
Expand Down

0 comments on commit 2260088

Please sign in to comment.