Action onTrigger handler for AbstractButton derivative called recursively until crash
-
I have an older collection of qml code that used to run on Qt 5.9 and I'm updating it to 5.15. I have a set of AbstractButtons triggering Actions from a group (not the newer ActionGroup - just an enclosing Item). This worked fine on Qt 5.9, but I think I'm doing something wrong - something that was tolerated on 5.9 but no longer is. Some, but not all of these buttons when pushed cause this spectacular crash, which I think must have something to do with my button or action specification (though they both look uniform with respect to the buttons that work. Maybe something to do with threading.
The effect is that the button is pushed and a series of recursive actions are taken where the sequence of activate and clicked actions can be seen on the stack being called recursively with no bottom out, resulting in a stack overflow. The following is roughly what the stack looks like (except upside down of course):
1 setup stuff
2 activate in response to the click
3 QtQuick calls for handling click action
4 Javascript interpreter for qml signal handler
5 Identical activate call to 2 above and repeat recursively until you blow out the stack.I came up with a working solution, which was to to disable the button as part of its action trigger method. This is like "debouncing" an electronic button. Then later I enable button when the UI element is made visible again. But there's no way this is what should be happening.