Replaced dynamic cast on widgets with static cast in method saveFileAs