Changing User or root password through Qt app

I wrote an Qt app that creates new user in linux system!
Simply taking in input and gives it to a bash script as argument which runs the command useradd
all that is ok and working great
bt im not able to update password for the newly created user
how can i do that?
thanks all! :D