diff options
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qcolordialog.cpp | 5 | ||||
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 13 | ||||
-rw-r--r-- | src/widgets/dialogs/qfiledialog.h | 4 | ||||
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel.cpp | 7 |
4 files changed, 17 insertions, 12 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index a6b6df4045..82c341b47c 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -1621,7 +1621,7 @@ void QColorDialogPrivate::_q_pickScreenColor() q->grabMouse(); #endif -#ifdef Q_OS_WIN32 // excludes WinCE and WinRT +#ifdef Q_OS_WIN32 // excludes WinRT // On Windows mouse tracking doesn't work over other processes's windows updateTimer->start(30); @@ -1864,6 +1864,9 @@ void QColorDialogPrivate::_q_addCustom() void QColorDialogPrivate::retranslateStrings() { + if (nativeDialogInUse) + return; + if (!smallDisplay) { lblBasicColors->setText(QColorDialog::tr("&Basic colors")); lblCustomColors->setText(QColorDialog::tr("&Custom colors")); diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index fcac12068d..2f45635298 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -3675,12 +3675,13 @@ void QFileDialogPrivate::_q_autoCompleteFileName(const QString &text) if (oldFiles.removeAll(idx) == 0) newFiles.append(idx); } - for (int i = 0; i < newFiles.count(); ++i) - select(newFiles.at(i)); - if (lineEdit()->hasFocus()) - for (int i = 0; i < oldFiles.count(); ++i) - qFileDialogUi->listView->selectionModel()->select(oldFiles.at(i), - QItemSelectionModel::Toggle | QItemSelectionModel::Rows); + for (const auto &newFile : qAsConst(newFiles)) + select(newFile); + if (lineEdit()->hasFocus()) { + auto *sm = qFileDialogUi->listView->selectionModel(); + for (const auto &oldFile : qAsConst(oldFiles)) + sm->select(oldFile, QItemSelectionModel::Toggle | QItemSelectionModel::Rows); + } } } diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h index 95e03618ac..354a1f928b 100644 --- a/src/widgets/dialogs/qfiledialog.h +++ b/src/widgets/dialogs/qfiledialog.h @@ -92,7 +92,9 @@ public: ShowDirsOnly = 0x00000001, DontResolveSymlinks = 0x00000002, DontConfirmOverwrite = 0x00000004, - DontUseSheet = 0x00000008, +#if QT_DEPRECATED_SINCE(5, 14) + DontUseSheet Q_DECL_ENUMERATOR_DEPRECATED = 0x00000008, +#endif DontUseNativeDialog = 0x00000010, ReadOnly = 0x00000020, HideNameFilterDetails = 0x00000040, diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index d29f74e93d..a778fd3a45 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -1197,8 +1197,8 @@ QStringList QFileSystemModel::mimeTypes() const \a indexes. The format used to describe the items corresponding to the indexes is obtained from the mimeTypes() function. - If the list of indexes is empty, 0 is returned rather than a serialized - empty list. + If the list of indexes is empty, \nullptr is returned rather than a + serialized empty list. */ QMimeData *QFileSystemModel::mimeData(const QModelIndexList &indexes) const { @@ -1847,8 +1847,7 @@ void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QV std::sort(rowsToUpdate.begin(), rowsToUpdate.end()); QString min; QString max; - for (int i = 0; i < rowsToUpdate.count(); ++i) { - QString value = rowsToUpdate.at(i); + for (const QString &value : qAsConst(rowsToUpdate)) { //##TODO is there a way to bundle signals with QString as the content of the list? /*if (min.isEmpty()) { min = value; |