Important: Please read the Qt Code of Conduct -

Does Qt5 have a framework for logging user actions?

  • Often when we receive bug reports for our Desktop application, the details as to how to reproduce the problem are, well, not too well explained. So we started thinking that it may be nice to somehow track each keyboard stroke and mouse interaction, in order to 'replay' a situation that triggered a bug.

    Does Qt5 have something builtin to track mouse events and keyboard events and to create a nice log from it?

  • Lifetime Qt Champion

    I have not seen any such build in tools.
    Some event filters combined with a logging framework would make something like that.
    But there would no play back as such. Only info.

  • Lifetime Qt Champion


    While I can understand the reasoning, the implication of what you are trying to do might be wider than you think. Take for example a user that put the focus back to your application by error and types one of his password… It will sounds like espionage.

    You should rather put tracing information in your application at strategic points and have a switch that allows to activate it. You can use QLoggingCategory for that.

  • @SGaist Thank you for the important warning about possibly unwanted implications.

    I didn't know about 'categorised logging' yet - certainly something to look into. At the same time also very dependent on each of the developers in the team to call this function at each and every appropriate time, with the correct message, which may be very hard to force when under a lot of pressure to create functionality (as our team currently is). As a matter of fact, we currently already have something comparable for more general app logging, but using Boost logging. In practice it turns out these logs are way too sparse to be useful. A more automated approach could make sure we don't overlook an important event, which would be preferable. It is clear though that this shouldn't be done on a low level.

  • Since the obvious answer to the question is a resounding 'no', I'll mark this question as 'solved', although I'll still have to think about a way to achieve what we want in the most convenient way.