Monday, January 30, 2017

application development - QML: QChar Booleans are undefined




function myFunction(x)
{
console.log(x.isLetter)
}

myFunction("s")


When I run this in a .qml file, it tells me that "isLetter" is undefined. Why?




http://qt-project.org/doc/qt-5/qchar.html#isLetter



You can't directly use Qt methods on JavaScript var, to do what you want prefer a pure js implementation:



x.match(/[a-z]/i);

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...