1. A QR code detection device, comprising: a body; a barcode detector, built in the body, capturing and processing a code image outside the body, and accumulating a number of times when a predetermined pattern feature is recognized in the code image, wherein the predetermined pattern feature is a predetermined distance ratio; and a barcode decoder, built in the body and connected to the barcode detector; wherein the barcode detector chooses a near-distance detection rule or a far-distance detection rule according to the processed code image to determine whether the predetermined pattern feature is recognized in the code image, and when the barcode decoder determines that the code image is a QR code image because the number of times equals to a threshold number, the barcode decoder is automatically turned on to capture and decode the QR code image outside the body.