aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickdialogs2/quickdialogs2quickimpl/qquickfiledialogimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickdialogs2/quickdialogs2quickimpl/qquickfiledialogimpl.cpp')
-rw-r--r--src/quickdialogs2/quickdialogs2quickimpl/qquickfiledialogimpl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/quickdialogs2/quickdialogs2quickimpl/qquickfiledialogimpl.cpp b/src/quickdialogs2/quickdialogs2quickimpl/qquickfiledialogimpl.cpp
index 02356b3bc2..4d37fee39a 100644
--- a/src/quickdialogs2/quickdialogs2quickimpl/qquickfiledialogimpl.cpp
+++ b/src/quickdialogs2/quickdialogs2quickimpl/qquickfiledialogimpl.cpp
@@ -148,7 +148,14 @@ void QQuickFileDialogImplPrivate::updateCurrentFile(const QString &oldFolderPath
if (!newCurrentFilePath.isEmpty()) {
q->setCurrentFile(QUrl::fromLocalFile(newCurrentFilePath));
- attached->fileDialogListView()->setCurrentIndex(newCurrentFileIndex);
+ {
+ // Set the appropriate currentIndex for the selected file. We block signals from ListView
+ // because we don't want fileDialogListViewCurrentIndexChanged to be called, as the file
+ // it gets from the delegate will not be up-to-date (but most importantly because we already
+ // just set the selected file).
+ QSignalBlocker blocker(attached->fileDialogListView());
+ attached->fileDialogListView()->setCurrentIndex(newCurrentFileIndex);
+ }
if (QQuickItem *currentItem = attached->fileDialogListView()->currentItem())
currentItem->forceActiveFocus();
}