Yes, your modem has your external IP address, so no one even knows your PC exists as the modem will typically block all pings. This is a great advantage - any attacks get aimed at your modem rather than your PC so far less risk of your PC being hacked, as people can't see it.

No need to turn off the firewall, just enable the upnp and leave it as that. Make sure you use Windows update as the original version of UPNP on Windows had some vulnerabilities.

How to use UPNP in Qt is really beyond the scope of this forum, but there is a lot of information out there and a good number of open source apps which have UPNP included.