diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 240e9979d8..c60f2476c3 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2966,7 +2966,11 @@ void QFileDialogPrivate::_q_enterDirectory(const QModelIndex &index) lineEdit()->clear(); } } else { - q->accept(); + // Do not accept when shift-clicking to multi-select a file in environments with single-click-activation (KDE) + if (!q->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick) + || q->fileMode() != QFileDialog::ExistingFiles || !(QGuiApplication::keyboardModifiers() & Qt::CTRL)) { + q->accept(); + } } }