Results 1 to 4 of 4

Thread: QTextBrowser: Cannot open

  1. #1
    Join Date
    Apr 2007
    Location
    Bangalore,India
    Posts
    25
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Unhappy QTextBrowser: Cannot open

    I want to open a html file in the text browser ,
    and the code is as follows:

    Qt Code:
    1. #include <QtGui>
    2. #include <QUrl>
    3. #include <QTextBrowser>
    4. int main(int argc, char **argv)
    5. {
    6. QApplication app( argc, argv );
    7. bw->setSource (QUrl("D:\\Wikipedia.html"));
    8. bw->setGeometry ( 100,100,400,400 );
    9. bw->show();
    10. return app.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

    QFSFileEngine:pen: No file name specified
    QTextBrowser: Cannot open 'D:\Wikipedia.html' for reading
    QTextBrowser: No document for D:\Wikipedia.html
    But the browser is unable to open the file ...

    What changes has to be made to identify the file and open it????
    Veda

  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: QTextBrowser: Cannot open


  3. #3
    Join Date
    Apr 2007
    Location
    Bangalore,India
    Posts
    25
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextBrowser: Cannot open

    I am not getting warning after using QUrl::fromLocalFile

    Quote Originally Posted by wysota View Post
    but the html file is still not displayed on to my TextBrowser.

    It shows blank widget of TextBrowser.

    Do I need to set some other properties.
    Veda

  4. #4
    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: QTextBrowser: Cannot open

    Maybe the file doesn't contain proper contents? Try some other file for example with the following content:
    html Code:
    1. <html><body>TEST</body></html>
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to wysota for this useful post:

    veda (27th December 2007)

Similar Threads

  1. Replies: 3
    Last Post: 7th October 2015, 19:43
  2. Error in running qtopia 4.3 on QVFB
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 3rd December 2007, 06:37
  3. qtextbrowser stop scrolling on append
    By tpf80 in forum Qt Programming
    Replies: 2
    Last Post: 16th September 2007, 20:28
  4. [QT4] QtextBrowser and image size (win)
    By sebgui in forum Qt Programming
    Replies: 0
    Last Post: 28th March 2006, 21:01
  5. how to adjust sizes of QTextBrowser?
    By Pan Wojtas in forum Qt Programming
    Replies: 2
    Last Post: 7th February 2006, 22:25

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.