iOS printing to a printer on the network

I'm trying to make an iOS application that can "automatically" print pictures to a printer that's on the network. I'm fairly new to iOS and Qt but so far I've not been able to find out how to do the printing. I found some examples that show me how I can use bonjour (https://doc.qt.io/archives/qq/qq23-bonjour.html), I think I can more or less find my printer like this but I couldn't find any help so far on how to use QPrinter to automatically connect to that printer.
Basically my code so far is essentially: