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

connect between two classes

Scheduled Pinned Locked Moved Unsolved India
3 Posts 3 Posters 1.9k 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.
  • Q Offline
    Q Offline
    qt_ankit_developer
    wrote on 26 Apr 2018, 11:01 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...

    O 1 Reply Last reply 26 Apr 2018, 11:26
    0
    • Q qt_ankit_developer
      26 Apr 2018, 11:01

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

      O Offline
      O Offline
      ODБOï
      wrote on 26 Apr 2018, 11:26 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
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 26 Apr 2018, 11:28 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

        3/3

        26 Apr 2018, 11:28

        • Login

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