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. connect signal from class instead of instance

connect signal from class instead of instance

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

    Hello, I am currently building an app and there's several custom widgets. Each of these widgets emit a signal when a spinbox they contain is changed.

    Is it possible to connect a signal from the class itself or do I need to loop over all the instances of that class and connect them from the object?

    JonBJ 1 Reply Last reply
    0
    • D Deneguil

      Hello, I am currently building an app and there's several custom widgets. Each of these widgets emit a signal when a spinbox they contain is changed.

      Is it possible to connect a signal from the class itself or do I need to loop over all the instances of that class and connect them from the object?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Deneguil
      The latter. You cannot "connect by class" in any actual way. You can implement it any way you like, e.g. in the class instance constructor, but you do have to connect each instance. Signal (and slot) connections are by object.

      D 1 Reply Last reply
      4
      • JonBJ JonB

        @Deneguil
        The latter. You cannot "connect by class" in any actual way. You can implement it any way you like, e.g. in the class instance constructor, but you do have to connect each instance. Signal (and slot) connections are by object.

        D Offline
        D Offline
        Deneguil
        wrote on last edited by
        #3

        @JonB thank you I'll be looping over the objects then

        1 Reply Last reply
        1

        • Login

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