[SOLVED] Regarding Slider and Canvas
-
@Pradeep-Kumar.M
onValueChanged: { progress.value = value; canvas.y-- }
You are always reducing the
y
value regardless ofSlider
's value. So it will always move in one direction i.e upwards.what do i do if i want to move upwards as well as downwards,
with respect to slider value -
what do i do if i want to move upwards as well as downwards,
with respect to slider value@Pradeep-Kumar.M
Same as how you update the progress bar. Bind the value. But you will need to deduce a formula which will move it precisely. For eg:onValueChanged: { progress.value = value; canvas.y = -value*160 //replace with your own formula }
just to demonstrate how it works.
-
@p3c0
hello.
inside onpaint, i made use of it {onpaint}.@pc30
hello one more question
can we add our own user defined attached properties to the existing QML Items. -
@pc30
thank you so much, its working fine,
and by the way your good name please,
and i hope i'l practise much more interesting stuff,
problem is solved.will you answer my second question please which i have posted.
-
@pc30
thank you so much, its working fine,
and by the way your good name please,
and i hope i'l practise much more interesting stuff,
problem is solved.will you answer my second question please which i have posted.
@Pradeep-Kumar.M By "existing QML Items" you mean the inbuilt QML items or your own custom defined items ?
-
@Pradeep-Kumar.M By "existing QML Items" you mean the inbuilt QML items or your own custom defined items ?
@p3c0
our own user defined items. -
@p3c0
our own user defined items.@Pradeep-Kumar.M I think yes. But I haven't used as such. Check out the following attached-properties for some information regarding it. Example here.
-
@Pradeep-Kumar.M I think yes. But I haven't used as such. Check out the following attached-properties for some information regarding it. Example here.
@p3c0
thank you -
@Pradeep-Kumar.M I think yes. But I haven't used as such. Check out the following attached-properties for some information regarding it. Example here.
hello.
i got with respect to mouse implementaion,
can i have implementation of canvas with slider value with key up pressed, and key down pressed?. can you suggest. -
hello.
i got with respect to mouse implementaion,
can i have implementation of canvas with slider value with key up pressed, and key down pressed?. can you suggest.@Pradeep-Kumar.M As it doesn't return anything, you will need to keep a counting variable which will be increased and decreased on key up and down pressed (you will need to decide how much to increase or decrease at a time). Then assign this count (with some multiplier) value to
y
in similar way we did with slider.