Change serialize code to qt