Take a look at https://www.bartslinger.com/cx-10-quadcopter/debugging-stm32-from-qtcreator/
and similar articles. Key words: "qtcreator debugging stm32"