Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. India
  4. connect between two classes
Qt 6.11 is out! See what's new in the release blog

connect between two classes

Scheduled Pinned Locked Moved Unsolved India
3 Posts 3 Posters 2.4k 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.
  • qt_ankit_developerQ Offline
    qt_ankit_developerQ Offline
    qt_ankit_developer
    wrote on last edited by
    #1

    hello ,
    can any one have idea to connect two different class form QOBJECT::connect
    i want to connect two classes from connect option...

    ODБOïO 1 Reply Last reply
    0
    • qt_ankit_developerQ qt_ankit_developer

      hello ,
      can any one have idea to connect two different class form QOBJECT::connect
      i want to connect two classes from connect option...

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @qt_ankit_developer hi,

      this is one way to 'connect' 2 objects

      Obj sender;
      OtherObj reciver;
      
      QObject::connect(&sender,SIGNAL(s()),&reciver,SLOT(doS()));
      
      here s() is a signal of sender and doS() is public slot of reciver.
      
      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        You don't connect classes, you connect instances of them.

        You have all the details in the Signals And Slots chapter of Qt's documentation.

        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

        • Login

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