Detect Rich Text in QML
QML and Qt Quick
6
Posts
3
Posters
3.7k
Views
1
Watching
-
Is there an easy way for a Text element to know if its text is Rich Text? I need this for an application that will center unformatted text but display Rich Text as given.
I'm hoping that "Qt::mightBeRichText()":http://developer.qt.nokia.com/doc/qt-4.8/qt.html#mightBeRichText has been secretly exposed to QML and that I've simply missed it in the Fine Manual. :-)
-
I need something more. I am looking for a way to detect Rich Text myself so that I can apply additional formatting, such as setting horizontalAlignment, to plain text. It is not sufficient to use Text.AutoText.
Can call Qt::mightBeRichText() from my QML application?
-
Hi,
you can use onTextChanged signal in Text element to parse for HTML tags or something like this.