I'm trying to debug a c++/Qt5.5 code in MSVS2010 Professional. A function has following lines of code,
/* Static method approach */
QString filters("Music files (*.mp3);;Text files (*.txt);;All files (*.*)");
QString defaultFilter("Text files (*.txt)");
QFileDialog::getSaveFileName(0, "Save file", QDir::currentPath(), filters, &defaultFilter);
The dialog is simply doesn't open and the application freezes.
I tried the alternative was as below.
/* Direct object construction approach */
QFileDialog fileDialog(0, "Save file", QDir::currentPath(), filters);
fileDialog.selectNameFilter(defaultFilter);
fileDialog.exec();
But again, the code freezes at 'fileDialog.exec()'. So, I created a different new simple project with these statements only and the it worked as expected.
Is this a issue of my environment configuration. I tried to debug but on stepping into the above line simply freezes the code without any error.