문제

I recently discovered that QMessageBox parses provided text as HTML subset. I want to use it along with user-provided text (name for an item). How should I escape user's text to prevent interpreting it as RTF/HTML?

도움이 되었습니까?

해결책

Use Qt::escape(const QString& plain) function to escape HTML entities.

다른 팁

Use QMessageBox::setTextFormat(Qt::PlainText) to force it to interpret the text as plain text.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top