def __init__(self, iface):
     # Save reference to the QGIS interface
     self.iface = iface
     # create the map tool to draw a line
     self.lineDrawer = LineDrawer(self.iface.mapCanvas())
     QObject.connect(self.lineDrawer, SIGNAL("editingFinished()"),
                     self.splitSelectedFeatures)
    def initGui(self):
        # Create action that will start plugin configuration
        self.action = QAction(QIcon(":/plugins/split_features_example5_solution/icon.png"), \
            "Split features", self.iface.mainWindow())
        # connect the action to the run method
        QObject.connect(self.action, SIGNAL("triggered()"), self.run)

        # Add toolbar button and menu item
        self.iface.addToolBarIcon(self.action)
        self.iface.addPluginToMenu("QGis Workshop", self.action)

        # create the map tool to draw a line
        self.lineDrawer = LineDrawer(self.iface.mapCanvas())
        QObject.connect(self.lineDrawer, SIGNAL("editingFinished()"),
                        self.splitSelectedFeatures)