0

I'm new to QGIS 2.8 Library to develop standalone map application in qt4, C++ language. I was wondering if there is any way that I can use QGIS plugins such as Advanced viewshed analysis, Contour plugin and so on by:

creating a dll library by rewriting the python code to c++ after obtaining the plugins source code from github(with credits of course, will have to study Python since am more of c++ developer)

writing a wrapper around the code

If anyone has done one of the above can you tell me which one is better and where to start?

Edited: I've already develop a standalone application which can load multiple vectors and raster maps, calculate distance and area, display different svg icons on map and get pixel values of a point(elevation data) from the map. the only remaining parts that i want to develop is the above listed points.

1

Looks like you're trying to jump to advanced stuff without first trying developing a simple C++ standalone QGIS application.

Specifically, a QT C++ application calling QGIS C++ API

QT C++ application using QGIS API

After that, concering plugins reusing, you'll have to check first if the plugin was written in C++ (the original way of doing it) or in Python.

In the first case you'll probably can reuse all the code calling QGIS C++ API.

In the second case the plugin will be using PyQt and in that case you'll have find a way to call not only PyQt code from your C++ QT standalone application,. but also PyQGIS.

It's worth nothing PyQGIS is using SIP to interface with the underlaying C++, in case you want to dive in the source code, and not the more commonly used SWiG interface, for generating Python bindings.

Note: QGIS 2.8 is very old.

2
  • 2
    Just to add to this -- DON'T start writing a new application in qt4, it's unsupported and likely to break permanently in the near future.
    – ndawson
    Nov 26 '19 at 21:26
  • 1
    Sorry for not mentioning what I've done.I've develop a standalone application which can load multiple vectors and raster maps with d/t functionality like pan,zoom In/Out,calculate distance and area,display different svg icons on map and read pixel values(elevation data) etc. Remaining parts are but not only limited are viewshed analysis, Contour and others which most of them are already developed as a python plugin . So from your answer it's possible to use QGIS C++ API and develop the functionality needed. QGIS 2.8 is very old, you are right but it's not my decision to make,that's why. Nov 27 '19 at 11:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.