qt: add optional postgresql support.

Closes #32397.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>