Results 1 to 11 of 11

Thread: Running Web pages or URL using QUrlOperator

  1. #1
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Thumbs up Running Web pages or URL using QUrlOperator

    The code is following;

    #include<qapplication.h>
    #include<qnetwork.h>
    #include<qurloperator.h>
    #include<qhttp.h>

    int main( int argc, char ** argv )
    {
    QApplication a( argc, argv );
    qInitNetworkProtocols();
    QUrlOperator op( "http://www.trolltech.com" );
    op.get( "index.html" );
    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
    return a.exec();
    }
    It is not giving any error; but it is not displaying anything.
    Help me please.
    Anurag Shukla
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Running Web pages or URL using QUrlOperator

    That's not gonna work. Q3UrlOperator::get just tries to download the file. It won't open it.

    Do you want to open a web browser at that address? Then, in Qt 4 you have QDesktopServices:penUrl. It is static.

    Regards

  3. #3
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question Re: Running Web pages or URL using QUrlOperator

    Quote Originally Posted by marcel View Post
    That's not gonna work. Q3UrlOperator::get just tries to download the file. It won't open it.

    Do you want to open a web browser at that address? Then, in Qt 4 you have QDesktopServices:penUrl. It is static.

    Regards
    Dear Sir!
    First I want to say thanks for sending response.
    I want to open web information in Qt widgets. Is is possible. If posible plz. reply.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Running Web pages or URL using QUrlOperator

    You could do it with QTextEdit::setHtml, but it is limited.
    You could download the file html and set it in the text edit. But again, there is no fully HTML compliant widget.

    Regards

  5. #5
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question Re: Running Web pages or URL using QUrlOperator

    What is the syntax for this?
    I use Q3UrlOperator::get to download the file and how a way I set this content to QTextEdit.
    I have no idea to do this.

    There is no fully HTML compliant widget.
    I cann't understand what u want to say.
    Plz explain.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Running Web pages or URL using QUrlOperator

    After obtaining the data from the webpage, you have to display it on *something*. This could be a custom Widget or something ready made like QTextEdit or QTextBrowser. Unfortunately these provide limited html and CSS capabilities, so don't expect them to display a webpage, the way you are used to from firefox, ie or whatever webbrowser you use. Read the documentation of QTextBrowser and QTextEdit.

  7. #7
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question Re: Running Web pages or URL using QUrlOperator

    Dear Sir!
    Any way is possible to run firefox within QWidget hiding with its popups (hiding title bar, Menu Bar etc.).
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  8. #8
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Running Web pages or URL using QUrlOperator

    Any way is possible to run firefox within QWidget hiding with its popups (hiding title bar, Menu Bar etc.).
    No, forget about that.
    You might be able to run IE like this, but this requires the ActiveX module.

    Regards

  9. #9
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question Running Web pages or URL using MPlayer

    Quote Originally Posted by marcel View Post
    No, forget about that.
    You might be able to run IE like this, but this requires the ActiveX module.

    Regards
    How a way I run url in MPlayer through Qt.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  10. #10
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Running Web pages or URL using MPlayer

    Quote Originally Posted by ashukla View Post
    How a way I run url in MPlayer through Qt.
    Take a look at QProcess. Just instantiate a QProcess with mplayer as command name and the path,url as the argument ...

  11. #11
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Running Web pages or URL using QUrlOperator

    Is MPlayer can open the any HTML web Pages or only the media URL contents.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

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
  •  
Qt is a trademark of The Qt Company.