Hello i am facing a small issue with Qt on the Mac OSX.
So in my program i am trying to open a local .html
file located in the same path as the application.
Given that Qt is cross-platform , my attempt worked for both Windows and Ubuntu and i assumed that OSX should not have an issue since it is Unix based.
This is my attmpet
void MainWindow::openBrowser(bool)
{
QString link = QDir::currentPath()+"/index.html"; // rename the file
if(! QDesktopServices::openUrl(QUrl(link.trimmed())))
{
displayMessage("Access Error", "Unable to open a file");
}
}
The OSX cannot find the same index.html
file and I am not sure why.
Is there a better way to concatenate the path?