Fix Qt overflow bug