HTML special symbols problem in QLabel and QwtText
Hi
I have a problem with render special HTML symbols by QLabel and QwtText (I mean). Difficulty is in that the symbols render is wrong not always. It is with ƒ and Δ symbols somtimes.
Google and forums was searched but with no results.
I have read sources of QLabel painEvent() and QwtText::draw() methods to understand why that problems is, but not find anything helpful. There used QTextDocument::documentLayout()->draw(QPainter*, PaintContext) methods, but I realized html delegete for item views with these methonds and in the views it working fine.
Than I have some dummy proxy style to render html in tabs of QTabWidget with QPlastiqueStyle and HtmlLineEdit and several other widget promoted classes with ability to render html, but with the QTextDocument::drawContents() is used there. It working fine everywhere and I don't understand why the wrong behaviour takes place.
I have Qt 4.4.2 and qwt 6.0.1 libraries
If someone can help with it will be great
Re: HTML special symbols problem in QLabel and QwtText
These work fine here (Qt 4.7.4):
Code:
// Force the text format
label1->setTextFormat(Qt::RichText);
label1->setText("ƒ Δ");
// Qt::AutoText detects the HTML and goes rich text
QLabel *label1
= new QLabel("<html><body>ƒ Δ<body></html>",
this);
and this does not because the rich text processing is not triggered:
Re: HTML special symbols problem in QLabel and QwtText
Thanks ChrisW67. It's helpful.
In fact that these symbols have no any html tags in difference of other places where html is used and it go out of my mind.
Thanks for help!