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.

Click FileOpen Project.

Screenshot of Qt Creator open file menu.

Navigate to your clone of the C++ Samples and open CMakeLists.txt.

Screenshot of Qt Creator open CMakeLists.txt.

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.

For CMake generator click Change… and set the following entries:

Generator:

Ninja

Extra generator:

CodeBlocks

Screenshot of Qt Creator set CMake Generator.

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.

Click OK, and again OK.

Configure Project

Select Desktop and expand Details. Then, check Debug and Release.

Screenshot of Qt Creator project configuration.

Click Configure Project.

Screenshot of Qt Creator project configuration completed.

Click BuildBuild All Projects

Screenshot of Qt Creator build all projects.

Expand CppSamples and select a C++ program to view it.

Screenshot of Qt Creator select application.

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.

Alternatively, navigate to the Release folder in File Explorer.

Screenshot of Qt Creator run application from Explorer.

Run a sample program, e.g. CaptureVis3D.exe.

Screenshot of CaptureVis3D sample.

Close the window.