Fix crash when running debug build; use QString instead of C string