john_god
13th November 2010, 11:58
Hi guys
I'm trying to launch a html file from my app:
QString path = QApplication::applicationDirPath();
QString str = path +tr("/mat_html/mat_manual_en.html");
if ( ! QDesktopServices::openUrl(QUrl( str, QUrl::TolerantMode )) )
QMessageBox::about(0,tr("Error"),tr("Error. Help file not found")+"\n"+str);
So far so good, it work's on several directorys, except for the "program files" windows directory.
It seems the portuguese windows version creates some kind of simbolic link directory where in my explorer the file.exe directory is "c:/programas/math graphica", but in command line and the str output is "c:/program files/math graphica".
so I tried a hardcoded version wich still doens't work:
QString str = path +tr("/mat_html/mat_manual_en.html");
QString str2 = "C:/Program Files/Math Graphica"+tr("/mat_html/mat_manual_en.html");
str2 = "C:/Programas/Math Graphica"+tr("/mat_html/mat_manual_en.html");
if ( ! QDesktopServices::openUrl(QUrl( str )) &&
! QDesktopServices::openUrl(QUrl( str2 , QUrl::TolerantMode)) )
QMessageBox::about(0,tr("Error"),tr("Error. Help file not found")+"\n"+str);
So I'm running out of ideias :confused:
I'm trying to launch a html file from my app:
QString path = QApplication::applicationDirPath();
QString str = path +tr("/mat_html/mat_manual_en.html");
if ( ! QDesktopServices::openUrl(QUrl( str, QUrl::TolerantMode )) )
QMessageBox::about(0,tr("Error"),tr("Error. Help file not found")+"\n"+str);
So far so good, it work's on several directorys, except for the "program files" windows directory.
It seems the portuguese windows version creates some kind of simbolic link directory where in my explorer the file.exe directory is "c:/programas/math graphica", but in command line and the str output is "c:/program files/math graphica".
so I tried a hardcoded version wich still doens't work:
QString str = path +tr("/mat_html/mat_manual_en.html");
QString str2 = "C:/Program Files/Math Graphica"+tr("/mat_html/mat_manual_en.html");
str2 = "C:/Programas/Math Graphica"+tr("/mat_html/mat_manual_en.html");
if ( ! QDesktopServices::openUrl(QUrl( str )) &&
! QDesktopServices::openUrl(QUrl( str2 , QUrl::TolerantMode)) )
QMessageBox::about(0,tr("Error"),tr("Error. Help file not found")+"\n"+str);
So I'm running out of ideias :confused: