qt: ensure we use bundled libs

Fixes #27898.
Closes #27956.