QML. How do you test it?
-
Hello. I'm trying to test my QML user interface with Testcase and experiencing problems with mouse events.
First of all, mouse clicks work only with windows and items, so clicking something becomes really tricky. For menu actions I found out that it is much easier to call Action::trigger() function. Lists(TreeView in my case) and ItemDelegates are not items, so they are not clickable. Best idea I came up with was to call mouseClick on window component giving summary of coordinates of list in the window and element in the list, which is pretty inaccurate and needed some offsets. If there is a better way please tell me.
Second problem I've met is double clicking. As documentation says mouseDoubleClick function is obsolete and the only way to double click an item is mouseDoubleClickSequence, which "reproduces the sequence of mouse events generated when a user makes a double click: Press-Release-Press-DoubleClick-Release". Honestly, I haven't met users that click like that. The application I write should respond differently on single and double click, but the documentation does not provide separate options