C++ Graphical User Interface (GUI) Programming in Qt Creator using QGIS3 C++ API as an embedded mapping component. Developing a standalone Qt 5.12.8 application using QGIS3 C++ API.
-
Clone the branch "release-3_24" from QGIS official repository:
-
Set up QGIS build environment. Following links are helpful:
-
Clone this repo and open the qmake project (.pro) file in Qt Creator. The qmake tool is supplied with Qt. It is used to build Qt itself as well as the tools and examples that accompany it. Update path variable values accordingly in cockpit.pro and map.cpp files.
-
The path variables in cockpit.pro file are:
- QGIS_DIR
- BUILD_DIR
-
The path variables in map.cpp file are:
- QString myPluginsDir
- QString path
- QString myLayerPath2
- QString myLayerPath3
- QString myLayerPath4
-
-
In Qt Creator go to Project/Build Settings and configure your build path. Then specify your KIT settings like Qt-Version, Compiler etc. Currently, QGIS builds are only supported on version 5 of the Qt libraries. Thus, select Qt version 5. Finally compile and run the project in Qt Creator.
https://web.stanford.edu/dept/cs_edu/resources/qt/recommended-settings