Fix qHash function for Qt version before 5.0.