Results 1 to 2 of 2

Thread: Odd QMap/QList possible thread problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Odd QMap/QList possible thread problem

    Most Qt classes are reentrant, but not thread safe. I believe you need to serialize access to QMap/QList by using a QMutex or QMutexLocker convenience function.

    Edit: Each Qt class has a note just past the class overview that states whether the class is reentrant or thread safe. If the class is reentrant, then you need to serialize access to the instance of the class on your own. If the the class is documented as thread safe, then the class itself serializes resources to ensure they can be safely used by multiple threads simultaneously.
    Last edited by jefftee; 18th February 2015 at 20:44.

Similar Threads

  1. Replies: 1
    Last Post: 6th February 2014, 08:28
  2. pointer to nested QMap and QList
    By franki in forum Qt Programming
    Replies: 1
    Last Post: 4th December 2013, 11:44
  3. QMap in QList | i can get value but i can`t set value
    By petrusPL in forum Qt Programming
    Replies: 4
    Last Post: 20th March 2013, 18:40
  4. QMap QList
    By dare5421 in forum Qt Programming
    Replies: 1
    Last Post: 23rd March 2011, 23:17
  5. QMap in QList ?
    By npc in forum Newbie
    Replies: 2
    Last Post: 5th February 2007, 11:51

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.