Forums

OverviewFelgo 2 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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support