When a Qt port is installed, it may need to add a line to qconfig-modules.h. When it is uninstalled, it may need to remove a line. When its options change (and pkg-upgrade does a deinstall-reinstall) the line may need to be added or removed (may depend on port options, too).
When a Qt port is installed, if it has versionable binaries that share a name across Qt versions, it needs to update symlinks to qtchooser.
The ports framework handles this with a collection of @postexec and @postunexec and a PKGDEINSTALL script.
Known PRs are 253356 and 253360, where lines are duplicated, or not remove when needed. This PR centralizes the update actions to one script, admittedly a long-ish and generic one, that ensures that the qconfig-modules.h maintains consistency and the qtchooser symlinks are updated accordingly.