A compound of formula or a pharmaceutically acceptable salt thereof wherein is selected from the group consisting of and R 1 is selected from the group consisting of isopropyl, 2-propenyl and allyl; R 2 is selected from the group consisting of methyl and phenyl; R 3 is selected from the group consisting of H and halogen; R 4, R 5 and R 6 are each independently selected from the group consisting of H, halogen, OH, NH 2, CN, NO 2 and =O, or selected from the group consisting of C 1-8 alkyl, C 1-8 alkylamino, N,N- di(C 1-8 alkyl)amino, C 1-8 alkoxyl-C 1-8 alkyl-, C 1-8 hydroxyalkyl, C 2-8 alkenyl, C 2-8 alkynyl, C 3-7 cycloalkyl and a 3- to 7-membered heterocycloalkyl group, each of which is optionally substituted with 1, 2 or 3 Rs; optionally, any two of R 4, R 5 and R 6 can form a 3- to 7-membered ring together; R 7 is selected from the group consisting of H, halogen, -OR 8, -SR 8, -N(R 8)(R 9) and C 3-7 cycloalkyl; X 1, X 2, X 3 and X 4 are each independently selected from a group consisting of N and C(R 10); X 7 is selected from the group consisting of carbonyl and C(R 11)(R 12); W is a single bond; T is selected from the group consisting of N and C(R 10); Q is selected from the group consisting of N and C(R 10); m and n are each independently selected from the group consisting of 0, 1 and 2; R 8 and R 9 are each independently selected from the group consisting of H, C 1-8 alkyl and C 3-7 cycloalkyl; R is selected from the group consisting of F, Cl, Br, I, NH 2, CN, OH, CF 3, CHF 2, CH 2 F, NHCH 3 and N(CH 3) 2; optionally, R 8 and R 9 are linked to the same one atom and form a 3- to 7-membered ring with 1-4 heteroatoms; the term "hetero" or "heteroatom" represents O, S, S(=O), S(=O) 2 or N; R 10 is selected from the group consisting of H, halogen, OH, NH 2, CN, C 1-6 alkyl, C 1-6 alkoxyl, C 3-5 cycloalkyl, CN, -OR 8, -SR 8, -N(R 8)(R 9), -C(=O)R 8, -C(=O)OR 8, -C(=O)N(R 8)(R 9), -S(=O)R 8, -S(=O) 2 R 8, -S(=O)N(R 8)(R 9) and -S(=O) 2 N(R 8)(R 9); R 11 and R 12 are each independently selected from the group consisting of H, OH, halogen, C 1-8 alkyl and C 3-7 cycloalkyl; optionally, R 4 and R 10 are linked to the same one atom and form a 3- to 7-membered ring; and optionally, the structural unit can be substituted by wherein is selected from the group consisting of and R 1 is selected from the group consisting of isopropyl, 2-propenyl and allyl; R 2 is selected from the group consisting of methyl and phenyl; R 3 is selected from the group consisting of H and halogen; R 4, R 5 and R 6 are each independently selected from the group consisting of H, halogen, OH, NH 2, CN, NO 2 and =O, or selected from the group consisting of C 1-8 alkyl, C 1-8 alkylamino, N,N- di(C 1-8 alkyl)amino, C 1-8 alkoxyl-C 1-8 alkyl-, C 1-8 hydroxyalkyl, C 2-8 alkenyl, C 2-8 alkynyl, C 3-7 cycloalkyl and a 3- to 7-membered heterocycloalkyl group, each of which is optionally substituted with 1, 2 or 3 Rs; optionally, any two of R 4, R 5 and R 6 can form a 3- to 7-membered ring together; R 7 is selected from the group consisting of H, halogen, -OR 8, -SR 8, -N(R 8)(R 9) and C 3-7 cycloalkyl; X 1, X 2, X 3 and X 4 are each independently selected from a group consisting of N and C(R 10); X 7 is selected from the group consisting of carbonyl and C(R 11)(R 12); W is a single bond; T is selected from the group consisting of N and C(R 10); Q is selected from the group consisting of N and C(R 10); m and n are each independently selected from the group consisting of 0, 1 and 2; R 8 and R 9 are each independently selected from the group consisting of H, C 1-8 alkyl and C 3-7 cycloalkyl; R is selected from the group consisting of F, Cl, Br, I, NH 2, CN, OH, CF 3, CHF 2, CH 2 F, NHCH 3 and N(CH 3) 2; optionally, R 8 and R 9 are linked to the same one atom and form a 3- to 7-membered ring with 1-4 heteroatoms; the term "hetero" or "heteroatom" represents O, S, S(=O), S(=O) 2 or N; R 10 is selected from the group consisting of H, halogen, OH, NH 2, CN, C 1-6 alkyl, C 1-6 alkoxyl, C 3-5 cycloalkyl, CN, -OR 8, -SR 8, -N(R 8)(R 9), -C(=O)R 8, -C(=O)OR 8, -C(=O)N(R 8)(R 9), -S(=O)R 8, -S(=O) 2 R 8, -S(=O)N(R 8)(R 9) and -S(=O) 2 N(R 8)(R 9); R 11 and R 12 are each independently selected from the group consisting of H, OH, halogen, C 1-8 alkyl and C 3-7 cycloalkyl; optionally, R 4 and R 10 are linked to the same one atom and form a 3- to 7-membered ring; and optionally, the structural unit can be substituted by