[Interest] Don't get expected result from drawing StaticText with HTML

Martin Marmsoler martin.marmsoler at gmail.com
Tue May 14 22:02:34 CEST 2019


Hi Giuseppe,

thank you for your reply. Im trying to find a Bug in Labplot, so I have to
try to create a minimal project.

I tried with QTextDocument and it seems to work fine.

QTextDocument document;

document.setHtml(staticText.text());

//painter->drawStaticText(QPoint(-w/2,-h/2), staticText);

document.drawContents(painter);


Martin


Am Di., 14. Mai 2019 um 21:16 Uhr schrieb Giuseppe D'Angelo via Interest <
interest at qt-project.org>:

> Hi,
>
> On 14/05/2019 20:07, Martin Marmsoler wrote:
> >
> > I store this String in a QStaticText (staticText)and draw this text with
> >
> > painter->drawStaticText(QPoint(-w/2,-h/2),staticText);
> >
> >
> > But the result is that the hole text is red and not only the part "arke"
>
> Which Qt version are you using, under which OS, etc.?
>
> Do you have a minimal testcase somewhere?
>
> Did you already try painting a QTextDocument directly, without going
> through QStaticText? (At least it would point out if there's a bug in
> QStaticText)
>
> Cheers,
> --
> Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
> KDAB - The Qt, C++ and OpenGL Experts
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190514/e643a1be/attachment.html>


More information about the Interest mailing list