QFileDialog::getOpenFileName causing program to crash
-
I also tried this, don't why but after istancing QFileDialog with QFileDialog::DontUseNativeDialog I can start using QFileDialog in the previous way. I tested this simple example and works.
static bool first_run = true; if (first_run) { CmdOpenFile(QFileDialog::getOpenFileName(0, "Open some file", QString(), QObject::tr("All files (*.*)"), nullptr, QFileDialog::DontUseNativeDialog)); first_run = false; } else { CmdOpenFile(QFileDialog::getOpenFileName(0, "Open some file", QString(), QObject::tr("All files (*.*)"))); }
-
I can't speak for every case in particular, but these symptoms are very typical for a misbehaving shell / Explorer extension, and not related to Qt, most likely.
I've seen some projects (for example - Firefox) maintain a list of known faulty DLLs and use LoadLibrary hooks to prevent those DLLs from loading.
-
I'd like to add my experience with this issue.
I pulled my hair out over a very similar (probably the same?) problem lately, and it turned out that AVAST and AVG (practically the same product) are causing this problem in my case. These programs must be uninstalled (not deactivated, but completely uninstalled) for my program to start working again.
My program was working on multiple versions of Windows for years already, with no issues whatsoever. The problems started in February this year (2023), and affect every single "file dialog" instance my program tries to open.
The tip with not using native dialog did not help in my case. Also VMWare based Windows installations are not affected, only the "bare metal" ones. Also, 5.x and 6.x QT versions are both crashing if AVAST or AVG are installed.
I'm surprised not more QT programs are affected, this is the best thread I found so far.
-