xchange port to qt c++