06-26-2013 07:17 PM - edited 06-26-2013 07:25 PM
how to detect the x change??? the onViewableAreaChanged: gets triggered when I scroll sideways but how do get the x value???? the viewableArea.left doesn't seem to respond??? or how do u make sense of the blurry documentation the signal is supposed to deliver the viewableArea rectangle
Or better yet I have 3 views I added how do I detect when one view is in the viweable port???
I have also trid adding like below but it also it always returns 0 no matter how much I shift
attachedObjects: [ // to get te x position of the scrollview
Thanks in advance
06-27-2013 12:32 AM
bool firstChanging = true
When you recieve the signal onViewableAreaChanging(const QRectF &viewableArea, float contentScale):
double left = viewableArea.left()
firstChanging = false
This will save the inital x value ONCE. Then, onViewableAreaChanged(const QRectF &viewableArea, float contentScale):
double x = viewableArea.left() - left
firstChanging = true
That should give you the total movement in x. If not, come back here with your results (remember, this is pseudocode).
06-27-2013 07:05 AM
Thanks for the hint, that seems like it would return the delta once it works, but the small detail is getting it to work
Adding/deleting the onViewableAreaChanging makes no difference.
Should I call a C++ function instead and then send a signal back to QML??? In other situations like this that was the only way to get around this.
06-27-2013 09:44 AM
If you think diong it through C++ would be simpler then debugging your problem, then by all means go for it.
Now, instead of having a pop-up, you could have it change the text property of a Label. That way you'll get a visual queue and will be able to see if .left() is functionnal or not. And I don't nkow what you mean by everything being a var; you have to define the type of every variable in QML...