Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › AppSwitch logic problem

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #19447

    Eric

    Hello,

    I’m trying to set up a basic connection between two AppSwitch elements. The connection is very simple, I have two switches, the main switch and a sub switch, as seen below.

    App {
      id: app
      property bool main_switch: false
      property bool sub_switch: false
    
      AppSwitch {
        checked: app.main_switch
        onToggled: {
          app.main_switch = !app.main_switch;
          app.sub_switch = !app.sub_switch
        }
      }
    
      AppSwitch {
        checked: app.sub_switch
        onToggled: {
          app.sub_switch = !app.sub_switch
        }
      }
    }

    When I first load the app, if I click the main switch, the sub switch also changes as expected, regardless of what the initial states are of either switch. However, once I flip the sub switch manually, the ‘connection’ is lost in that when I subsequently switch the main switch, the sub swtich no longer flips even though the value of app.sub_switch does in fact change as it should.

    It seems I’m not understanding the ‘checked’ value. It seems to me that regardless of what changes app.sub_switch to true or false, the switch itself should change, is that not true? Could someone help me understand why I’m not getting the expected action?

    Thank you.

    #19448

    Alex
    Felgo Team

    Hi,

    set updateChecked to false on the on sub switch.

    Cheers,
    Alex

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded