PDA

View Full Version : What's the difference between QwtTextLabel and QLabel



theofthe
22nd October 2014, 17:23
Is(Are) there any interesting feature(s) provided by QwtTextLabel?

Uwe
23rd October 2014, 09:13
The important difference is between QString and QwtText - QwtText has extra attributes ( pen, background, frame, text format ).

QwtText objects are used at many places in Qwt code, but QwtTextLabel - a standalone widget showing a QwtText - is more for completeness ( internally used for title/footer of the plot ) than being of major importance.
When comparing QLabel with QwtTextLabel most of these extra attributes can be set using the QLabel API in a similar way, but one important difference remains: QLabel can display Qt::PlainText and Qt::RichText only, while QwtTextLabel can also display MathML.

Uwe

PS1: the quality of the Qwt 6,1 MathML renderer is pretty low ( taken from the former Qt solutions package ) - for Qwt 6.2 it will be improved a lot.
PS2: at the time, when QwtText has been designed I also had TeX in mind - maybe there is a usable renderer available today ?