PDA

View Full Version : How to build QtextEdit.document correspond my Html page?



radmir
3rd June 2014, 08:57
Hi, all,

It seems, it's a luck of my knowledge, but may be someone can help me?

From what I know QTextedit support some set of HTML tags, it is published in Qt Assistant, not all, but, I wonder, how to built the corresponding set of operations on QTextEdit or QTextDocument to get view and functionality like in HTML?
Just sethtml() transforms my html page into something disgusting!
May be there is xsl transform? But prefer to make this using Qt operations...

Any help would be appreciable.

Yours,
Radmir

anda_skoa
5th June 2014, 18:45
If you need to display full HTML maybe QWebView is a better fit for you?

Cheers,
_

radmir
6th June 2014, 18:00
If you need to display full HTML maybe QWebView is a better fit for you?

Cheers,
_

Thanks,
It's a little difficult, but:
First I tried to use QTextEdit and write html editor. Then I found there is restriction: no zoom capability (my eyes worse than I wish).
I used QWebView, look the well known sample htmledit, but found it uses jscript, many function announced, but doesn't work, so I returned to QTextEdit and found not all html tags are supported, more simple tags kinda alignleft, and many others must be done by code using QTextEdit, QTextBlock, QTextCursor, and different Formats, as a result many simple html tags must be replaced complex manipulation with this elements, html string must be parsed and translated into different sets of this commands.
So I wander if anybody got through and has set of rules or code patterns to ease this work.
My dream is to use QTextEdit to produce *.odf file, but that is a dream, I think this feature also does not work, at least I've check some tags, I managed to build QTextEdit so, that QTextEdit.toHtml gives the necessary html page, but odt written from it is wrong...
So, I'm not expecting much from open source, as a rule there are many claims and little realization...
Yours,
Radmir

anda_skoa
6th June 2014, 20:19
So you don't want to display HTML but to create a word processor?

Cheers,
_

radmir
8th June 2014, 17:27
So you don't want to display HTML but to create a word processor?

Cheers,
_

No, I want to use odt format cause this is one small file, HTML editor gives html file + many small referenced files usually in *_files directory, that is, one must carry several items, only alternative is to use mht format, bur odt more broad...
I'll try any case, may be I could manage...

Radmir.

anda_skoa
8th June 2014, 22:43
No, I want to use odt format cause this is one small file,

That would have been helpful in the first posting and the thread title.
Both mention HTML but do not even hint at ODT.

Maybe have a look at Calligra?
https://projects.kde.org/projects/calligra/repository

Cheers,
_

radmir
9th June 2014, 15:43
Thanks,
but what I may find there?
Regards,
Radmir

radmir
10th June 2014, 05:51
I got a quick look and may be you are right, at least the project is worth to look at.
May be it'll help me to improve reading odf file...

Radmir

radmir
14th June 2014, 17:47
No, it based on kde libs, so that means, app could not be used under Windows.
Radmir

anda_skoa
17th June 2014, 08:59
That is a misconception.
All most all libraries created by KDE are Qt libraries.

For example Krita, the painting application of Calligra, is also available as a stand-alone Windows download http://krita.org/download

Cheers,
_