The present application provides a compound of formula I, which is a EGFR and ALK dual inhibitor and can be used alone or in combination with other therapeutic agents to treat diseases such as non-small cell lung cancer. The compounds of the present application are useful in the treatment of diseases carrying the EGFR wild-type gene, or carrying the EGFR T790M mutant gene and/or the EGFR L858R mutant gene and/or the EGFR delE746_A750 mutant gene, or in the treatment of diseases carrying the ALK wild-type gene, ALK F1174L mutant gene and/or ALK F1196M gene and/or EML4-ALK mutant gene and/or NPM-ALK mutant gene, and can be used in the first-line treatment of anaplastic lymphoma kinase (ALK) positive late-stage non-small cell Lung cancer.