I believe it's only Android 10 onwards that has the QR Code scanning feature [1][2][3] since it was added by Google in order to support the new Wi-Fi Easy Connect standard [4] (the replacement for WPS).
[1] https://9to5google.com/2019/03/13/android-q-wi-fi-sharing-qr...
[2] https://www.androidpolice.com/2019/09/12/every-new-android-1...
[3] https://www.androidpolice.com/2019/06/10/android-qs-wi-fi-ea...