Results 1 to 2 of 2

Thread: Don't want QTextBrowser to look in working directory

  1. #1
    Join Date
    Feb 2007
    Location
    Philadelphia, USA
    Posts
    255
    Thanks
    43
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Don't want QTextBrowser to look in working directory

    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

    Qt Code:
    1. browser.setSearchPaths(QStringList("/my/path"));
    2. browser.setSource("index.html");
    To copy to clipboard, switch view to plain text mode 

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Don't want QTextBrowser to look in working directory

    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.

Similar Threads

  1. setting working directory for current process
    By mule in forum Qt Programming
    Replies: 1
    Last Post: 8th October 2007, 13:54
  2. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  3. error in compiling qtopia.....
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 11th January 2007, 09:10
  4. Am I the only one with "make" error ?
    By probine in forum Installation and Deployment
    Replies: 1
    Last Post: 13th February 2006, 12:54
  5. QT Service and working directory
    By Lele in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2006, 11:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.