Take a look at QtCreator source code.