Here are the steps that worked for me in configuring OpenCV with Qt and Visual Studio:
- Make sure you download the Qt source from here (make sure you download the zip file, in the Qt download page look for: "The source code is available as a zip..."
- Extract the zip file (say in: C:\Qt\QtSource485)
- Then you need to build it. Start up a Visual Studio Command Prompt (2010).
- Now navigate to the extracted folder and enter inside it by using the console window.
Enter the following command (it worked for me fine):
configure.exe -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg
Then enter
nmake
Then add the built binary files path to the system path...If you have Matlab installed, make sure the C:\Qt\QtSource485\bin path is set BEFORE the Matlab path (this is crucial it took me hours to find why it does not worked otherwise!)
- Now start the CMake (cmake-gui). Check the 'Advanced' tick box before pressing Configure.
- After configuration tick 'WITH_QT'.
- Untick the 'Advanced' tick box.
- Press again Configure.
- Look for the 'QT_QMAKE_EXECUTABLE' option and browse: 'C:/Qt/QtSource485/bin/qmake.exe'
- Press generate and you're done. Then you are ready to build OpenCV with Qt!
Good luck!