Probably this issue is due to not defining parent widget properly. In QT manual or examples available online, first argument passed to QFileDialog::getOpenFileName (or similar functions) is generally "this". In my case, if I call following function with "this", it will open the dialog box and another window that doesn't contain anything and has a title which is the same as the name of executable file. I tried to get rid of the second unwanted window with no success. I replaced "this" with "gui::parentWidget()" or "0", still same issue. Also if I remember correctly I didn't have this issue before updating QT to version 5.0.2. Any help would be appreciated.
void gui::on_coordinatesBrowse_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this,"Open File");
//.....
}
and I have:
gui::gui(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::gui)
{
ui->setupUi(this);
//.....
}
and
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
gui mainW;
mainW.show();
return a.exec();
}