The Maldives immigration QR code is the last of your worries actually. Do one within the 24h prior to your very first flight in case Qatar asks for it at that point. You can always do it again on your last PNR booking to the Maldives if needed. Just have a scan or picture of your PCR test and a photo of yourself ready for submission at all times.
I submitted an immigration form a bit too early the first time (I thought it said "24h prior to first flight") but the QR code has an expiry date on it. So you can't do it too early, but you can still do it 1h before the flight.