Modified code to work with qt 5.3

originally based on 4.8