PDA

View Full Version : html browser!!



Seema Rao
10th May 2006, 13:16
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

zlatko
10th May 2006, 14:05
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 :)

Seema Rao
10th May 2006, 14:14
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:confused:

nupul
10th May 2006, 14:14
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

nupul
10th May 2006, 14:17
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:confused:

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 ;)

Seema Rao
10th May 2006, 14:18
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".

nupul
10th May 2006, 14:28
could you post the code?

Seema Rao
10th May 2006, 14:33
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();

}

cwalsh
10th May 2006, 20:37
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

Brandybuck
10th May 2006, 23:00
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.

jacek
10th May 2006, 23:29
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?

Brandybuck
11th May 2006, 19:14
I'm so sorry, I posted to the wrong thread :crying:

jacek
11th May 2006, 20:13
I'm so sorry, I posted to the wrong thread :crying:
Where's the right one?

ball
12th May 2006, 04:15
Where can I find QtFirefox for cross-platform browser embedded in Qt application?

zlatko
12th May 2006, 09:17
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

ball
12th May 2006, 10:24
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?