Results 1 to 3 of 3

Thread: QTextBrowser and img...

  1. #1
    Join Date
    Jan 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default QTextBrowser and img...

    Hi,

    I would like to use QTextBrowser to display html help in application.
    In the reference I found that this widget provide basic html support with
    navigation - exactly what I need. Unfortunately I was unable to make it work.
    Using setSource(path..) doesn't work - resulting in empty TextBrowser and msg:
    TextBrowser: No Document: path_to_doc

    i tried also setHtml(contnet_of_html_file) but this method doesn't load
    images (i don't want to use Qt resources mechanism - my component has
    to be able to open any local html file)

    I know that there are a lot of posts about this (or similar) problem. I've read
    most of them (I gave up after reading ~30 topics) and i've not found a solution
    that works ( or clear statement that it won't work at all).

    I would be grateful for any hint

    Best regards,

    mirag

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QTextBrowser and img...

    More than in the other post we can not say. So the best would be, you create a minimal compilable program, that illustrate your problem. Then we will have a look at your code and see on.

  3. #3
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTextBrowser and img...

    for me this works:
    Qt Code:
    1. #include <QtGui>
    2. int main(int argc, char **argv)
    3. {
    4. QApplication a(argc, argv);
    5. tb.setSource(QUrl("file:///C:/Users/nemrod/Desktop/test.html"));
    6. tb.show();
    7. return a.exec();
    8. }
    To copy to clipboard, switch view to plain text mode 
    So maybe you set the url not properly?
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  4. The following user says thank you to faldzip for this useful post:

    Aitortxo (12th February 2010)

Similar Threads

  1. Could this be a bug in QTextBrowser?
    By clive in forum Qt Programming
    Replies: 5
    Last Post: 29th March 2007, 15:04
  2. Use CSS in QTextBrowser
    By xgoan in forum Qt Programming
    Replies: 1
    Last Post: 9th October 2006, 18:25
  3. QTextBrowser help please!
    By munna in forum Qt Programming
    Replies: 1
    Last Post: 24th April 2006, 20:27
  4. CSS in QTextBrowser
    By gesslar in forum Qt Programming
    Replies: 1
    Last Post: 4th April 2006, 09:17
  5. QTextBrowser
    By sreedhar in forum Qt Programming
    Replies: 4
    Last Post: 14th March 2006, 13:27

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.