path: root/tests/auto/corelib/io/qfile/tst_qfile.cpp
diff options
authorVolker Hilsheimer <>2020-02-06 10:17:52 +0100
committerVolker Hilsheimer <>2020-02-07 12:21:13 +0100
commite79979ba40992d5ae8e12084f91c0d06f158a4df (patch)
treec5fff38dad539a324bb0147b1136fad2a6768d40 /tests/auto/corelib/io/qfile/tst_qfile.cpp
parent5c520f4b0ad4b539dc0184c764ca9f12c98730d9 (diff)
On Windows 7, fall back to SHFileOperation to avoid confirmation dialogs
Moving a file to the trash should preferably done via IFileOperation. However, the implementation on Windows 7 ignores the operation flags that request the shell not to show any confirmation dialogs or other UI elements. SHFileOperation is an old API that doesn't show any UI, but has the limitation that it doesn't report the location of the file in the trash after the move. So an application cannot restore the file, but the user can do so via Explorer. Overall, the better compromise is to not have dialogs at the expense of not being able to report the new path. This allows us to run the unit test on Windows 7 as well. Change-Id: Ib8e651a69e2c6750f668b52d2a70925d156cc8ae Fixes: QTBUG-81927 Reviewed-by: Vitaly Fanaskov <>
Diffstat (limited to 'tests/auto/corelib/io/qfile/tst_qfile.cpp')
1 files changed, 0 insertions, 3 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index b065e1f10f..350bff0652 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -3681,9 +3681,6 @@ void tst_QFile::moveToTrash_data()
- if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::Windows7)
- QSKIP("Windows 7 insists on showing a confirmation dialog", SkipAll);
// success cases
QTemporaryFile temp;