Don't accept QFileDialog when disabled item is activated
On macOS, entries that do not match the filter are shown in the directory listing. Do not accept the dialog when these entries are double-clicked (activated). Pick-to: 6.6 6.5 Fixes: QTBUG-120768 Change-Id: If8ff6c56f1d21861b4e30051c212c9497042ed0f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 0f77aff05fa6eb059d7f8517c94c88f889b44e6e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
0e75b141b8
commit
41e943aeda
@ -3794,8 +3794,9 @@ void QFileDialogPrivate::enterDirectory(const QModelIndex &index)
|
||||
}
|
||||
} else {
|
||||
// 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, nullptr, qFileDialogUi->treeView)
|
||||
|| q->fileMode() != QFileDialog::ExistingFiles || !(QGuiApplication::keyboardModifiers() & Qt::CTRL)) {
|
||||
if ((!q->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, nullptr, qFileDialogUi->treeView)
|
||||
|| q->fileMode() != QFileDialog::ExistingFiles || !(QGuiApplication::keyboardModifiers() & Qt::CTRL))
|
||||
&& index.model()->flags(index) & Qt::ItemIsEnabled) {
|
||||
q->accept();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user