Conditions for complex spectra in a class of PT symmetric potentials