it is important to call centerAllSurfaces after _btnCancel->setX(180); on line 59, otherwise the x coordinate set there will not get properly updated.