Is there a C++ or Qt library available to measure feature use of an application

analytics, c++, qt, usage-statistics

Solution

First question : should you do it ? People don't like when their software phones home without their consent. But assuming they are ok with it then:

It's technically possible, with two approaches: automatic or manual. Of course, given your question, I assume that you are using Qt.

Automatic:

- give a proper name to all the QObject that you want to trace

- install an event filter on your application to catch all the ChildEvent about objects that are created and destroyed.

- from the ChildEvent, you can extract the object's name

- then you can already log how often that object is created. You can also use the opportunity to add an event listener to that specific object, to be notified when it is shown or hidden or track other kind of usage

- log everything to a log file

Manual :

- add log statements to relevant part of your code that you want to track.

Final :

- send the log file on a regular basis

Problem

I would like to be able to measure the features in our application that are being used. For example how much certain windows are opened, certain controls are clicked. I can imagine a tool that measures this and sends a report to a web server, that can further process it to create meaningful data from it

Original source