Fix keyToValue compatibility for Qt 4