PDA

View Full Version : Running Web pages or URL using QUrlOperator



ashukla
1st September 2007, 11:31
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

marcel
1st September 2007, 11:56
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::openUrl. It is static.

Regards

ashukla
3rd September 2007, 07:21
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::openUrl. 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.

marcel
3rd September 2007, 07:32
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

ashukla
3rd September 2007, 10:31
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.

momesana
3rd September 2007, 17:07
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.

ashukla
6th September 2007, 05:45
Dear Sir!
Any way is possible to run firefox within QWidget hiding with its popups (hiding title bar, Menu Bar etc.).

marcel
6th September 2007, 06:21
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

ashukla
6th September 2007, 13:01
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.

momesana
6th September 2007, 14:22
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 ...

ashukla
7th September 2007, 05:40
Is MPlayer can open the any HTML web Pages or only the media URL contents.