Hi,

I had a trouble obtaining the behavior I wanted with a caroussel.

Objective:
When I press LEFT/RIGHT, I decrement/increment currentIndex.
I do stuff BEFORE the inc/dec, then I do stuff AFTER the inc/dec.

With the other code in my Keys.onLeftPressed / onRightPressed, I had the feeling that the instructions were NOT sequential. Or at least not totally.



So I just used this code to log everything so I would not go crazy:

Qt Code:
  1. console.log("currentIndex BEFORE increment : " + currentIndex)
  2. incrementCurrentIndex();
  3. console.log("currentIndex AFTER increment : " + currentIndex)
To copy to clipboard, switch view to plain text mode 

And here is the funny result:

qml: currentIndex BEFORE increment : 41
qml: currentIndex AFTER increment : 41


Obviously I did the test several times and always achieved the same result...

Can someone tell me what the f*** is going on?!?!?!?
It feels like *if* you inc/dec the index in the current command, regardless of where the specific command is, it always performs it first.


Yours,
--Jay