[Solved] Stripping double quotes from string
If I try to call toString() method on any object in QML, it's string representation is always enclosed in escaped double quotes. For e.g.
calling toString() on a url object gave me:
Could you paste an example showing the problem?
The following seems to output the correct string and length for me (doesn't include the escaped double quotes)
import QtQuick 1.0
width: 400; height: 400
property url myProp: "index.qml" Component.onCompleted: console.log(myProp + " " + myProp.toString().length)
Does it work correctly for you?
Ok, it's not a problem with QML. I was trying to catch linkClicked(QUrl) signal from QWebView in C++, and pass them to QML. By default QUrl encloses urls in double quotes while converting them to strings ( when I call toString() ).
Thanks for your reply !!!