Example #1
0
    def startTransaction(self):
        """
        Start a new transaction and set all layers into transaction mode.

        :return: None
        """
        self.transaction = QgsTransaction.create(self.layers)
        self.transaction.begin()
        for layer in self.layers:
            layer.startEditing()
Example #2
0
    def startTransaction(self):
        """
        Start a new transaction and set all layers into transaction mode.

        :return: None
        """
        lyrs = [self.vl_a, self.vl_b]

        self.transaction = QgsTransaction.create(lyrs)
        self.transaction.begin()
        for l in lyrs:
            l.startEditing()
    def startTransaction(self):
        """
        Start a new transaction and set all layers into transaction mode.

        :return: None
        """
        lyrs = [self.vl_a, self.vl_b]

        self.transaction = QgsTransaction.create(lyrs)
        self.transaction.begin()
        for l in lyrs:
            l.startEditing()
Example #4
0
    def beginTransaction(self):
            layers = list()
            for l in QgsMapLayerRegistry.instance().mapLayers().values():
                if l.type() != QgsMapLayer.VectorLayer:
                    continue
                if not self.transaction:
                    self.transaction = QgsTransaction.create([l.id()])
                    if self.transaction:
                        layers.append(l)
                else:
                    if self.transaction.addLayer(l.id()):
                        layers.append(l)

            if self.transaction:
                self.transaction.begin()

                for l in layers:
                    l.startEditing()

                self.toggleEditSession.setIcon(QIcon(':commit-end.svg'))