QGIS API Documentation 3.39.0-Master (47f7b3a4989)
Loading...
Searching...
No Matches
qgsattributeactiondialog.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsattributeactiondialog.cpp - attribute action dialog
3 -------------------
4
5This class creates and manages the Action tab of the Vector Layer
6Properties dialog box. Changes made in the dialog box are propagated
7back to QgsVectorLayer.
8
9 begin : October 2004
10 copyright : (C) 2004 by Gavin Macaulay
11 email : gavin at macaulay dot co dot nz
12 ***************************************************************************/
13
14/***************************************************************************
15 * *
16 * This program is free software; you can redistribute it and/or modify *
17 * it under the terms of the GNU General Public License as published by *
18 * the Free Software Foundation; either version 2 of the License, or *
19 * (at your option) any later version. *
20 * *
21 ***************************************************************************/
22
24#include "qgsactionmanager.h"
25#include "qgsvectorlayer.h"
26#include "qgsaction.h"
28
29#include <QFileDialog>
30#include <QHeaderView>
31#include <QMessageBox>
32#include <QSettings>
33#include <QImageWriter>
34#include <QTableWidget>
35
37 : QWidget( parent )
38 , mLayer( actions.layer() )
39{
40 setupUi( this );
41 QHeaderView *header = mAttributeActionTable->horizontalHeader();
42 header->setHighlightSections( false );
43 header->setStretchLastSection( true );
44 mAttributeActionTable->setColumnWidth( 0, 100 );
45 mAttributeActionTable->setColumnWidth( 1, 230 );
46 mAttributeActionTable->setCornerButtonEnabled( false );
47 mAttributeActionTable->setEditTriggers( QAbstractItemView::AnyKeyPressed | QAbstractItemView::SelectedClicked );
48
49 connect( mAttributeActionTable, &QTableWidget::itemDoubleClicked, this, &QgsAttributeActionDialog::itemDoubleClicked );
50 connect( mAttributeActionTable, &QTableWidget::itemSelectionChanged, this, &QgsAttributeActionDialog::updateButtons );
51 connect( mMoveUpButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::moveUp );
52 connect( mMoveDownButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::moveDown );
53 connect( mRemoveButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::remove );
54 connect( mAddButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::insert );
55 connect( mDuplicateButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::duplicate );
56 connect( mAddDefaultActionsButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::addDefaultActions );
57
58 init( actions, mLayer->attributeTableConfig() );
59}
60
61void QgsAttributeActionDialog::init( const QgsActionManager &actions, const QgsAttributeTableConfig &attributeTableConfig )
62{
63 // Start from a fresh slate.
64 mAttributeActionTable->setRowCount( 0 );
65
66 int i = 0;
67 // Populate with our actions.
68 const auto constActions = actions.actions();
69 for ( const QgsAction &action : constActions )
70 {
71 insertRow( i++, action );
72 }
73
74 updateButtons();
75
77 visibleActionWidgetConfig.type = QgsAttributeTableConfig::Action;
78 visibleActionWidgetConfig.hidden = false;
79
80 mShowInAttributeTable->setChecked( attributeTableConfig.actionWidgetVisible() );
81 mAttributeTableWidgetType->setCurrentIndex( attributeTableConfig.actionWidgetStyle() );
82}
83
84QList<QgsAction> QgsAttributeActionDialog::actions() const
85{
86 QList<QgsAction> actions;
87
88 for ( int i = 0; i < mAttributeActionTable->rowCount(); ++i )
89 {
90 actions.append( rowToAction( i ) );
91 }
92
93 return actions;
94}
95
97{
98 return mShowInAttributeTable->isChecked();
99}
100
105
106void QgsAttributeActionDialog::insertRow( int row, const QgsAction &action )
107{
108 QTableWidgetItem *item = nullptr;
109 mAttributeActionTable->insertRow( row );
110
111 // Type
112 item = new QTableWidgetItem( textForType( action.type() ) );
113 item->setData( Role::ActionType, static_cast< int >( action.type() ) );
114 item->setData( Role::ActionId, action.id() );
115 item->setFlags( item->flags() & ~Qt::ItemIsEditable );
116 mAttributeActionTable->setItem( row, Type, item );
117
118 // Description
119 mAttributeActionTable->setItem( row, Description, new QTableWidgetItem( action.name() ) );
120
121 // Short Title
122 mAttributeActionTable->setItem( row, ShortTitle, new QTableWidgetItem( action.shortTitle() ) );
123
124 // Action text
125 item = new QTableWidgetItem( action.command().length() > 30 ? action.command().left( 27 ) + "…" : action.command() );
126 item->setData( Qt::UserRole, action.command() );
127 mAttributeActionTable->setItem( row, ActionText, item );
128
129 // Capture output
130 item = new QTableWidgetItem();
131 item->setFlags( item->flags() & ~( Qt::ItemIsEditable ) );
132 item->setCheckState( action.capture() ? Qt::Checked : Qt::Unchecked );
133 mAttributeActionTable->setItem( row, Capture, item );
134
135 // Scopes
136 item = new QTableWidgetItem();
137 item->setFlags( item->flags() & ~( Qt::ItemIsEditable ) );
138 QStringList actionScopes = qgis::setToList( action.actionScopes() );
139 std::sort( actionScopes.begin(), actionScopes.end() );
140 item->setText( actionScopes.join( QLatin1String( ", " ) ) );
141 item->setData( Qt::UserRole, QVariant::fromValue<QSet<QString>>( action.actionScopes() ) );
142 mAttributeActionTable->setItem( row, ActionScopes, item );
143
144 // Icon
145 const QIcon icon = action.icon();
146 QTableWidgetItem *headerItem = new QTableWidgetItem( icon, QString() );
147 headerItem->setData( Qt::UserRole, action.iconPath() );
148 mAttributeActionTable->setVerticalHeaderItem( row, headerItem );
149
150 // Notification message
151 mAttributeActionTable->setItem( row, NotificationMessage, new QTableWidgetItem( action.notificationMessage() ) );
152
153 // EnabledOnlyWhenEditable
154 item = new QTableWidgetItem();
155 item->setFlags( item->flags() & ~( Qt::ItemIsEditable ) );
156 item->setCheckState( action.isEnabledOnlyWhenEditable() ? Qt::Checked : Qt::Unchecked );
157 mAttributeActionTable->setItem( row, EnabledOnlyWhenEditable, item );
158
159 updateButtons();
160}
161
162void QgsAttributeActionDialog::insertRow( int row, Qgis::AttributeActionType type, const QString &name, const QString &actionText, const QString &iconPath, bool capture, const QString &shortTitle, const QSet<QString> &actionScopes, const QString &notificationMessage, bool isEnabledOnlyWhenEditable )
163{
164 if ( uniqueName( name ) == name )
165 insertRow( row, QgsAction( type, name, actionText, iconPath, capture, shortTitle, actionScopes, notificationMessage, isEnabledOnlyWhenEditable ) );
166}
167
168void QgsAttributeActionDialog::moveUp()
169{
170 // Swap the selected row with the one above
171
172 int row1 = -1, row2 = -1;
173 QList<QTableWidgetItem *> selection = mAttributeActionTable->selectedItems();
174 if ( !selection.isEmpty() )
175 {
176 row1 = selection.first()->row();
177 }
178
179 if ( row1 > 0 )
180 row2 = row1 - 1;
181
182 if ( row1 != -1 && row2 != -1 )
183 {
184 swapRows( row1, row2 );
185 // Move the selection to follow
186 mAttributeActionTable->selectRow( row2 );
187 }
188}
189
190void QgsAttributeActionDialog::moveDown()
191{
192 // Swap the selected row with the one below
193 int row1 = -1, row2 = -1;
194 QList<QTableWidgetItem *> selection = mAttributeActionTable->selectedItems();
195 if ( !selection.isEmpty() )
196 {
197 row1 = selection.first()->row();
198 }
199
200 if ( row1 < mAttributeActionTable->rowCount() - 1 )
201 row2 = row1 + 1;
202
203 if ( row1 != -1 && row2 != -1 )
204 {
205 swapRows( row1, row2 );
206 // Move the selection to follow
207 mAttributeActionTable->selectRow( row2 );
208 }
209}
210
211void QgsAttributeActionDialog::swapRows( int row1, int row2 )
212{
213 const int colCount = mAttributeActionTable->columnCount();
214 for ( int col = 0; col < colCount; col++ )
215 {
216 QTableWidgetItem *item = mAttributeActionTable->takeItem( row1, col );
217 mAttributeActionTable->setItem( row1, col, mAttributeActionTable->takeItem( row2, col ) );
218 mAttributeActionTable->setItem( row2, col, item );
219 }
220 QTableWidgetItem *header = mAttributeActionTable->takeVerticalHeaderItem( row1 );
221 mAttributeActionTable->setVerticalHeaderItem( row1, mAttributeActionTable->takeVerticalHeaderItem( row2 ) );
222 mAttributeActionTable->setVerticalHeaderItem( row2, header );
223}
224
225QgsAction QgsAttributeActionDialog::rowToAction( int row ) const
226{
227 const QUuid id { mAttributeActionTable->item( row, Type )->data( Role::ActionId ).toUuid() };
228 QgsAction action( id,
229 static_cast<Qgis::AttributeActionType>( mAttributeActionTable->item( row, Type )->data( Role::ActionType ).toInt() ),
230 mAttributeActionTable->item( row, Description )->text(),
231 mAttributeActionTable->item( row, ActionText )->data( Qt::UserRole ).toString(),
232 mAttributeActionTable->verticalHeaderItem( row )->data( Qt::UserRole ).toString(),
233 mAttributeActionTable->item( row, Capture )->checkState() == Qt::Checked,
234 mAttributeActionTable->item( row, ShortTitle )->text(),
235 mAttributeActionTable->item( row, ActionScopes )->data( Qt::UserRole ).value<QSet<QString>>(),
236 mAttributeActionTable->item( row, NotificationMessage )->text(),
237 mAttributeActionTable->item( row, EnabledOnlyWhenEditable )->checkState() == Qt::Checked
238 );
239 return action;
240}
241
242QString QgsAttributeActionDialog::textForType( Qgis::AttributeActionType type )
243{
244 switch ( type )
245 {
247 return tr( "Generic" );
249 return tr( "Python" );
251 return tr( "macOS" );
253 return tr( "Windows" );
255 return tr( "Unix" );
257 return tr( "Open URL" );
259 return tr( "Submit URL (urlencoded or JSON)" );
261 return tr( "Submit URL (multipart)" );
262 }
263 return QString();
264}
265
266void QgsAttributeActionDialog::remove()
267{
268 QList<QTableWidgetItem *> selection = mAttributeActionTable->selectedItems();
269 if ( !selection.isEmpty() )
270 {
271 // Remove the selected row.
272 int row = selection.first()->row();
273 mAttributeActionTable->removeRow( row );
274
275 // And select the row below the one that was selected or the last one.
276 if ( row >= mAttributeActionTable->rowCount() )
277 row = mAttributeActionTable->rowCount() - 1;
278 mAttributeActionTable->selectRow( row );
279
280 updateButtons();
281 }
282}
283
284void QgsAttributeActionDialog::insert()
285{
286 // Add the action details as a new row in the table.
287 const int pos = mAttributeActionTable->rowCount();
288
289 QgsAttributeActionPropertiesDialog dlg( mLayer, this );
290 dlg.setWindowTitle( tr( "Add New Action" ) );
291
292 if ( dlg.exec() )
293 {
294 const QString name = uniqueName( dlg.description() );
295
296 insertRow( pos, dlg.type(), name, dlg.actionText(), dlg.iconPath(), dlg.capture(), dlg.shortTitle(), dlg.actionScopes(), dlg.notificationMessage(), dlg.isEnabledOnlyWhenEditable() );
297 }
298}
299
300void QgsAttributeActionDialog::duplicate()
301{
302 // Add the action details as a new row in the table.
303 const int pos = mAttributeActionTable->rowCount();
304 const int row = mAttributeActionTable->currentRow();
305
307 static_cast<Qgis::AttributeActionType>( mAttributeActionTable->item( row, Type )->data( Role::ActionType ).toInt() ),
308 mAttributeActionTable->item( row, Description )->text(),
309 mAttributeActionTable->item( row, ShortTitle )->text(),
310 mAttributeActionTable->verticalHeaderItem( row )->data( Qt::UserRole ).toString(),
311 mAttributeActionTable->item( row, ActionText )->data( Qt::UserRole ).toString(),
312 mAttributeActionTable->item( row, Capture )->checkState() == Qt::Checked,
313 mAttributeActionTable->item( row, ActionScopes )->data( Qt::UserRole ).value<QSet<QString>>(),
314 mAttributeActionTable->item( row, NotificationMessage )->text(),
315 mAttributeActionTable->item( row, EnabledOnlyWhenEditable )->checkState() == Qt::Checked,
316 mLayer
317 );
318
319 dlg.setWindowTitle( tr( "Duplicate Action" ) );
320
321 if ( dlg.exec() )
322 {
323 const QString name = uniqueName( dlg.description() );
324
325 insertRow( pos, dlg.type(), name, dlg.actionText(), dlg.iconPath(), dlg.capture(), dlg.shortTitle(), dlg.actionScopes(), dlg.notificationMessage(), dlg.isEnabledOnlyWhenEditable() );
326 }
327}
328
329void QgsAttributeActionDialog::updateButtons()
330{
331 QList<QTableWidgetItem *> selection = mAttributeActionTable->selectedItems();
332 const bool hasSelection = !selection.isEmpty();
333
334 if ( hasSelection )
335 {
336 const int row = selection.first()->row();
337 mMoveUpButton->setEnabled( row >= 1 );
338 mMoveDownButton->setEnabled( row >= 0 && row < mAttributeActionTable->rowCount() - 1 );
339 }
340 else
341 {
342 mMoveUpButton->setEnabled( false );
343 mMoveDownButton->setEnabled( false );
344 }
345
346 mRemoveButton->setEnabled( hasSelection );
347 mDuplicateButton->setEnabled( hasSelection );
348}
349
350void QgsAttributeActionDialog::addDefaultActions()
351{
352 int pos = 0;
353 insertRow( pos++, Qgis::AttributeActionType::Generic, tr( "Echo attribute's value" ), QStringLiteral( "echo \"[% @field_value %]\"" ), QString(), true, tr( "Attribute Value" ), QSet<QString>() << QStringLiteral( "Field" ), QString() );
354 insertRow( pos++, Qgis::AttributeActionType::Generic, tr( "Run an application" ), QStringLiteral( "ogr2ogr -f \"GPKG\" \"[% \"OUTPUT_PATH\" %]\" \"[% \"INPUT_FILE\" %]\"" ), QString(), true, tr( "Run application" ), QSet<QString>() << QStringLiteral( "Feature" ) << QStringLiteral( "Canvas" ), QString() );
355 insertRow( pos++, Qgis::AttributeActionType::GenericPython, tr( "Display the feature id in the message bar" ), QStringLiteral( "from qgis.utils import iface\n\niface.messageBar().pushInfo(\"Feature id\", \"The feature id is [% $id %]\")" ), QString(), false, tr( "Feature ID" ), QSet<QString>() << QStringLiteral( "Feature" ) << QStringLiteral( "Canvas" ), QString() );
356 insertRow( pos++, Qgis::AttributeActionType::GenericPython, tr( "Selected field's value (Identify features tool)" ), QStringLiteral( "from qgis.PyQt import QtWidgets\n\nQtWidgets.QMessageBox.information(None, \"Current field's value\", \"[% @field_name %] = [% @field_value %]\")" ), QString(), false, tr( "Field Value" ), QSet<QString>() << QStringLiteral( "Field" ), QString() );
357 insertRow( pos++, Qgis::AttributeActionType::GenericPython, tr( "Clicked coordinates (Run feature actions tool)" ), QStringLiteral( "from qgis.PyQt import QtWidgets\n\nQtWidgets.QMessageBox.information(None, \"Clicked coords\", \"layer: [% @layer_id %]\\ncoords: ([% @click_x %],[% @click_y %])\")" ), QString(), false, tr( "Clicked Coordinate" ), QSet<QString>() << QStringLiteral( "Canvas" ), QString() );
358 insertRow( pos++, Qgis::AttributeActionType::OpenUrl, tr( "Open file" ), QStringLiteral( "[% \"PATH\" %]" ), QString(), false, tr( "Open file" ), QSet<QString>() << QStringLiteral( "Feature" ) << QStringLiteral( "Canvas" ), QString() );
359 insertRow( pos++, Qgis::AttributeActionType::OpenUrl, tr( "Search on web based on attribute's value" ), QStringLiteral( "https://www.google.com/search?q=[% @field_value %]" ), QString(), false, tr( "Search Web" ), QSet<QString>() << QStringLiteral( "Field" ), QString() );
360 insertRow( pos++, Qgis::AttributeActionType::GenericPython, tr( "List feature ids" ), QStringLiteral( "from qgis.PyQt import QtWidgets\n\nlayer = QgsProject.instance().mapLayer('[% @layer_id %]')\nif layer.selectedFeatureCount():\n ids = layer.selectedFeatureIds()\nelse:\n ids = [f.id() for f in layer.getFeatures()]\n\nQtWidgets.QMessageBox.information(None, \"Feature ids\", ', '.join([str(id) for id in ids]))" ), QString(), false, tr( "List feature ids" ), QSet<QString>() << QStringLiteral( "Layer" ), QString() );
361 insertRow( pos++, Qgis::AttributeActionType::GenericPython, tr( "Duplicate selected features" ), QStringLiteral( "project = QgsProject.instance()\nlayer = QgsProject.instance().mapLayer('[% @layer_id %]')\nif not layer.isEditable():\n qgis.utils.iface.messageBar().pushMessage( 'Cannot duplicate feature in not editable mode on layer {layer}'.format( layer=layer.name() ) )\nelse:\n features=[]\n if len('[% $id %]')>0:\n features.append( layer.getFeature( [% $id %] ) )\n else:\n for x in layer.selectedFeatures():\n features.append( x )\n feature_count=0\n children_info=''\n featureids=[]\n for f in features:\n result=QgsVectorLayerUtils.duplicateFeature(layer, f, project, 0 )\n featureids.append( result[0].id() )\n feature_count+=1\n for ch_layer in result[1].layers():\n children_info+='{number_of_children} children on layer {children_layer}\\n'.format( number_of_children=str( len( result[1].duplicatedFeatures(ch_layer) ) ), children_layer=ch_layer.name() )\n ch_layer.selectByIds( result[1].duplicatedFeatures(ch_layer) )\n layer.selectByIds( featureids )\n qgis.utils.iface.messageBar().pushMessage( '{number_of_features} features on layer {layer} duplicated with\\n{children_info}'.format( number_of_features=str( feature_count ), layer=layer.name(), children_info=children_info ) )" ), QString(), false, tr( "Duplicate selected" ), QSet<QString>() << QStringLiteral( "Layer" ), QString(), true );
362
363}
364
365void QgsAttributeActionDialog::itemDoubleClicked( QTableWidgetItem *item )
366{
367 const int row = item->row();
368
369 QgsAttributeActionPropertiesDialog actionProperties(
370 static_cast<Qgis::AttributeActionType>( mAttributeActionTable->item( row, Type )->data( Role::ActionType ).toInt() ),
371 mAttributeActionTable->item( row, Description )->text(),
372 mAttributeActionTable->item( row, ShortTitle )->text(),
373 mAttributeActionTable->verticalHeaderItem( row )->data( Qt::UserRole ).toString(),
374 mAttributeActionTable->item( row, ActionText )->data( Qt::UserRole ).toString(),
375 mAttributeActionTable->item( row, Capture )->checkState() == Qt::Checked,
376 mAttributeActionTable->item( row, ActionScopes )->data( Qt::UserRole ).value<QSet<QString>>(),
377 mAttributeActionTable->item( row, NotificationMessage )->text(),
378 mAttributeActionTable->item( row, EnabledOnlyWhenEditable )->checkState() == Qt::Checked,
379 mLayer
380 );
381
382 actionProperties.setWindowTitle( tr( "Edit Action" ) );
383
384 if ( actionProperties.exec() )
385 {
386 mAttributeActionTable->item( row, Type )->setData( Role::ActionType, static_cast< int >( actionProperties.type() ) );
387 mAttributeActionTable->item( row, Type )->setText( textForType( actionProperties.type() ) );
388 mAttributeActionTable->item( row, Description )->setText( actionProperties.description() );
389 mAttributeActionTable->item( row, ShortTitle )->setText( actionProperties.shortTitle() );
390 mAttributeActionTable->item( row, ActionText )->setText( actionProperties.actionText().length() > 30 ? actionProperties.actionText().left( 27 ) + "…" : actionProperties.actionText() );
391 mAttributeActionTable->item( row, ActionText )->setData( Qt::UserRole, actionProperties.actionText() );
392 mAttributeActionTable->item( row, Capture )->setCheckState( actionProperties.capture() ? Qt::Checked : Qt::Unchecked );
393 mAttributeActionTable->item( row, NotificationMessage )->setText( actionProperties.notificationMessage() );
394 mAttributeActionTable->item( row, EnabledOnlyWhenEditable )->setCheckState( actionProperties.isEnabledOnlyWhenEditable() ? Qt::Checked : Qt::Unchecked );
395
396 QTableWidgetItem *item = mAttributeActionTable->item( row, ActionScopes );
397 QStringList actionScopes = qgis::setToList( actionProperties.actionScopes() );
398 std::sort( actionScopes.begin(), actionScopes.end() );
399 item->setText( actionScopes.join( QLatin1String( ", " ) ) );
400 item->setData( Qt::UserRole, QVariant::fromValue<QSet<QString>>( actionProperties.actionScopes() ) );
401
402 mAttributeActionTable->verticalHeaderItem( row )->setData( Qt::UserRole, actionProperties.iconPath() );
403 mAttributeActionTable->verticalHeaderItem( row )->setIcon( QIcon( actionProperties.iconPath() ) );
404 }
405}
406
407QString QgsAttributeActionDialog::uniqueName( QString name )
408{
409 // Make sure that the given name is unique, adding a numerical
410 // suffix if necessary.
411
412 const int pos = mAttributeActionTable->rowCount();
413 bool unique = true;
414
415 for ( int i = 0; i < pos; ++i )
416 {
417 if ( mAttributeActionTable->item( i, Description )->text() == name )
418 unique = false;
419 }
420
421 if ( !unique )
422 {
423 int suffix_num = 1;
424 QString new_name;
425 while ( !unique )
426 {
427 const QString suffix = QString::number( suffix_num );
428 new_name = name + '_' + suffix;
429 unique = true;
430 for ( int i = 0; i < pos; ++i )
431 if ( mAttributeActionTable->item( i, 0 )->text() == new_name )
432 unique = false;
433 ++suffix_num;
434 }
435 name = new_name;
436 }
437 return name;
438}
AttributeActionType
Attribute action types.
Definition qgis.h:4047
@ Mac
MacOS specific.
@ OpenUrl
Open URL action.
@ SubmitUrlMultipart
POST data to an URL using "multipart/form-data".
@ Windows
Windows specific.
@ SubmitUrlEncoded
POST data to an URL, using "application/x-www-form-urlencoded" or "application/json" if the body is v...
Storage and management of actions associated with a layer.
Utility class that encapsulates an action based on vector attributes.
Definition qgsaction.h:37
QString notificationMessage() const
Returns the notification message that triggers the action.
Definition qgsaction.h:153
QString name() const
The name of the action. This may be a longer description.
Definition qgsaction.h:118
QSet< QString > actionScopes() const
The action scopes define where an action will be available.
Qgis::AttributeActionType type() const
The action type.
Definition qgsaction.h:156
QIcon icon() const
The icon.
Definition qgsaction.h:139
QString iconPath() const
The path to the icon.
Definition qgsaction.h:136
QString command() const
Returns the command that is executed by this action.
Definition qgsaction.h:147
QString shortTitle() const
The short title is used to label user interface elements like buttons.
Definition qgsaction.h:121
bool isEnabledOnlyWhenEditable() const
Returns whether only enabled in editable mode.
Definition qgsaction.h:163
bool capture() const
Whether to capture output for display when this action is run.
Definition qgsaction.h:159
QUuid id() const
Returns a unique id for this action.
Definition qgsaction.h:127
void init(const QgsActionManager &action, const QgsAttributeTableConfig &attributeTableConfig)
QgsAttributeActionDialog(const QgsActionManager &actions, QWidget *parent=nullptr)
QList< QgsAction > actions() const
QgsAttributeTableConfig::ActionWidgetStyle attributeTableWidgetStyle() const
This is a container for configuration of the attribute table.
@ Action
This column represents an action widget.
ActionWidgetStyle
The style of the action widget in the attribute table.
bool actionWidgetVisible() const
Returns true if the action widget is visible.
ActionWidgetStyle actionWidgetStyle() const
Gets the style of the action widget.
QgsAttributeTableConfig attributeTableConfig() const
Returns the attribute table configuration object.
Defines the configuration of a column in the attribute table.
QgsAttributeTableConfig::Type type
The type of this column.
bool hidden
Flag that controls if the column is hidden.