Workaround for a Qt4 positioning bug (taken from QtCurve).