Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. How can I bind a functor WITH a receiver?
Forum Updated to NodeBB v4.3 + New Features

How can I bind a functor WITH a receiver?

Scheduled Pinned Locked Moved Language Bindings
2 Posts 1 Posters 947 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.
  • T Offline
    T Offline
    tdzl2003
    wrote on last edited by
    #1

    Here's what I need:
    I bind a functor to a sender like:
    @QObject::connect(sender, signal, functor);@
    But functor may use another QObject.
    I want another overload like:
    @QObject::connect(sender, signal, recver, functor);@
    "functor" is no relationship with recver, but this connection will be destroyed automatically when sender "or" recver is destroyed.
    Is this possible? or any other solution?

    Currently I use "destroyed" signal to remove connection manually, but it's ugly.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tdzl2003
      wrote on last edited by
      #2

      I read source code, and I think there is a way if I can modify Qt header files.
      But is there any solution without header files modified?

      I use this feature for my Lua-binding project at : https://github.com/tdzl2003/luaqt

      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