QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgstransactiongroup.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgstransactiongroup.h - QgsTransactionGroup
3
4
---------------------
5
begin : 15.1.2016
6
copyright : (C) 2016 by Matthias Kuhn
7
email : mmatthias@opengis.ch
8
***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
#ifndef QGSTRANSACTIONGROUP_H
17
#define QGSTRANSACTIONGROUP_H
18
19
#include <memory>
20
21
#include "qgis_core.h"
22
#include "
qgstransaction.h
"
23
24
#include <QObject>
25
#include <QSet>
26
27
class
QgsVectorLayer
;
28
34
class
CORE_EXPORT
QgsTransactionGroup
:
public
QObject
35
{
36
Q_OBJECT
37
public
:
39
explicit
QgsTransactionGroup
( QObject *parent =
nullptr
);
40
46
bool
addLayer
(
QgsVectorLayer
*layer );
47
53
QSet<QgsVectorLayer *>
layers
()
const
;
54
58
bool
modified
()
const
;
59
64
QString
connString
()
const
;
65
70
QString
providerKey
()
const
;
71
75
bool
isEmpty
()
const
;
76
77
signals:
78
82
void
commitError
(
const
QString &msg );
83
84
private
slots:
85
void
onEditingStarted();
86
void
onLayerDeleted();
87
void
onBeforeCommitChanges(
bool
stopEditing );
88
void
onRollback();
89
90
private
:
91
bool
mEditingStopping =
false
;
92
93
void
disableTransaction();
94
95
void
restartTransaction(
const
QgsVectorLayer
*layer );
96
97
QSet<QgsVectorLayer *> mLayers;
99
std::unique_ptr<QgsTransaction> mTransaction;
101
QString mConnString;
102
QString mProviderKey;
103
};
104
105
#endif
// QGSTRANSACTIONGROUP_H
QgsTransactionGroup::connString
QString connString() const
Returns the connection string used by this transaction group.
Definition
qgstransactiongroup.cpp:206
QgsTransactionGroup::modified
bool modified() const
Returns true if any of the layers in this group reports a modification.
Definition
qgstransactiongroup.cpp:64
QgsTransactionGroup::QgsTransactionGroup
QgsTransactionGroup(QObject *parent=nullptr)
Constructor for QgsTransactionGroup.
Definition
qgstransactiongroup.cpp:31
QgsTransactionGroup::isEmpty
bool isEmpty() const
Returns true if there are no layers in this transaction group.
Definition
qgstransactiongroup.cpp:201
QgsTransactionGroup::commitError
void commitError(const QString &msg)
Will be emitted whenever there is a commit error.
QgsTransactionGroup::providerKey
QString providerKey() const
Returns the provider key used by this transaction group.
Definition
qgstransactiongroup.cpp:196
QgsTransactionGroup::addLayer
bool addLayer(QgsVectorLayer *layer)
Add a layer to this transaction group.
Definition
qgstransactiongroup.cpp:35
QgsTransactionGroup::layers
QSet< QgsVectorLayer * > layers() const
Gets the set of layers currently managed by this transaction group.
Definition
qgstransactiongroup.cpp:59
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgstransaction.h
Generated on
for QGIS API Documentation by
1.17.0