I should trigger all events in my Qt/Qml application. In particular I'm trying to trigger key and mouse events. I would to implement a sort of standby with a QTimer that reset when the event is triggered. Is possible to implement this feature in my Qt/Qml application?
impossible to trigger events from all of these widgets (using onClicked() signal for example)
Why not? Every application has multiple "widgets" and it is done using the signal handler hooks in almost all of the cases with some very, and I do mean very rare exceptions.
Thus I should trigger a general events on QApplication to know if mouse or keyboard buttons has been clicked
And from there on use some personal method of determining what that event should do? That sounds like a very bad idea if your application is indeed as diverse in GUI elements as you claim. I highly doubt it will be easier to create a more robust or efficient solution than the one that is already implemented, or a less buggy for that matter.
Either you are completely new to QML and its programming paradigm, and haven't realized that handler hooks are the intended way to do user interaction, which is the more likely case, or you are trying to do something very "custom".
It is not all that hard to implement a "global" handler for keyboard and mouse events, just put a single MouseArea
on top of your application window and use that to capture all mouse interaction, and have keyboard focus set on a single item that acts as a keyboard event receiver.
However this means that once you do that, you take full responsibility of manually managing the way events are directed. I've done this for keyboard events, because QML's "one focus item" design didn't suit my particular needs, and I can tell you that it is a hassle. Doing it for the mouse too will only make it even harder and more bug prone.
It also means you have to give up on pretty much all UI elements QML provides out of the box, since they all rely on receiving actual focus and events.
Of course, you could intercept events at an even lower level from C++, but that will only be even harder and more prone to actually breaking stuff.
Considering your sparse activity history, It does look like what you really need to be doing is familiarizing yourself better with the programming paradigm behind QML than asking questions about things you don't need to do and really don't want to be doing, because they are complex and unnecessary and in most use cases represent anti-patterns that are very counterproductive.