Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Need lock for model and view?
Forum Updated to NodeBB v4.3 + New Features

Need lock for model and view?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 258 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jronaldJ Offline
    jronaldJ Offline
    jronald
    wrote on last edited by jronald
    #1

    They may access/modify data simultaneously.

    For example, it's possible that the model is deleting data while the view is accessing deleted data. But with a lock, the view becomes slower, and it locked data frequently.

    What's the proper way?

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Are you using multiple threads?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      jronaldJ 1 Reply Last reply
      1
      • VRoninV VRonin

        Are you using multiple threads?

        jronaldJ Offline
        jronaldJ Offline
        jronald
        wrote on last edited by
        #3

        @VRonin said in Need lock for model and view?:

        Are you using multiple threads?

        Maybe.
        Posting event to the UI thread seems a good solution.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved