There is no built-in solution for this, but (assuming you are using c++), google-breakpad provides a solution. The documentation is a little lacking, and it has trouble playing with Qt's (non-)handling of exceptions thrown in event handlers, but it can take care of most of the heavy lifting.
Responding to questions in other answer:
Gyp should be located in src\tools\gyp\gyp.bat. You will run something like the following:
src\tools\gyp\gyp.bat src\client\windows\breakpad_client.gyp --include=breakpad_include.gypi -Dwin_debug_RuntimeLibrary=3 -Dwin_release_RuntimeLibrary=2 --generator-output=..\build\google_breakpad
The breakpad_include.gypi
file sets up special configuration that gyp should use. Mine looks like this:
{
'target_defaults': {
'configurations': {
'Common_Base': {
'msvs_settings': {
'VCCLCompilerTool': {
'TreatWChar_tAsBuiltInType': '0',
},
},
},
},
},
}
This gets around a difference in how Qt and VS treat WChar. The other settings specify the runtime library to use. This has to match what Qt is using.