Ported to Qt 5.x