Results 1 to 16 of 16

Thread: html browser!!

  1. #1
    Join Date
    Feb 2006
    Posts
    42
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default html browser!!

    Hi all,

    I have a problem, I want to display few small html pages in my app, it includes images, etc. I tried using QTextBrowser but, it's functionality is very limited. I have got only one idea ie, to port the help viewer sample from qt-3 to qt-4. Do you guys think this is the feasible solution? Any hints or suggestions to solve this problem?

    Thanks in advance,
    Seema Rao

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: html browser!!

    I'm not sure that QTextBrowser 4 has more features then his fother from 3 ver. You always can use QProcess for start extended browser
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Feb 2006
    Posts
    42
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: html browser!!

    thats a cool idea!! but thing is i want the browser to be part of my app / embedded to my app. If I use QProcess say for example to invoke konqueror, it comes as different window

  4. #4
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Arrow Re: html browser!!

    Quote Originally Posted by Seema Rao
    Hi all,

    I have a problem, I want to display few small html pages in my app, it includes images, etc. I tried using QTextBrowser but, it's functionality is very limited. I have got only one idea ie, to port the help viewer sample from qt-3 to qt-4. Do you guys think this is the feasible solution? Any hints or suggestions to solve this problem?

    Thanks in advance,
    Seema Rao

    what 'extra' functionality are you looking for, that is not present in QTextBrowser?

    Nupul

  5. #5
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: html browser!!

    Quote Originally Posted by Seema Rao
    thats a cool idea!! but thing is i want the browser to be part of my app / embedded to my app. If I use QProcess say for example to invoke konqueror, it comes as different window
    hmmmm i didn't see that you are using X.

    use this

    $kstart --help

    you can control the window properties of the app, you could make it "seem" to be a part of your app

    EDIT: alternatively do this
    $> konqueror --help-all

    and read through the options.....also konqueror is a Qt app so you can control it via your app...how exactly to do it, I am not very sure...the experts on this group will help you there
    Last edited by nupul; 10th May 2006 at 13:21.

  6. #6
    Join Date
    Feb 2006
    Posts
    42
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: html browser!!

    say If I use image in html for example,

    <p>
    An image:
    <img src="next.gif"
    width="144" height="50">
    </p>

    image is never displayed on the app. trace says "QPixmap::convertFromImage Cannot convert a null image".

  7. #7
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: html browser!!

    could you post the code?

  8. #8
    Join Date
    Feb 2006
    Posts
    42
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: html browser!!

    here is the source of html first.html

    <html>
    <body>

    <p>
    An image:
    <img src="next.gif"
    width="144" height="50">
    </p>

    </body>
    </html>


    //qt source main.cpp
    #include <QApplication>
    #include <QTextBrowser>
    #include <QtDebug>

    int main( int argc, char **argv ){

    QApplication app( argc, argv );

    QTextBrowser browser;
    browser.setHtml( "<html><body><a href=\"first.html\" style=\"text-color:red\">XXX</a></body></html>" );

    qDebug() << browser.toHtml();

    browser.show();
    return app.exec();

    }

  9. #9
    Join Date
    Jan 2006
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: html browser!!

    Hiya,

    Try displaying a jpg or png image and it should work. Qt is not compiled by default with GIF support.

    From the QImage Class reference:
    <SNIP>
    (To configure Qt with GIF support, pass -qt-gif to the configure script or check the appropriate option in the graphical installer.)
    </SNIP>

    Cheers,
    Chris

  10. #10
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: html browser!!

    I'm going to put on my curmudgeon cap, and disagree with the premise. People should always write their own code, and never rely on an IDE to do it for them. Even in case like Designer, which generates code automatically, you should still be intimately familiar with the generated files. I do realize that generating boilerplate code is a great timesaver. So it it before hand. Write you own main.cpp and project infrastructure, and archive them away. When you start a new project, copy them over and you're set to go.

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: html browser!!

    Quote Originally Posted by Brandybuck
    I'm going to put on my curmudgeon cap, and disagree with the premise. People should always write their own code, and never rely on an IDE to do it for them. Even in case like Designer, which generates code automatically, you should still be intimately familiar with the generated files. I do realize that generating boilerplate code is a great timesaver. So it it before hand. Write you own main.cpp and project infrastructure, and archive them away. When you start a new project, copy them over and you're set to go.
    Whom are you referring to?

  12. #12
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: html browser!!

    I'm so sorry, I posted to the wrong thread

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: html browser!!

    Quote Originally Posted by Brandybuck
    I'm so sorry, I posted to the wrong thread
    Where's the right one?

  14. #14
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    3
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: html browser!!

    Where can I find QtFirefox for cross-platform browser embedded in Qt application?

  15. #15
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: html browser!!

    I think that his is not present in nature
    You must run for every system his own default browser. Search in forum that question was asked many times
    a life without programming is like an empty bottle

  16. #16
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    3
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: html browser!!

    I found that there is a Qt-Mozilla project called QGeckoEmbed inside Firefox source code. However I dont know how to build on M$ Windows platform. Brothers any idea?

Similar Threads

  1. Replies: 7
    Last Post: 14th March 2008, 13:52
  2. Invoking a browser...???
    By deepusrp in forum Newbie
    Replies: 4
    Last Post: 12th June 2007, 17:32
  3. Loading images in html in a QTextBrowser
    By BasicPoke in forum Newbie
    Replies: 1
    Last Post: 6th June 2007, 21:51
  4. Need Basic html Browser
    By awalesminfo in forum Newbie
    Replies: 6
    Last Post: 21st March 2006, 17:14
  5. Replies: 1
    Last Post: 17th March 2006, 08:01

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.