Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    General and Desktop
    2
    7
    629
    Loading More Posts
    • 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
      Yash001 last edited by VRonin

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 1
        • Y
          Yash001 last edited by

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • Y
              Yash001 last edited by

              Qt 5.6.3

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • Y
                  Yash001 last edited by

                  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 Reply Quote 0
                  • First post
                    Last post