|
1Qter豆
QString file_dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), ".", QFileDialog::ShowDirsOnly);
QMessageBox::about(this, tr("Temp Test"), file_dir);
QString file_name = QFileDialog::getOpenFileName(this, tr("Open JSON File"), "/home/ark/Workspaces//", tr("JSON Files(*.*)"));
由于特殊功能需要在鼠标点击某菜单后,需要的先选择目录,再选择一个在另一处的文件。
在运行QFileDialog::getExistingDirectory时成功,在msg窗口中显示出了正确的目录。
但是接下来运行QFileDialog::getOpenFileName,程序死机了。
请教一下,如何解决,谢谢!
下面的情况也会在运行第二次QFileDialog时死掉。
QString file_name = QFileDialog::getOpenFileName(this, tr("Open JSON File"), "/home/ark/Workspaces/Challenger_AI/download/", tr("JSON Files(*.*)"));
QMessageBox::about(this, tr("Temp Test"), file_name);
file_name = QFileDialog::getOpenFileName(this, tr("Open JSON File"), "/home/ark/Workspaces/Challenger_AI/download/", tr("JSON Files(*.*)"));
|
|