Provided are a quinoline or quinazoline derivative having a structure of formula (I), a pharmaceutical composition comprising the compound of formula (I), and use of the compound in the preparation of a medicament for preventing or treating diseases associated with the human epidermal growth factor receptor Her/erbB family, in particular for preventing or treating tumors associated with protein tyrosine kinases. Each substituent in formula (I) has the same definition as that in the description.L'invention concerne un dérivé de quinoléine ou de quinazoline ayant une structure de formule (I), une composition pharmaceutique comprenant le composé de formule (I), et l'utilisation du composé dans la préparation d'un médicament pour la prévention ou le traitement de maladies associées à la famille Her/erbB du récepteur de facteur de croissance épidermique humain, en particulier pour la prévention ou le traitement de tumeurs associées à des protéines tyrosine kinases. Chaque substituant dans la formule (I) a la même définition que celle donnée dans la description.