Skip to content

Commit

Permalink
port Qt::escape to Qt 5 toHtmlEscaped
Browse files Browse the repository at this point in the history
  • Loading branch information
qcad committed Feb 19, 2018
1 parent 13ec6eb commit c7189cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/scripting/ecmaapi/RScriptHandlerEcma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,11 @@ QScriptValue RScriptHandlerEcma::ecmaQtEscape(QScriptContext* context,
QScriptEngine* engine) {
if (context->argumentCount() == 1) {
QString cppResult = Qt::escape(context->argument(0).toString());
#if QT_VERSION >= 0x050000
cppResult = context->argument(0).toString().toHtmlEscaped();
#else
cppResult = Qt::escape(context->argument(0).toString());
#endif
return qScriptValueFromValue(engine, cppResult);
} else {
return throwError(
Expand Down

0 comments on commit c7189cb

Please sign in to comment.