use a QSize instead of finalwidth and finalheight