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. is QMetaObject::invokeMethod() thread-safe?

is QMetaObject::invokeMethod() thread-safe?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 421 Views 1 Watching
  • 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.
  • btseB Offline
    btseB Offline
    btse
    wrote on last edited by
    #1

    Can anyone tell me if QMetaObject::invokeMethod() is thread-safe? I was looking at the documentation and noticed that Qt 5.12's documentation explicitly states it's thread-safe (https://doc.qt.io/qt-5.12/qmetaobject.html#invokeMethod) whereas Qt 5.11 and before does not explicitly state this (https://doc.qt.io/qt-5.11/qmetaobject.html#invokeMethod).

    Based on the language used in the documentation, and the fact that it supports things like the Queued Connection and BlockingQueuedConnection, I'm assuming it is thread-safe even prior to 5.12? And perhaps them adding the Note was an oversight in previous version's documentation?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Here is the bug report that prompted the documentation update https://bugreports.qt.io/browse/QTBUG-72599 and root discussion that has led to it https://forum.qt.io/topic/97683/thread-safety-of-qmetaobject-invokemethod-e-g-slot-invoking-from-random-threads.

      And perhaps them adding the Note was an oversight in previous version's documentation?

      Exactly. Code is the same in earlier Qt versions.

      (Z(:^

      1 Reply Last reply
      4

      • Login

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