Cannibalism is often an extreme interaction in the animal species to quell competition for limited resources. To model this critical factor, we improve the predator–prey model with nonlocal competition effect by incorporating the cannibalism term, and different kernels for competition are considered in this model numerically. We give the critical conditions leading to the double Hopf bifurcation, in which the gestation time delay and the diffusion coefficient were selected as the bifurcation parameters. The innovation of the work lies near the double Hopf bifurcation point, and the stable homogeneous and inhomogeneous periodic solutions can coexist. The theoretical results of the extended centre manifold reduction and normal form method are in good agreement with the numerical simulation.