Skip to content
nucularmoo edited this page Mar 6, 2018 · 13 revisions

Object Communicating: Queued Connections

Explanation of the contents of a topic page @ Week 1 Topic 1

Back to Week 1

Objectives: Different to direct connections

Comment: Thread-safe object communication: queued connections

E: Objective or new topic name?

Comment: The important thing to learn is the "context" in which the slot is executed. The right word is thread affinity, i.e. to which thread an object belongs to. I'd like to avoid talking about thread affinity yet, so delayed creation with QMetaObject::invokeMethod(...slot...) use cases and deleteLater slot would be important to learn. In queued connections that signal parameters are always marshalled and written to the copy of the object. This is important to understand. For example signal(&MyType) cannot be connected in a queued way to a slot as copied a reference does not make sense. signal(const &MyType) on the other hand works as the object copy of the reference works as a const reference.

Beginner

Intermediate

  • What are Queued Connections?
  • What can be accomplished trough Queued Connections?
  • What is thread affinity?
  • How connection type affects the thread affinity? (or perhaps affects the thread in which the object members are called)
  • What is delayed object creation?
  • What is deleteLater?

Expert

  • How are Signal parameters handled in queued connections? (references actually copied)
  • How do queued connections work? (QCoreApplication::postEvent)

Course material content

Queued Connections

Connection types affecting Thread affinity

Delayed Object Creation


Exhaustive reference material mentioned in this topic

Further reading topics/links:

Clone this wiki locally