Results 1 to 10 of 10

Thread: How to build QtextEdit.document correspond my Html page?

  1. #1
    Join Date
    Feb 2013
    Posts
    31
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to build QtextEdit.document correspond my Html page?

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to build QtextEdit.document correspond my Html page?

    If you need to display full HTML maybe QWebView is a better fit for you?

    Cheers,
    _

  3. #3
    Join Date
    Feb 2013
    Posts
    31
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to build QtextEdit.document correspond my Html page?

    Quote Originally Posted by anda_skoa View Post
    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

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to build QtextEdit.document correspond my Html page?

    So you don't want to display HTML but to create a word processor?

    Cheers,
    _

  5. #5
    Join Date
    Feb 2013
    Posts
    31
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to build QtextEdit.document correspond my Html page?

    Quote Originally Posted by anda_skoa View Post
    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.

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to build QtextEdit.document correspond my Html page?

    Quote Originally Posted by radmir View Post
    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,
    _

  7. #7
    Join Date
    Feb 2013
    Posts
    31
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to build QtextEdit.document correspond my Html page?

    Thanks,
    but what I may find there?
    Regards,
    Radmir

  8. #8
    Join Date
    Feb 2013
    Posts
    31
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to build QtextEdit.document correspond my Html page?

    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

  9. #9
    Join Date
    Feb 2013
    Posts
    31
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to build QtextEdit.document correspond my Html page?

    No, it based on kde libs, so that means, app could not be used under Windows.
    Radmir

  10. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to build QtextEdit.document correspond my Html page?

    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,
    _

Similar Threads

  1. Replies: 2
    Last Post: 20th October 2017, 14:38
  2. jump from one html page to another html page
    By RENOLD in forum Qt Programming
    Replies: 4
    Last Post: 10th February 2012, 04:41
  3. Qt 4.7 export html document to pdf: strange
    By giusepped in forum Qt Programming
    Replies: 5
    Last Post: 2nd December 2010, 23:35
  4. How can I support page up/page down on QTextEdit
    By wesley in forum Qt Programming
    Replies: 7
    Last Post: 14th September 2010, 19:18
  5. HTML document
    By jamd in forum Qt Programming
    Replies: 1
    Last Post: 28th June 2006, 20:49

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.