PDA

View Full Version : Using HTML and CSS in QT Help System



whitefurrows
4th March 2007, 18:07
Hi,

is it possible to use cascading style sheet with the Qt Assistant? I attemtped to load my own profile with references to HTML files that contained references to a style.css file that i had, but the html files were displayed in a different style as in my webbrowser. What can i do?

Thanks in advance,

Whitefurrows

Brandybuck
4th March 2007, 18:34
The Qt rich text engine does support a limited set of CSS. But it doesn't support external stylesheets yet. You'll need to include them in the HTML text. See the documentation for "Supported HTML Subset" for mroe information.

whitefurrows
4th March 2007, 21:23
The Supported HTML Subset it's not enough. I have many html files and the layout is given with my style.css. It's necessary to use my style.css and CSS Properties like, margin, padding, position, overflow, height, border and some from the given CSS Properties. You menan i must include all css property in my html files and can't use <link rel> and <div>? I think that's dirty, have i no other possibility ?

wysota
4th March 2007, 22:00
Sure you have. You can embed a real html browser into your application ;)

whitefurrows
4th March 2007, 22:38
The reason why i wont to use the assistant is the programm must run without other software. Or have i a chance to implement the code of a real html browser and can sell my software?

wysota
4th March 2007, 23:20
Assistant is not a real html browser - it uses QTextBrowser to render the content. I meant something like Gecko or IE.

Brandybuck
5th March 2007, 03:21
I think that's dirty, have i no other possibility ?
As stated previously, QTextBrowser is not an HTML browser engine. It is a simple rich text widget that can handle links and external resources. There are people working on porting Apple's WebKit back to Qt, so soon there will be a free crossplatform HTML browser engine available. But right now there is not.

Do you really need to embed an HTML browser in your application? A very good alternative is to use QDesktopServices. Give it an URL and it will launch the current desktop's configured browser. Then you can use Javascript, frames, CSS3, etc, to your heart's content.

whitefurrows
5th March 2007, 08:39
The profiles and full text searching in all documents, is that what i need. I can't do that with a HTML browser. My plan was to modify the assistant, but i have no idea how can i do that. You know library they can do?

travlr
9th March 2008, 11:27
Webkit is available in the 4.4 beta and recent snapshots. The /demos directory contains a demo browser (http://labs.trolltech.com/blogs/2008/03/05/webkit-demobrowser/) developed by benjamin Meyer. It works great! Netscape plugins and flash support are on the way. Read the white paper located on this page. (http://trolltech.com/webkit/webkit-announce)
The integration capabilities are awesome. I'm so excited.

-travlr

whitefurrows
9th March 2008, 14:34
Hi,

we have include a css like this:

<link rel="stylesheet" media="all" type="text/css" href="../../css/mycss.css" />
and use only the supported css properties for qt's rich text engine.

That's worke fine but it's nice to know that qt has include the webkit, thank you!

alverson
10th January 2012, 18:12
This seems to work with QWebView but not with the same web page used as a help file within Qt Assistant. Why not?

Lykurg
10th January 2012, 18:34
As far as I know Qt Assistant is based on QTextBrowser which only supports a small HTML subset.

wysota
10th January 2012, 20:00
Assistant can use one of two backends -- QTextBrowser or QWebView. It's decided compile-time, so one might need to rebuild Assistant.

Woody89
7th May 2012, 12:07
So as I understand it, it's not really possible with a QHelpEngine to generate css in a QWebView?