I understand how signals and slots work. I just needed somebody to point me in the right direction as to how to get the file to open. I have not posted my code for the slot because that is exactly my problem, "THE CODE THAT MUST GO INTO THE SLOT". You don't have to write the code for me, you can just tell me which Qt objects to look at.
Added after 1 22 minutes:
For anybody who might have a similar problem in the future, I resolved this issue with little help from somebody. Please see the code below.
void MainWindow
::on_listView_Main_doubleClicked(const QModelIndex &index
) {
QString file_path
= model
->fileInfo
(index
).
absoluteFilePath();
}
void MainWindow::on_listView_Main_doubleClicked(const QModelIndex &index)
{
QString file_path = model->fileInfo(index).absoluteFilePath();
QUrl fPath;
QDesktopServices::openUrl(fPath.fromLocalFile(file_path));
}
To copy to clipboard, switch view to plain text mode
Bookmarks