Use unnamespaced hex for Qt < 5.14
Qt 5.14 moves hex under a Qt namespace, so use it in the right way depending on the Qt version.