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. How in Qt6 use c++ signal with argument in qml?
Forum Updated to NodeBB v4.3 + New Features

How in Qt6 use c++ signal with argument in qml?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 394 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.
  • M Offline
    M Offline
    Mihaill
    wrote on last edited by
    #1

    Hi!
    How in Qt6 use c++ signal with argument in qml?
    It is nor work:

    signals:
        void currentIdSeansForScheduleChanged(int currentIdSeansForSchedule);
    
        Connections {
            target: AppCore
            function onCurrentIdSeansForSchedule(idUser) {
                console.log(2222222)
            }
        }
    

    I get the error:

    qrc:/Schedule.qml:6:5: QML Connections: Detected function "onCurrentIdSeansForSchedule" in Connections element. This is probably intended to be a signal handler but no signal of the target matches the name.
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      If memory serves well it should be:

      onCurrentIdSeansForScheduleChanged
      

      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
      • M Offline
        M Offline
        Mihaill
        wrote on last edited by
        #3

        But it's not work

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

          Then please provide a minimal compilable example that shows the issue.

          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
          • M Offline
            M Offline
            Mihaill
            wrote on last edited by
            #5

            Sorry, it worked by itself

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

              So my suggestion was correct ?

              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

              • Login

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