[Qt-interest] Displaying html with images.

Andrew Maclean andrew.amaclean at gmail.com
Wed Aug 5 03:45:08 CEST 2009


David Boosalis came up with a suggestion, involving using WebKit.

Works nicely in two lines.

Something like this:

  QUrl url(fn);
  InstructionsDlg dlg(this);
  dlg.webView->load(url);
  if ( dlg.exec() )
  {
  }

Where fn is the absolute file name.


Thanks
  Andrew



On Wed, Aug 5, 2009 at 9:48 AM, Andrew Maclean<andrew.amaclean at gmail.com> wrote:
> Has anyone any idea on how to display an html file that contains both
> text and images? The images are in the same directory as the html file
> and are relative to the file.
>
> I am doing something like this:
>  QString help_str;
>
>  help_str = ifn.readAll();
>
>  dlg.textBrowser->setHtml(help_str);
>  dlg.textBrowser->setReadOnly(true);
>
> But all I am not seeing the picture. I am using a textBrowser.
>
> Thanks
>  Andrew
>
>
> --
> ___________________________________________
> Andrew J. P. Maclean
> Centre for Autonomous Systems
> The Rose Street Building J04
> The University of Sydney  2006  NSW
> AUSTRALIA
> Ph: +61 2 9351 3283
> Fax: +61 2 9351 7474
> URL: http://www.acfr.usyd.edu.au/
> ___________________________________________
>



-- 
___________________________________________
Andrew J. P. Maclean
Centre for Autonomous Systems
The Rose Street Building J04
The University of Sydney  2006  NSW
AUSTRALIA
Ph: +61 2 9351 3283
Fax: +61 2 9351 7474
URL: http://www.acfr.usyd.edu.au/
___________________________________________




More information about the Qt-interest-old mailing list