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. Emit Signal once but getting the slot twice
Forum Updated to NodeBB v4.3 + New Features

Emit Signal once but getting the slot twice

Scheduled Pinned Locked Moved Unsolved General and Desktop
emit signal oncslot is called
3 Posts 3 Posters 1.5k Views 2 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.
  • FlacoDanzigerF Offline
    FlacoDanzigerF Offline
    FlacoDanziger
    wrote on last edited by
    #1

    I created a signal from a c++ (keyButtonAction) and the slot is in the QML as
    Connections {
    target: my_display
    ignoreUnknownSignals: true
    onKeyButtonAction: {
    console.log("KeyButton press");
    }
    }

    When I emit the signal keyButtonAction() the code invoke the slot twice?
    Any idia why?

    p3c0P 1 Reply Last reply
    0
    • FlacoDanzigerF FlacoDanziger

      I created a signal from a c++ (keyButtonAction) and the slot is in the QML as
      Connections {
      target: my_display
      ignoreUnknownSignals: true
      onKeyButtonAction: {
      console.log("KeyButton press");
      }
      }

      When I emit the signal keyButtonAction() the code invoke the slot twice?
      Any idia why?

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @FlacoDanziger,
      May be you are trying to change the property KeyButtonAction somewhere which in turn triggers the change signal ?

      157

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        From Qt docs: "Every connection you make emits a signal, so duplicate connections emit two signals."

        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