Results 1 to 2 of 2

Thread: Textbrowser issue

  1. #1
    Join Date
    May 2006
    Posts
    68
    Thanks
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Textbrowser issue

    I am using QT4 ( Windows)

    I am trying to show help through a click of pushbutton . Help file ( first one ) is required to be displayed in a Textbrowser popup where onward one canm follow the links. I have made the first page in html and links are also html .

    I am using the following code

    Qt Code:
    1. steg::steg(QWidget *parent)
    2. : QDialog(parent)
    3. {
    4. ui.setupUi(this);
    5.  
    6. connect(ui.helpbutton, SIGNAL(clicked()), this, SLOT(help()));
    7.  
    8. }
    9.  
    10. void steg::help()
    11. {
    12.  
    13. QTextBrowser *sourceViewer = new QTextBrowser(0);
    14. //sourceViewer->setSource(ui.datalineEdit->text());
    15. sourceViewer->resize(600, 600);
    16. sourceViewer->show();
    17.  
    18. }
    To copy to clipboard, switch view to plain text mode 
    In fact how to give setsource().For a normal html file or even a doc file how to give it as url since setsource( const url&) is to be given.

  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: Textbrowser issue

    setSource needs a file. I don't know what your datalineEdit holds, but if it is a path to the file, just convert it to [qtclas]QUrl[/qtclass] for example by using QUrl::fromLocalFile().

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

    deekayt (30th October 2006)

Similar Threads

  1. Dialog and code design issue
    By Gopala Krishna in forum Qt Programming
    Replies: 1
    Last Post: 24th September 2006, 17:54
  2. Replies: 5
    Last Post: 22nd September 2006, 08:04
  3. Qt 3.3.4 -> Qt 4.1.2, moc file issue
    By philski in forum Qt Tools
    Replies: 1
    Last Post: 11th September 2006, 21:08
  4. A Design Issue...
    By nupul in forum Qt Programming
    Replies: 6
    Last Post: 4th May 2006, 17:41
  5. Replies: 1
    Last Post: 13th February 2006, 10:02

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.