In QGIS 1.8 and 1.9 I used a plugin called Easy Labels to develop leader lines that would be saved as a memory layer. I have not been able to replicate this with QGIS 2.0, I can't even find the Easy Label Plugin. Assuming it is no longer valid in QGIS 2.
Question:
How can I create a leader from a label moved outside a polygon to the centroid of the polygon?
Best Answer
As a quick morning exercise I hacked a QGIS Python script together, creating lines in a memorylayer from a polygon centroid to a custom moved data binded label.
You need an x and y column in your table to have label coordinates stored. Also setup the data defined label x and y coordinates in labels properties.
Drag the label where you want it, with the label move tool:
Copy the Python code below to a file called Labellines.py to you Python folder. On windows that would be C:\Users\USERNAME\ .qgis2\python.
Update line 35 and 65 with your own settings.
Run it from the QGIS Python Console:
This is nothing compaired to the Easy Labels plugin, but did give me this map of some Copenhagen municipalities.
Line 35 - The polygon layer you want to label:
vlayer = QgsVectorLayer("D:\data\Kommuner2006\Kommuner2006.shp","Kommuner", "ogr")
Line 64 - The epsg code of your polygon layer:
"crs=epsg:25832&" +