PDA

View Full Version : Don't want QTextBrowser to look in working directory



magland
16th October 2007, 15:35
I'm having a problem with QTextBrowser. Seems to be a pitfall because I have found that it has different behavior depending on what is the current working directory...

For example if I say



browser.setSearchPaths(QStringList("/my/path"));
browser.setSource("index.html");


then everything works fine... unless there happens to be an index.html in the current working directory... in which case it still opens /my/path/index.html as desired... however the supporting content is not found! Whereas it works fine if working directory does not contain index.html!

wysota
20th October 2007, 23:14
You can (and in this case probably should) always use an absolute path. QCoreApplication::applicationPath() might help you with this if you need to access a path relative to the application binary.