Download QGIS Coding and Compilation Guide

Transcript
Contents
Contents
Title
i
Preamble
ii
Table of Contents
iii
1 Writing a QGIS Plugin in C++
1.1 Why C++ and what about licensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Programming a QGIS C++ Plugin in four steps . . . . . . . . . . . . . . . . . . . . . .
1.3 Further information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
1
1
19
2 Creating C++ Applications
2.1 Creating a simple mapping widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Working with QgsMapCanvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
20
23
3 Writing a QGIS Plugin in Python
3.1 Why Python and what about licensing . . . . . . . .
3.2 What needs to be installed to get started . . . . . . .
3.3 Programming a simple PyQGIS Plugin in four steps
3.4 Uploading the plugin to the repository . . . . . . . .
3.5 Further information . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
27
27
27
28
31
31
.
.
.
.
33
33
34
39
39
4 Creating PyQGIS Applications
4.1 Designing the GUI . . . . .
4.2 Creating the MainWindow .
4.3 Finishing Up . . . . . . . .
4.4 Running the Application . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5 Installation Guide
43
6 General Build Notes
6.1 An overview of the dependencies required for building . . . . . . . . . . . . . . . . . .
43
43
7 Building under windows using msys
7.1 MSYS: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.2 Qt4.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.3 Flex and Bison . . . . . . . . . . . . . . . . . . . . . . . . .
7.4 Python stuff: (optional) . . . . . . . . . . . . . . . . . . . . .
7.4.1 Download and install Python - use Windows installer
7.4.2 Download SIP and PyQt4 sources . . . . . . . . . .
7.4.3 Compile SIP . . . . . . . . . . . . . . . . . . . . . .
7.4.4 Compile PyQt . . . . . . . . . . . . . . . . . . . . . .
44
44
44
45
45
45
45
46
46
QGIS 1.3 Installation and Coding Guide
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
iii