Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › Bug on QML/JS Reformat File??? forEach function deleted

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23477

    jrrobles79

    I have the next function:

     onAdditionInfoFetched:{
                 //(var info)
                if(!isCurrentStackPage){
                    return;
                }
                var msgs = []
                info.forEach(element => {
                                 var indexOf = messagesListModel.indexOf("tdid", element.tdid)
                                 if (element.type === 0 && indexOf === -1) {
                                     msgs.push(element)
                                 }
                             } );
                root.messages = root.messages.concat(msgs)
                root.messagesChanged()
                //listView.positionViewAtEnd()
            }
    

    when I call the Tools > QML/JS > reformat file, the funcion is changed to this:

     onAdditionInfoFetched: {
                //(var info)
                if (!isCurrentStackPage) {
                    return
                }
                var msgs = []
                info.forEach(function element }
                var indexOf = messagesListModel.indexOf("tdid", element.tdid)
                if (element.type === 0 && indexOf === -1) {
                    msgs.push(element)
                }
            })
                root.messages = root.messages.concat(msgs)
                root.messagesChanged()
                //listView.positionViewAtEnd()
            }
    

     

    The inner function on the forEach is removed and is now giving me an error

     

     

    #23518

    Alex
    Felgo Team

    Hi,

    please also post this issue in the general Qt forums, as this is not specific to Felgo. This is a functionality of the official Qt Creator.

    Best,
    Alex

    #23524

    jrrobles79

    ok, thank you Alex

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded