[Qgis-developer] What is the C++ Plugin writing Workflow?

Richard Duivenvoorde rdmailings at duif.net
Wed Dec 28 09:17:16 EST 2011


> Hello Devs,
>
> In connection with the previous announcement that, I am planning to
build the Heatmap plugin and people suggesting that I use C++ for it so
that it gets native support, I have a few doubts regarding this.
>
> Firstly what exactly is the workflow? My rudimentary understanding is that,
> C++ plugins are shipped with the software. So I need to create a folder for
> my plugin inside the Quantum-GIS/src/plugins/ folder and write my code
inside that folder, and compile the entire Quantum-GIS for errors.
>
> I think I am wrong, because, one cannot compile the entire codebase just to
> verify errors in 5 or 6 files. So how exactly is it done?
>
> I have been hunting around the web and the hub.qgis for this info, for
about 2 days. Most docs talk about the Qgis 0.8 era development only.


This looks like you have not so much experience with c++ (like me, no
offence :-)) just try..

If you are on Linux, and want to build via commandline, follow the
instructions in the INSTALL doc which you can find in the source tree, or
online on github:
https://github.com/qgis/Quantum-GIS/blob/master/INSTALL

Try this (this is I think just the best en most accurate source there is),
so you have an idea how to use it.

To make it a easier, you can use an IDE for compiling and debugging. I
would say, try qtcreator (instructions on tims blog:
http://linfiniti.com/2011/06/using-qtcreator-with-qgis/ )

I would think it is easiest if you want to try using a IDE

And after that, just start hacking your plugins (you have to know off
course about interfaces, classes etc etc, but that is 'normal' programmers
knowledge).
Don't worry about 'compiling whole qgis for just a plugin'. Your compile
tools will handle this nicely: only the first time you compile everything
(in debug mode) and it will take some time, but after that a compile/build
will just take seconds. And it is good to have your own debug build of
qgis so you can debug step into ALL qgis code, to find out why something

Just try one of the above options first. But there are even instructions
for building it with  Eclipse/CDT if you are familiar with that:
http://linfiniti.com/2011/12/compiling-qgis-with-eclipts-cdt-on-ubuntu/

If you are on Windows... there are instructions in the INSTALL about that
also. I was even able to compile it in a virtual windows machine with
Visual Studio Express.

Tim and Jef put a lot of effort to keep the building instructions up to
date. I think they do a very good job with this. But there is really some
learning curve for it...

Hopefully this works for you!


Regards,


Richard Duivenvoorde






More information about the Qgis-developer mailing list