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. QML Binding only functions ones
QtWS25 Last Chance

QML Binding only functions ones

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 625 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.
  • J Offline
    J Offline
    jago
    wrote on last edited by
    #1

    Hello!

    I have two components: a Slider with property value and a Prompt with property promptValue. The Slider and the Prompt should both show the same value. With the buttons of the Prompt one can increment or decrement the value. In another Qml file I instantiate the slider and the prompt and use Bindings to make a bidirectional connection to the backend:

    Slider Binding:

    @MySlider {
    id: slider
    maximum: 450
    minimum: 220
    value: backendObject.backendVlaue

                                        Binding {
                                            target: backendObject
                                            property: "backendVlaue"
                                            value: slider.value
    

    }@

    Prompt Binding:

    @Prompt {
    id: prompt
    max: 450
    min: 220
    promptValue: backendObject.backendValue

                                        Binding {
                                            target: backendObject
                                            property: "backendValue"
                                            value: prompt.promptValue
                                        }
    

    }@

    The thing is it only functions ones. Either i move the handle of the slider, then the value is updated and shown correctly both in slider and in the prompt. Or I push the buttons, then the handle and the prompt values are being updated and shown correctly. If I first move the slider, then push the buttons and then move the slider again, the values will not update. Or vice versa.
    Can anyone comprehend the problem? As I understand the value should be updated automatically through Bindings and my two components use the same value, so why do they differ when I move the slider second time after pushing the buttons of the prompt?

    thanx and best regards

    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