QFileDialog::getOpenFileName is a static function. As such, it’s not using the l_pFiledDlg instance you created, so the QFileDialog::setViewMode has no effect. I think this:
QFileDialog l_pFiledDlg
(this, tr
("Open Files"), sPath, tr
("All Files (*.*)"));
if (l_pFiledDlg.exec()) sFilename1 = l_pFiledDlg.selectedFiles()[0];
QFileDialog l_pFiledDlg(this, tr("Open Files"), sPath, tr("All Files (*.*)"));
QString sFilename1;
l_pFiledDlg.setViewMode(QFileDialog::Detail);
if (l_pFiledDlg.exec()) sFilename1 = l_pFiledDlg.selectedFiles()[0];
To copy to clipboard, switch view to plain text mode
should be close to what you want (though I haven’t tested it, so typos or outright errors would not be surprising).
Bookmarks