Just create a one-line file at the same location than your executable:
Content of launcher.sh:
echo "root password" | sudo -S ./executable
Don't forget to chmod:
sudo chmod a+x launcher.sh // Yeah it's dirty I know!
Then, launch QtCreator normally, open your project, go to the settings and create a new Run configuration. The executable should be your launcher.sh file. Tick the checkbox "Run in terminal"