HTML tags in QStrings not working in Android
-
It seems that html tags can't be handled in QString in android. Is there any way to get it working?
-
You need to be more specific about what you mean by "handled" and "working" before anyone could try to answer the question.
-
Ok, I mean, for example, I have a
QMessageBox::warning(this,
tr("New Game"), QString("<p align='center'>%1</p>"
"<p align='center'>%2</p>")
.arg(tr("An unfinished game is in progress."))
.arg(tr("Do you want to start a new game?")),
QMessageBox::Yes | QMessageBox::No);in my program. Then on android the string appears as
New Game <p align='center'>An unfinished game is in progress.</p>
<p align='center'>Do you want to start a new game?</p>with all the html tags.
-
Does calling setTextFormat(Qt::RichText); help?
I haven't used Qt on Android, so I'm just guessing.
-
This is a reported bug: https://bugreports.qt-project.org/browse/QTBUG-34772
-
warning is a static function of QMessageBox and I can't pass setTextFormat to it. Besides, it is working on other platforms, so textFormat is actually auto and no need to explicitly declare it.
-
[quote author="tomasl" date="1390914873"]This is a reported bug: https://bugreports.qt-project.org/browse/QTBUG-34772[/quote]
I didn't see your post. Thanks