Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qml slot called multiple times irrespective of the signal being emitted only one time

Qml slot called multiple times irrespective of the signal being emitted only one time

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 1.2k 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.
  • AmazingQtA Offline
    AmazingQtA Offline
    AmazingQt
    wrote on last edited by
    #1

    I have a Qml signal which is emitted from one qml and handled in another qml.
    The slot is called multiple times irrespective of the qml signal being emitted only one time.

    E 1 Reply Last reply
    -1
    • AmazingQtA AmazingQt

      I have a Qml signal which is emitted from one qml and handled in another qml.
      The slot is called multiple times irrespective of the qml signal being emitted only one time.

      E Offline
      E Offline
      Eeli K
      wrote on last edited by
      #2

      @AmazingQt Code, please. Preferrably a minimal self-contained working example.

      1 Reply Last reply
      1
      • AmazingQtA Offline
        AmazingQtA Offline
        AmazingQt
        wrote on last edited by AmazingQt
        #3

        In my Test.qml file

        NewDataFill {
        dialog: myInputDialog
        }

        InputDialog {
        id : myInputDialog
        signal accepted(text)
        onOkClicked: {
        accepted("2")
        }
        }

        In my NewDataFill.qml file
        property var dialog

        MouseArea {
        onclicked : {
        dialog.visible = true
        dialog.value = 5
        }

        Connections {
        target: dialog
        onAccepted: {
        console.log ( "called on accepted " )
        }
        }

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          Slot will be called multiple times only if the connection is done multiple times. Other wise there is no chance that slot will be called multiple times. I tried to look at your code. It is not self sufficient to code see your issue. If you can help us the simple piece of code which gives the problem, it will help us to help you.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          1

          • Login

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