打开文件及过滤文件后缀:
QString fileName = QFileDialog::getOpenFileName(this, //当前
tr("Open File"),//标题
"/home", //起始路径 QDir::currentPath() 程序当前路径
tr("Images (*.png *.xpm *.jpg)")//过滤
);
//多文件过滤:
QString path = QFileDialog::getOpenFileName(this,"Select File","/home","txt(*.txt);;image(*.jpg)");