Forums

OverviewFelgo 2 Support (Qt 5) › best way to modify a var hashmap property

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #23565

    Bas

    hi,

    i have a property in the root QML let say:

    property var g_data : ({})

    Then i have some functions that will add data to g_data and is triggered from external TCP connections
    The data contains user data that is added with a key and some object data as value like this:

    if( topqml.g_data[clientid] === undefined ) {
       topqml.g_data[clientid] = {}
       topqml.g_data[clientid]["loggedon"] = true;
     }
    

    so the data gets initialised.

    and then multiple clients start to insert data during connection, so the g_data is growing.

    the g_data is also send to another client via TCP and displayed there with a frequent interval.

     

    my question is this a safe way of manipulating data asynchronusly, or is there a safer/better way to do this?

    Thanx in advance,

    Bas

     

     

     

     

     

Viewing 1 post (of 1 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