Graphics Reference
In-Depth Information
Notice how the virtual keyword is followed by QgsVectorLayer* instead of
void . This is the return value for this method; it returns a QgsVector object.
Note
Technically speaking, * means that the method returns a pointer to an object of type Qg-
sVectorLayer . Fortunately, Python wrappers automatically handle pointers, so you
don't need to worry about this.
Notice the brief description at the bottom of the documentation for this method; while
many of the C++ methods have very little, if any, additional information, other methods
have more extensive information. Obviously, you should read these descriptions carefully
as they tell you more about what the method does.
Even without any description, the C++ documentation is still useful as it tells you what
the method is called, what parameters it accepts, and what type of data is being returned.
In the preceding method, you can see that there are three parameters listed in between the
parentheses. As C++ is a strongly typed language, you have to define the type of each
parameter when you define a function. This is helpful for Python programmers as it tells
you what type of value to supply. Apart from QGIS objects, you might also encounter the
following data types in the C++ documentation:
Data type
Description
int
A standard Python integer value
Search WWH ::




Custom Search