Have a look at my latest changes in dev-rr branch and see if you can build and run Qt now. My changes were primary ment for lima & panfrost but should fix your mesa related problems too. At least I was able to compile AMLGX with lima/panfrost & all of my packages including Qt but neither SDL2 nor Qt can properly pick up the KMS/DRI device... well I guess the driver needs some fixing then. But the RPi4 driver should be in way better shape.
Cool. Hopefully, I can check it out soon.