[Lazarus] How to display html contents?

Dmitry Boyarintsev skalogryz.lists at gmail.com
Mon May 11 04:50:44 CEST 2015


On Sun, May 10, 2015 at 6:21 AM, Giuliano Colla <
giuliano.colla at fastwebnet.it> wrote:.
>
> Actually I'm porting to Lazarus a collection of Kylix applications, which
> where using a TTextViewer component, which is nothing but a wrapper for
> QTextViewer. Kylix used Qt3, but I see that the same component also exists
> in QT4. If I don't manage to fix ipro for my purposes, what you propose is
> another viable option, leading to a Lazarus TTextViewer.
> Thank you very much for the tip.


If you're planning to use Qt only, you can go as low as following:
Get a handle of TMemo and call Qt function QTextEdit_setHtml (declared at
qt45.pas).

Something like this:

uses
  ... qt4, qtwidgets, qtprivate..
...

var
  html : string; // assuming this is utf8 html
  w : widestring;
...
  whtml:=UTF8Decode(html);
  QTextEdit_setHtml(  TQtTextEdit( (Memo1.Handle).widget, PWideString(w));



thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150510/6c233d8a/attachment-0003.html>


More information about the Lazarus mailing list