RealityKit has no built-in QR code detector, but you can use the CoreImage or Vision framework to accomplish this task.
From within an ARKit session, you can access the current camera image as follows:
arView.session.currentFrame.capturedImage.
Based on that image, you can then run the QR code detection.
If you use Vision, have a look at
VNDetectBarcodesRequest (
https://developer.apple.com/documentation/vision/vndetectbarcodesrequest). You can also find a sample project here:
https://developer.apple.com/documentation/vision/detecting_objects_in_still_images.If you prefer to use CoreImage, have a look at the
CIDetector class (
https://developer.apple.com/documentation/coreimage/cidetector) which you would initialize with the type
CIDetectorTypeQRCode.