Tutorial is valid for Qt6 and OpenCV 4.x - follow same steps but during OpenCV compilation select similar paths to your Qt6 installation (name of the folder with mingw may vary depending on your installation) https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows
since we are doing cmake project, ignore the "Compile and run the example" - we do not have .pro file.