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. Do Qt replica slot functions work with references?
Forum Updated to NodeBB v4.3 + New Features

Do Qt replica slot functions work with references?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 261 Views 2 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.
  • M Offline
    M Offline
    majorRonk
    wrote on last edited by majorRonk
    #1

    I wondering if its possible to use references in .rep files,
    so that the reference value is changed in the host function
    and the replica site gets the new value.
    I guess the value is dropped while transfer, right ?

    SLOT(QVariant readValue(QString key, QString section, bool& found))
    

    It does not seem to work. "found" is always false, after its set to true on the host site.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Don't do that. Signals and slots are not made for that use case. During asynchronous connections, parameters are copied.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • C Offline
        C Offline
        chris1058
        wrote on last edited by
        #3

        Yes, it's possible, but references in .rep files typically don't persist during transfer. Use return values, state management, or callbacks to ensure the replica site gets the updated value.

        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