Use Qt Creator to Build C++ Samples in Windows
Introduction
This tutorial shows how to configure and build the Zivid C++ Samples with Qt Creator 4.12.1.
Pre-requisites
Follow requirements and installation steps in Configure C++ Samples With CMake and Build Them in Visual Studio in Windows, including Install OpenCV.
Configure the project in Qt Creator
Start Qt Creator.
![Screenshot of Qt Creator startup screen.](../../../_images/qt_creator_startup_screenshot.png)
Click File → Open Project.
![Screenshot of Qt Creator open file menu.](../../../_images/qt_creator_open_file_screenshot.png)
Navigate to your clone of the C++ Samples and open CMakeLists.txt.
![Screenshot of Qt Creator open CMakeLists.txt.](../../../_images/qt_creator_open_CMakeLists_screenshot.png)
Configure Kits
Click Manage Kits… and configure your Desktop Kit as per the figure below.
Compiler: |
Microsoft Visual C++ Compiler (x86_amd64) |
![Screenshot of Qt Creator Kit configuration.](../../../_images/qt_creator_configure_kit_screenshot.png)
For CMake generator click Change… and set the following entries:
Generator: |
Ninja |
Extra generator: |
CodeBlocks |
![Screenshot of Qt Creator set CMake Generator.](../../../_images/qt_creator_set_cmake_generator_screenshot.png)
To include Eigen and OpenCV for CmakeConfiguration click Change… and add the following:
EIGEN3_INCLUDE_DIR:STRING=C:/Users/Public/Downloads/eigen-git-mirror
OpenCV_DIR:STRING=C:/Users/Public/Downloads/opencv/build
![Screenshot of Qt Creator set Eigen and OpenCV paths.](../../../_images/qt_creator_set_eigen_and_opencv_paths_screenshot.png)
Click OK, and again OK.
Configure Project
Select Desktop and expand Details. Then, check Debug and Release.
![Screenshot of Qt Creator project configuration.](../../../_images/qt_creator_configure_project_screenshot.png)
Click Configure Project.
![Screenshot of Qt Creator project configuration completed.](../../../_images/qt_creator_project_configuration_complete_screenshot.png)
Click Build → Build All Projects
![Screenshot of Qt Creator build all projects.](../../../_images/qt_creator_build_all_projects_screenshot.png)
Expand CppSamples and select a C++ program to view it.
![Screenshot of Qt Creator select application.](../../../_images/qt_creator_select_sample_screenshot.png)
Run the sample program
Select a sample program, e.g. CaptureVis3D. Right-click on the program, then click Run.
![Screenshot of Qt Creator run application.](../../../_images/qt_creator_run_sample_screenshot.png)
Alternatively, navigate to the Release folder in File Explorer.
![Screenshot of Qt Creator run application from Explorer.](../../../_images/qt_creator_run_sample_from_explorer_screenshot.png)
Run a sample program, e.g. CaptureVis3D.exe.
![Screenshot of CaptureVis3D sample.](../../../_images/screenshot_from_capture_vis3d.png)
Close the window.