Reference Links:

  1. Installation
    Install CLion and QT before configuration. Download links can be found online, or download directly from their official websites.

  2. Configuration
    2.1 Open CLion and create a project
    Image Description

2.2 After creating, click File->Setting->Build,Execution,Deployment->ToolChains configuration file. We need to replace the environment and C Compiler with MinGW that comes with QT. Configuration is as shown in the figure.

Image Description

2.3 After completion, Debug needs to be configured. Click CMake under 2.2, configure Debug. Enter -DCMAKE_PREFIX_PATH=E:\Qt\5.14.2\mingw73_64\lib\cmake in CMakeOption. After clicking Apply, you will find that you can Debug in the upper right corner. At this time, we need to link CLion with QT Designer. We need to set ExternalTool. Click File->Setting->Tools->External Tools and add a QT configuration file.
Image Description
This step refers to the blogger: Developing Qt with CLion: Qt5.9.1+CLion2020.3 Step 3. After adding, you can use QT for joint coding.

2.4 Issue Report. The version I use reports an error “Error copying file “, at this time you can check link 2. Removing one sentence from it will allow it to run successfully.

Image Description

Based mainly on the official configuration file for CLion, but since it’s all in English, I recorded the steps for future convenience.