Have you looked at the Qt drag and drop examples?