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. Signal boolean set checkbox qml

Signal boolean set checkbox qml

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.0k 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.
  • Nio74N Offline
    Nio74N Offline
    Nio74
    wrote on last edited by aha_1980
    #1

    good after noon

    I have a signal c++ whit emit boolean data :

    emit sendPronta(p_Pronta);
    
    

    I have try so:

     onSendPronta: {
                if(p_Pronta == true){
                    checkBoxPronta.checked = true
                }else{
                    checkBoxPronta.checked = false
    
                }
            }
    

    but not work

    qrc:/Riparazioni.qml:20: ReferenceError: p_Pronta is not defined
    

    Can how I do?

    raven-worxR 1 Reply Last reply
    0
    • Nio74N Nio74

      good after noon

      I have a signal c++ whit emit boolean data :

      emit sendPronta(p_Pronta);
      
      

      I have try so:

       onSendPronta: {
                  if(p_Pronta == true){
                      checkBoxPronta.checked = true
                  }else{
                      checkBoxPronta.checked = false
      
                  }
              }
      

      but not work

      qrc:/Riparazioni.qml:20: ReferenceError: p_Pronta is not defined
      

      Can how I do?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Nio74 said in Signal boo lean set checkbox qml:

      if(p_Pronta == true){

      should not be the name of the variable you send, but the name of the parameter you specified in your signal definition.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      Pablo J. RoginaP 1 Reply Last reply
      4
      • raven-worxR raven-worx

        @Nio74 said in Signal boo lean set checkbox qml:

        if(p_Pronta == true){

        should not be the name of the variable you send, but the name of the parameter you specified in your signal definition.

        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #3

        the name of the parameter you specified in your signal definition.

        @raven-worx is right, see this article for clarification just in case

        BTW, once you have this working and let's say the parameter name is _pronta, you can simplify your code like this:

        onSendPronta: {
            checkBoxPronta.checked = _pronta
        }
        

        less lines of code -> less chances for bugs...

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        Nio74N 1 Reply Last reply
        3
        • Pablo J. RoginaP Pablo J. Rogina

          the name of the parameter you specified in your signal definition.

          @raven-worx is right, see this article for clarification just in case

          BTW, once you have this working and let's say the parameter name is _pronta, you can simplify your code like this:

          onSendPronta: {
              checkBoxPronta.checked = _pronta
          }
          

          less lines of code -> less chances for bugs...

          Nio74N Offline
          Nio74N Offline
          Nio74
          wrote on last edited by
          #4

          I have try bat not work:

          qrc:/Riparazioni.qml:20: ReferenceError: p_Pronta is not defined
          

          @Pablo-J.-Rogina said in Signal boo lean set checkbox qml:

          the name of the parameter you specified in your signal definition.

          @raven-worx is right, see this article for clarification just in case

          BTW, once you have this working and let's say the parameter name is _pronta, you can simplify your code like this:

          onSendPronta: {
              checkBoxPronta.checked = _pronta
          }
          

          less lines of code -> less chances for bugs...

          1 Reply Last reply
          0
          • Nio74N Offline
            Nio74N Offline
            Nio74
            wrote on last edited by
            #5

            my signal is ok
            0_1555525031986_Cattura.JPG

            Pablo J. RoginaP 1 Reply Last reply
            0
            • Nio74N Nio74

              my signal is ok
              0_1555525031986_Cattura.JPG

              Pablo J. RoginaP Offline
              Pablo J. RoginaP Offline
              Pablo J. Rogina
              wrote on last edited by
              #6

              @Nio74 you should show the definition of the signal in C++...

              Upvote the answer(s) that helped you solve the issue
              Use "Topic Tools" button to mark your post as Solved
              Add screenshots via postimage.org
              Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

              Nio74N 1 Reply Last reply
              0
              • Pablo J. RoginaP Pablo J. Rogina

                @Nio74 you should show the definition of the signal in C++...

                Nio74N Offline
                Nio74N Offline
                Nio74
                wrote on last edited by
                #7

                @Pablo-J.-Rogina said in Signal boo lean set checkbox qml:

                @Nio74 you should show the definition of the signal in C++...

                Tanks in the prototype it was declared wrong.

                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