Created attachment 480090 [details]
The attached ebuild and patch allow openscad to be built against either qt4 or qt5 (but not both).
For this to work, a version of openscg that supports qt5 is also needed. See bug 623608 an ebuild that does this.
Created attachment 480092 [details, diff]
Patch that allows openscad to compile and run against qt5
Created attachment 480822 [details]
The fix for bug 623608 did not include qt4 and qt5 use flags on media-gfx/opencsg as expected when I created the attached ebuild (because they aren't needed). See bug 623608 for details.
I have updated the openscad ebuild to reflect this.
Thanks for your patch, added to tree in git commit 82b27387e7847268227a680fe402f63fd4b97113