Modifying for QT 4 and 5 support.