Qt.createQmlObject bug?



  • Hi,

    I think I found a bug in Qt.createQmlObject in Qt 5.4...

    If in the given QML if I use the word 'function' in a string element, when defining an array, I get a parsing error. Or so it seems to be with this one file I'm working on.

    For example:

    var arr = [
    "function",
    "something"
    ]
    
    

    Could anyone with a reasonably fresh Qt version verify if this issue has been solved?

    Cheers,
    -A888


  • Moderators

    Hi! Cannot confirm this behaviour. The following works for me (Qt 5.6.0, x86_64 Linux):

    Qt.createQmlObject('import QtQuick 2.6; Rectangle {color: "red"; width: 100; height: 100; function nix(){ var arr=["function","two"]; console.log(arr)} Component.onCompleted:nix() }', mainWindow, "dynamicSnippet1");
    


  • @Wieland said:

    Qt.createQmlObject('import QtQuick 2.6; Rectangle {color: "red"; width: 100; height: 100; function nix(){ var arr=["function","two"]; console.log(arr)} Component.onCompleted:nix() }', mainWindow, "dynamicSnippet1");

    Good to hear, must be solved then. Thanks!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.