@@ -55,47 +55,64 @@ class CORE_EXPORT QgsTransaction : public QObject
55
55
56
56
public:
57
57
58
- // ! QgsTransaction cannot be copied.
59
- QgsTransaction ( const QgsTransaction &other ) = delete ;
60
- // ! QgsTransaction cannot be copied.
61
- const QgsTransaction &operator =( const QgsTransaction &other ) = delete ;
62
-
63
- // ! Creates a transaction for the specified connection string and provider
58
+ /* *
59
+ * Create a transaction for the specified connection string \a connString
60
+ * and provider with \a providerKey.
61
+ */
64
62
static QgsTransaction *create ( const QString &connString, const QString &providerKey ) SIP_FACTORY;
65
63
66
- /* * Creates a transaction which includes the specified layers. Connection string
67
- * and data provider are taken from the first layer */
64
+ /* *
65
+ * Create a transaction which includes the layers specified with
66
+ * \a layerIds.
67
+ * All layers are expected to have the same connection string and data
68
+ * provider.
69
+ */
68
70
static QgsTransaction *create ( const QStringList &layerIds ) SIP_FACTORY;
69
71
70
72
virtual ~QgsTransaction ();
71
73
72
- // ! Add layer to the transaction. The layer must not be in edit mode.
74
+ /* *
75
+ * Add the layer with \a layerId to the transaction. The layer must not be
76
+ * in edit mode and the connection string must match.
77
+ */
73
78
bool addLayer ( const QString &layerId );
74
79
75
- // ! Add layer to the transaction. The layer must not be in edit mode.
80
+ /* *
81
+ * Add the \a layer to the transaction. The layer must not be
82
+ * in edit mode and the connection string must match.
83
+ */
76
84
bool addLayer ( QgsVectorLayer *layer );
77
85
78
- /* * Begin transaction
79
- * The statement timeout, in seconds, specifies how long an sql statement
80
- * is allowed to block QGIS before it is aborted. Statements can block,
81
- * depending on the provider, if multiple transactions are active and a
82
- * statement would produce a conflicting state. In these cases, the
83
- * statements block until the conflicting transaction is committed or
84
- * rolled back.
85
- * Some providers might not honour the statement timeout. */
86
+ /* *
87
+ * Begin transaction
88
+ * The \a statementTimeout (in seconds) specifies how long an sql statement
89
+ * is allowed to block QGIS before it is aborted.
90
+ * Statements can block, if multiple transactions are active and a
91
+ * statement would produce a conflicting state. In these cases, the
92
+ * statements block until the conflicting transaction is committed or
93
+ * rolled back.
94
+ * Some providers might not honour the statement timeout.
95
+ */
86
96
bool begin ( QString &errorMsg SIP_OUT, int statementTimeout = 20 );
87
97
88
- // ! Commit transaction.
98
+ /* *
99
+ * Commit transaction.
100
+ */
89
101
bool commit ( QString &errorMsg SIP_OUT );
90
102
91
- // ! Roll back transaction.
103
+ /* *
104
+ * Roll back transaction.
105
+ */
92
106
bool rollback ( QString &errorMsg SIP_OUT );
93
107
94
- // ! Executes sql
108
+ /* *
109
+ * Execute the \a sql string. The result must not be a tuple, so running a
110
+ * ``SELECT`` query will return an error.
111
+ */
95
112
virtual bool executeSql ( const QString &sql, QString &error SIP_OUT ) = 0;
96
113
97
114
/* *
98
- * Checks if a the provider of a give layer supports transactions.
115
+ * Checks if a the provider of a given \a layer supports transactions.
99
116
*/
100
117
static bool supportsTransaction ( const QgsVectorLayer *layer );
101
118
0 commit comments