Enable -DQT_NO_URL_CAST_FROM_STRING and fix compilation

Authored by dfaure on May 30 2018, 12:47 PM.