Disclosed are a fused heterocyclic compound, a preparation method therefor, a pharmaceutical composition, and uses thereof. The fused heterocyclic compound is shown in formula I, formula II, or formula III. The preparation method of the fused heterocyclic compound and/or the pharmaceutically acceptable salt thereof in the present invention comprises three synthesizing routes. The present invention also provides a pharmaceutical composition of the fused heterocyclic compound, the pharmaceutical composition containing one or more of the fused heterocyclic compound shown in formula I, formula II, or formula III, the pharmaceutically acceptable salt thereof, hydrates, solvent compounds, polymorphs and prodrugs thereof, and a pharmaceutically acceptable carrier. The present invention also relates to an application of the fused heterocyclic compound and/or the pharmaceutical composition in preparing kinase inhibitors and in preparing drugs for preventing and treating diseases related to kinase. The fused heterocyclic compound of the present invention has selective inhibition function on PI3Kδ, and can be used for preparing drugs for preventing and treating cell proliferation diseases such as cancers, infections, inflammations, or autoimmune diseases.