You could look in the QT4 sources... it is GPL.