Qt5: migrate to new ports mechanism

Fixes #1233.