The sources are in the qt4 demos and you can use the pro file if you like, but here's example of how to use the EXT_ALL target in an mc2.def.
This also applies to makefiles in general, but it's much easier to work through an intermediate system such as mc2.
It is also a great demo for using dialogs, and you can choose native or QT built-in styles for them, which makes a big difference for the file and color selection dialogs.
I particularly like the file...