Skip to content

Commit

Permalink
fix: support build on qt 6.7
Browse files Browse the repository at this point in the history
log: QKeyMapper::possibleKeys return QList<KeyboardModifiers> in qt 6.7
  • Loading branch information
wineee authored and justforlxz committed May 11, 2024
1 parent 44bf163 commit 096e993
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/widgets/dkeysequenceedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ void DKeySequenceEdit::keyPressEvent(QKeyEvent *e)
}

if (e->modifiers() & Qt::ShiftModifier) {
QList<int> possibleKeys = QKeyMapper::possibleKeys(e);
auto possibleKeys = QKeyMapper::possibleKeys(e);
int pkTotal = possibleKeys.count();
if (!pkTotal)
return;
bool found = false;
for (int i = 0; i < possibleKeys.size(); ++i) {
if (possibleKeys.at(i) - nextKey == int(e->modifiers())
if (static_cast<int>(possibleKeys.at(i)) - nextKey == static_cast<int>(e->modifiers())
|| (possibleKeys.at(i) == nextKey && e->modifiers() == Qt::ShiftModifier)) {
nextKey = possibleKeys.at(i);
found = true;
Expand Down

0 comments on commit 096e993

Please sign in to comment.