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. Where should I define Connection type in Signal and Slot, whenever We use Lambada?
QtWS25 Last Chance

Where should I define Connection type in Signal and Slot, whenever We use Lambada?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 916 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.
  • Y Offline
    Y Offline
    Yash001
    wrote on last edited by VRonin
    #1
    auto expCompleteHandler = [=](const QUuid &id) {
    		
    	};
    
    QList<QMetaObject::Connection> m_connections << QObject::connect(m_mainWindow, &MainWindow::ExperimentCompleted, expCompleteHandler);
    

    Where to define Connection type in above function?
    I know on way is
    QObject::connect(SenderObj,SIGNAL(Signal_name),ReciverObject,SLOT(Slot_name),Qt::QueuedConnection).

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

      Hi,

      Do you mean like with this overload of QObject::connect ?

      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
      1
      • Y Offline
        Y Offline
        Yash001
        wrote on last edited by
        #3

        Yes, I tried like 0_1525293384426_e5528f6c-4615-4a13-ba7f-30ea1f5df8d6-image.png
        but it is give the error like

        Error (active) E0304 no instance of overloaded function "QObject::connect" matches the argument list.

        What Should I Have to Do?

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

          What version of Qt are you using ?

          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
          0
          • Y Offline
            Y Offline
            Yash001
            wrote on last edited by
            #5

            Qt 5.6.3

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

              Just tested with 5.10 on macOS and it's working as expected.

              By the way, AutoConnection is the default, so unless you plan to change it, there's no real need to add it.

              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
              0
              • Y Offline
                Y Offline
                Yash001
                wrote on last edited by
                #7

                Yes sir, I know auto connection is default. I wanted to use Qt::QueuedConnection. I just took as Example to show.

                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