QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
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
25#include "qgsaction.h"
26#include "qgsactionmanager.h"
28#include "qgsvectorlayer.h"
29
30#include <QFileDialog>
31#include <QHeaderView>
32#include <QImageWriter>
33#include <QMessageBox>
34#include <QSettings>
35#include <QString>
36#include <QTableWidget>
37
38#include "moc_qgsattributeactiondialog.cpp"
39
40using namespace Qt::StringLiterals;
41
43 : QWidget( parent )
44 , mLayer( actions.layer() )
45{
46 setupUi( this );
47 QHeaderView *header = mAttributeActionTable->horizontalHeader();
48 header->setHighlightSections( false );
49 header->setStretchLastSection( true );
50 mAttributeActionTable->setColumnWidth( 0, 100 );
51 mAttributeActionTable->setColumnWidth( 1, 230 );
52 mAttributeActionTable->setCornerButtonEnabled( false );
53 mAttributeActionTable->setEditTriggers( QAbstractItemView::AnyKeyPressed | QAbstractItemView::SelectedClicked );
54
55 connect( mAttributeActionTable, &QTableWidget::itemDoubleClicked, this, &QgsAttributeActionDialog::itemDoubleClicked );
56 connect( mAttributeActionTable, &QTableWidget::itemSelectionChanged, this, &QgsAttributeActionDialog::updateButtons );
57 connect( mMoveUpButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::moveUp );
58 connect( mMoveDownButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::moveDown );
59 connect( mRemoveButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::remove );
60 connect( mAddButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::insert );
61 connect( mDuplicateButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::duplicate );
62 connect( mAddDefaultActionsButton, &QAbstractButton::clicked, this, &QgsAttributeActionDialog::addDefaultActions );
63
64 init( actions, mLayer->attributeTableConfig() );
65}
66
68{
69 // Start from a fresh slate.
70 mAttributeActionTable->setRowCount( 0 );
71
72 int i = 0;
73 // Populate with our actions.
74 const auto constActions = actions.actions();
75 for ( const QgsAction &action : constActions )
76 {
77 insertRow( i++, action );
78 }
79
80 updateButtons();
81
83 visibleActionWidgetConfig.type = QgsAttributeTableConfig::Action;
84 visibleActionWidgetConfig.hidden = false;
85
86 mShowInAttributeTable->setChecked( attributeTableConfig.actionWidgetVisible() );
87 mAttributeTableWidgetType->setCurrentIndex( attributeTableConfig.actionWidgetStyle() );
88}
89
90QList<QgsAction> QgsAttributeActionDialog::actions() const
91{
92 QList<QgsAction> actions;
93
94 for ( int i = 0; i < mAttributeActionTable->rowCount(); ++i )
95 {
96 actions.append( rowToAction( i ) );
97 }
98
99 return actions;
100}
101
103{
104 return mShowInAttributeTable->isChecked();
105}
106
111
112void QgsAttributeActionDialog::insertRow( int row, const QgsAction &action )
113{
114 QTableWidgetItem *item = nullptr;
115 mAttributeActionTable->insertRow( row );
116
117 // Type
118 item = new QTableWidgetItem( textForType( action.type() ) );
119 item->setData( Role::ActionType, static_cast<int>( action.type() ) );
120 item->setData( Role::ActionId, action.id() );
121 item->setFlags( item->flags() & ~Qt::ItemIsEditable );
122 mAttributeActionTable->setItem( row, Type, item );
123
124 // Description
125 mAttributeActionTable->setItem( row, Description, new QTableWidgetItem( action.name() ) );
126
127 // Short Title
128 mAttributeActionTable->setItem( row, ShortTitle, new QTableWidgetItem( action.shortTitle() ) );
129
130 // Action text
131 item = new QTableWidgetItem( action.command().length() > 30 ? action.command().left( 27 ) + "…" : action.command() );
132 item->setData( Qt::UserRole, action.command() );
133 mAttributeActionTable->setItem( row, ActionText, item );
134
135 // Capture output
136 item = new QTableWidgetItem();
137 item->setFlags( item->flags() & ~( Qt::ItemIsEditable ) );
138 item->setCheckState( action.capture() ? Qt::Checked : Qt::Unchecked );
139 mAttributeActionTable->setItem( row, Capture, item );
140
141 // Scopes
142 item = new QTableWidgetItem();
143 item->setFlags( item->flags() & ~( Qt::ItemIsEditable ) );
144 QStringList actionScopes = qgis::setToList( action.actionScopes() );
145 std::sort( actionScopes.begin(), actionScopes.end() );
146 item->setText( actionScopes.join( ", "_L1 ) );
147 item->setData( Qt::UserRole, QVariant::fromValue<QSet<QString>>( action.actionScopes() ) );
148 mAttributeActionTable->setItem( row, ActionScopes, item );
149
150 // Icon
151 const QIcon icon = action.icon();
152 QTableWidgetItem *headerItem = new QTableWidgetItem( icon, QString() );
153 headerItem->setData( Qt::UserRole, action.iconPath() );
154 mAttributeActionTable->setVerticalHeaderItem( row, headerItem );
155
156 // Notification message
157 mAttributeActionTable->setItem( row, NotificationMessage, new QTableWidgetItem( action.notificationMessage() ) );
158
159 // EnabledOnlyWhenEditable
160 item = new QTableWidgetItem();
161 item->setFlags( item->flags() & ~( Qt::ItemIsEditable ) );
162 item->setCheckState( action.isEnabledOnlyWhenEditable() ? Qt::Checked : Qt::Unchecked );
163 mAttributeActionTable->setItem( row, EnabledOnlyWhenEditable, item );
164
165 updateButtons();
166}
167
168void QgsAttributeActionDialog::insertRow(
169 int row,
171 const QString &name,
172 const QString &actionText,
173 const QString &iconPath,
174 bool capture,
175 const QString &shortTitle,
176 const QSet<QString> &actionScopes,
177 const QString &notificationMessage,
178 bool isEnabledOnlyWhenEditable
179)
180{
181 if ( uniqueName( name ) == name )
182 insertRow( row, QgsAction( type, name, actionText, iconPath, capture, shortTitle, actionScopes, notificationMessage, isEnabledOnlyWhenEditable ) );
183}
184
185void QgsAttributeActionDialog::moveUp()
186{
187 // Swap the selected row with the one above
188
189 int row1 = -1, row2 = -1;
190 QList<QTableWidgetItem *> selection = mAttributeActionTable->selectedItems();
191 if ( !selection.isEmpty() )
192 {
193 row1 = selection.first()->row();
194 }
195
196 if ( row1 > 0 )
197 row2 = row1 - 1;
198
199 if ( row1 != -1 && row2 != -1 )
200 {
201 swapRows( row1, row2 );
202 // Move the selection to follow
203 mAttributeActionTable->selectRow( row2 );
204 }
205}
206
207void QgsAttributeActionDialog::moveDown()
208{
209 // Swap the selected row with the one below
210 int row1 = -1, row2 = -1;
211 QList<QTableWidgetItem *> selection = mAttributeActionTable->selectedItems();
212 if ( !selection.isEmpty() )
213 {
214 row1 = selection.first()->row();
215 }
216
217 if ( row1 < mAttributeActionTable->rowCount() - 1 )
218 row2 = row1 + 1;
219
220 if ( row1 != -1 && row2 != -1 )
221 {
222 swapRows( row1, row2 );
223 // Move the selection to follow
224 mAttributeActionTable->selectRow( row2 );
225 }
226}
227
228void QgsAttributeActionDialog::swapRows( int row1, int row2 )
229{
230 const int colCount = mAttributeActionTable->columnCount();
231 for ( int col = 0; col < colCount; col++ )
232 {
233 QTableWidgetItem *item = mAttributeActionTable->takeItem( row1, col );
234 mAttributeActionTable->setItem( row1, col, mAttributeActionTable->takeItem( row2, col ) );
235 mAttributeActionTable->setItem( row2, col, item );
236 }
237 QTableWidgetItem *header = mAttributeActionTable->takeVerticalHeaderItem( row1 );
238 mAttributeActionTable->setVerticalHeaderItem( row1, mAttributeActionTable->takeVerticalHeaderItem( row2 ) );
239 mAttributeActionTable->setVerticalHeaderItem( row2, header );
240}
241
242QgsAction QgsAttributeActionDialog::rowToAction( int row ) const
243{
244 const QUuid id { mAttributeActionTable->item( row, Type )->data( Role::ActionId ).toUuid() };
245 QgsAction action(
246 id,
247 static_cast<Qgis::AttributeActionType>( mAttributeActionTable->item( row, Type )->data( Role::ActionType ).toInt() ),
248 mAttributeActionTable->item( row, Description )->text(),
249 mAttributeActionTable->item( row, ActionText )->data( Qt::UserRole ).toString(),
250 mAttributeActionTable->verticalHeaderItem( row )->data( Qt::UserRole ).toString(),
251 mAttributeActionTable->item( row, Capture )->checkState() == Qt::Checked,
252 mAttributeActionTable->item( row, ShortTitle )->text(),
253 mAttributeActionTable->item( row, ActionScopes )->data( Qt::UserRole ).value<QSet<QString>>(),
254 mAttributeActionTable->item( row, NotificationMessage )->text(),
255 mAttributeActionTable->item( row, EnabledOnlyWhenEditable )->checkState() == Qt::Checked
256 );
257 return action;
258}
259
260QString QgsAttributeActionDialog::textForType( Qgis::AttributeActionType type )
261{
262 switch ( type )
263 {
265 return tr( "Generic" );
267 return tr( "Python" );
269 return tr( "macOS" );
271 return tr( "Windows" );
273 return tr( "Unix" );
275 return tr( "Open URL" );
277 return tr( "Submit URL (urlencoded or JSON)" );
279 return tr( "Submit URL (multipart)" );
280 }
281 return QString();
282}
283
284void QgsAttributeActionDialog::remove()
285{
286 QList<QTableWidgetItem *> selection = mAttributeActionTable->selectedItems();
287 if ( !selection.isEmpty() )
288 {
289 // Remove the selected row.
290 int row = selection.first()->row();
291 mAttributeActionTable->removeRow( row );
292
293 // And select the row below the one that was selected or the last one.
294 if ( row >= mAttributeActionTable->rowCount() )
295 row = mAttributeActionTable->rowCount() - 1;
296 mAttributeActionTable->selectRow( row );
297
298 updateButtons();
299 }
300}
301
302void QgsAttributeActionDialog::insert()
303{
304 // Add the action details as a new row in the table.
305 const int pos = mAttributeActionTable->rowCount();
306
307 QgsAttributeActionPropertiesDialog dlg( mLayer, this );
308 dlg.setWindowTitle( tr( "Add New Action" ) );
309
310 if ( dlg.exec() )
311 {
312 const QString name = uniqueName( dlg.description() );
313
314 insertRow( pos, dlg.type(), name, dlg.actionText(), dlg.iconPath(), dlg.capture(), dlg.shortTitle(), dlg.actionScopes(), dlg.notificationMessage(), dlg.isEnabledOnlyWhenEditable() );
315 }
316}
317
318void QgsAttributeActionDialog::duplicate()
319{
320 // Add the action details as a new row in the table.
321 const int pos = mAttributeActionTable->rowCount();
322 const int row = mAttributeActionTable->currentRow();
323
324 QgsAttributeActionPropertiesDialog dlg(
325 static_cast<Qgis::AttributeActionType>( mAttributeActionTable->item( row, Type )->data( Role::ActionType ).toInt() ),
326 mAttributeActionTable->item( row, Description )->text(),
327 mAttributeActionTable->item( row, ShortTitle )->text(),
328 mAttributeActionTable->verticalHeaderItem( row )->data( Qt::UserRole ).toString(),
329 mAttributeActionTable->item( row, ActionText )->data( Qt::UserRole ).toString(),
330 mAttributeActionTable->item( row, Capture )->checkState() == Qt::Checked,
331 mAttributeActionTable->item( row, ActionScopes )->data( Qt::UserRole ).value<QSet<QString>>(),
332 mAttributeActionTable->item( row, NotificationMessage )->text(),
333 mAttributeActionTable->item( row, EnabledOnlyWhenEditable )->checkState() == Qt::Checked,
334 mLayer
335 );
336
337 dlg.setWindowTitle( tr( "Duplicate Action" ) );
338
339 if ( dlg.exec() )
340 {
341 const QString name = uniqueName( dlg.description() );
342
343 insertRow( pos, dlg.type(), name, dlg.actionText(), dlg.iconPath(), dlg.capture(), dlg.shortTitle(), dlg.actionScopes(), dlg.notificationMessage(), dlg.isEnabledOnlyWhenEditable() );
344 }
345}
346
347void QgsAttributeActionDialog::updateButtons()
348{
349 QList<QTableWidgetItem *> selection = mAttributeActionTable->selectedItems();
350 const bool hasSelection = !selection.isEmpty();
351
352 if ( hasSelection )
353 {
354 const int row = selection.first()->row();
355 mMoveUpButton->setEnabled( row >= 1 );
356 mMoveDownButton->setEnabled( row >= 0 && row < mAttributeActionTable->rowCount() - 1 );
357 }
358 else
359 {
360 mMoveUpButton->setEnabled( false );
361 mMoveDownButton->setEnabled( false );
362 }
363
364 mRemoveButton->setEnabled( hasSelection );
365 mDuplicateButton->setEnabled( hasSelection );
366}
367
368void QgsAttributeActionDialog::addDefaultActions()
369{
370 int pos = 0;
371 insertRow( pos++, Qgis::AttributeActionType::Generic, tr( "Echo attribute's value" ), u"echo \"[% @field_value %]\""_s, QString(), true, tr( "Attribute Value" ), QSet<QString>() << u"Field"_s, QString() );
372 insertRow(
373 pos++,
375 tr( "Run an application" ),
376 u"ogr2ogr -f \"GPKG\" \"[% \"OUTPUT_PATH\" %]\" \"[% \"INPUT_FILE\" %]\""_s,
377 QString(),
378 true,
379 tr( "Run application" ),
380 QSet<QString>() << u"Feature"_s << u"Canvas"_s,
381 QString()
382 );
383 insertRow(
384 pos++,
386 tr( "Display the feature id in the message bar" ),
387 u"from qgis.utils import iface\n\niface.messageBar().pushInfo(\"Feature id\", \"The feature id is [% $id %]\")"_s,
388 QString(),
389 false,
390 tr( "Feature ID" ),
391 QSet<QString>() << u"Feature"_s << u"Canvas"_s,
392 QString()
393 );
394 insertRow(
395 pos++,
397 tr( "Selected field's value (Identify features tool)" ),
398 u"from qgis.PyQt import QtWidgets\n\nQtWidgets.QMessageBox.information(None, \"Current field's value\", \"[% @field_name %] = [% @field_value %]\")"_s,
399 QString(),
400 false,
401 tr( "Field Value" ),
402 QSet<QString>() << u"Field"_s,
403 QString()
404 );
405 insertRow(
406 pos++,
408 tr( "Clicked coordinates (Run feature actions tool)" ),
409 u"from qgis.PyQt import QtWidgets\n\nQtWidgets.QMessageBox.information(None, \"Clicked coords\", \"layer: [% @layer_id %]\\ncoords: ([% @click_x %],[% @click_y %])\")"_s,
410 QString(),
411 false,
412 tr( "Clicked Coordinate" ),
413 QSet<QString>() << u"Canvas"_s,
414 QString()
415 );
416 insertRow( pos++, Qgis::AttributeActionType::OpenUrl, tr( "Open file" ), u"[% \"PATH\" %]"_s, QString(), false, tr( "Open file" ), QSet<QString>() << u"Feature"_s << u"Canvas"_s, QString() );
417 insertRow( pos++, Qgis::AttributeActionType::OpenUrl, tr( "Search on web based on attribute's value" ), u"https://www.google.com/search?q=[% @field_value %]"_s, QString(), false, tr( "Search Web" ), QSet<QString>() << u"Field"_s, QString() );
418 insertRow(
419 pos++,
421 tr( "List feature ids" ),
422 u"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]))"_s,
423 QString(),
424 false,
425 tr( "List feature ids" ),
426 QSet<QString>() << u"Layer"_s,
427 QString()
428 );
429 insertRow(
430 pos++,
432 tr( "Duplicate selected features" ),
433 u"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 ) )"_s,
434 QString(),
435 false,
436 tr( "Duplicate selected" ),
437 QSet<QString>() << u"Layer"_s,
438 QString(),
439 true
440 );
441}
442
443void QgsAttributeActionDialog::itemDoubleClicked( QTableWidgetItem *item )
444{
445 const int row = item->row();
446
447 QgsAttributeActionPropertiesDialog actionProperties(
448 static_cast<Qgis::AttributeActionType>( mAttributeActionTable->item( row, Type )->data( Role::ActionType ).toInt() ),
449 mAttributeActionTable->item( row, Description )->text(),
450 mAttributeActionTable->item( row, ShortTitle )->text(),
451 mAttributeActionTable->verticalHeaderItem( row )->data( Qt::UserRole ).toString(),
452 mAttributeActionTable->item( row, ActionText )->data( Qt::UserRole ).toString(),
453 mAttributeActionTable->item( row, Capture )->checkState() == Qt::Checked,
454 mAttributeActionTable->item( row, ActionScopes )->data( Qt::UserRole ).value<QSet<QString>>(),
455 mAttributeActionTable->item( row, NotificationMessage )->text(),
456 mAttributeActionTable->item( row, EnabledOnlyWhenEditable )->checkState() == Qt::Checked,
457 mLayer
458 );
459
460 actionProperties.setWindowTitle( tr( "Edit Action" ) );
461
462 if ( actionProperties.exec() )
463 {
464 mAttributeActionTable->item( row, Type )->setData( Role::ActionType, static_cast<int>( actionProperties.type() ) );
465 mAttributeActionTable->item( row, Type )->setText( textForType( actionProperties.type() ) );
466 mAttributeActionTable->item( row, Description )->setText( actionProperties.description() );
467 mAttributeActionTable->item( row, ShortTitle )->setText( actionProperties.shortTitle() );
468 mAttributeActionTable->item( row, ActionText )->setText( actionProperties.actionText().length() > 30 ? actionProperties.actionText().left( 27 ) + "…" : actionProperties.actionText() );
469 mAttributeActionTable->item( row, ActionText )->setData( Qt::UserRole, actionProperties.actionText() );
470 mAttributeActionTable->item( row, Capture )->setCheckState( actionProperties.capture() ? Qt::Checked : Qt::Unchecked );
471 mAttributeActionTable->item( row, NotificationMessage )->setText( actionProperties.notificationMessage() );
472 mAttributeActionTable->item( row, EnabledOnlyWhenEditable )->setCheckState( actionProperties.isEnabledOnlyWhenEditable() ? Qt::Checked : Qt::Unchecked );
473
474 QTableWidgetItem *item = mAttributeActionTable->item( row, ActionScopes );
475 QStringList actionScopes = qgis::setToList( actionProperties.actionScopes() );
476 std::sort( actionScopes.begin(), actionScopes.end() );
477 item->setText( actionScopes.join( ", "_L1 ) );
478 item->setData( Qt::UserRole, QVariant::fromValue<QSet<QString>>( actionProperties.actionScopes() ) );
479
480 mAttributeActionTable->verticalHeaderItem( row )->setData( Qt::UserRole, actionProperties.iconPath() );
481 mAttributeActionTable->verticalHeaderItem( row )->setIcon( QIcon( actionProperties.iconPath() ) );
482 }
483}
484
485QString QgsAttributeActionDialog::uniqueName( QString name )
486{
487 // Make sure that the given name is unique, adding a numerical
488 // suffix if necessary.
489
490 const int pos = mAttributeActionTable->rowCount();
491 bool unique = true;
492
493 for ( int i = 0; i < pos; ++i )
494 {
495 if ( mAttributeActionTable->item( i, Description )->text() == name )
496 unique = false;
497 }
498
499 if ( !unique )
500 {
501 int suffix_num = 1;
502 QString new_name;
503 while ( !unique )
504 {
505 const QString suffix = QString::number( suffix_num );
506 new_name = name + '_' + suffix;
507 unique = true;
508 for ( int i = 0; i < pos; ++i )
509 if ( mAttributeActionTable->item( i, 0 )->text() == new_name )
510 unique = false;
511 ++suffix_num;
512 }
513 name = new_name;
514 }
515 return name;
516}
AttributeActionType
Attribute action types.
Definition qgis.h:4832
@ Mac
MacOS specific.
Definition qgis.h:4835
@ OpenUrl
Open URL action.
Definition qgis.h:4838
@ Unix
Unix specific.
Definition qgis.h:4837
@ SubmitUrlMultipart
POST data to an URL using "multipart/form-data".
Definition qgis.h:4840
@ Windows
Windows specific.
Definition qgis.h:4836
@ SubmitUrlEncoded
POST data to an URL, using "application/x-www-form-urlencoded" or "application/json" if the body is v...
Definition qgis.h:4839
Storage and management of actions associated with a layer.
Utility class that encapsulates an action based on vector attributes.
Definition qgsaction.h:38
QString notificationMessage() const
Returns the notification message that triggers the action.
Definition qgsaction.h:171
QString name() const
The name of the action. This may be a longer description.
Definition qgsaction.h:136
QSet< QString > actionScopes() const
The action scopes define where an action will be available.
Qgis::AttributeActionType type() const
The action type.
Definition qgsaction.h:174
QIcon icon() const
The icon.
Definition qgsaction.h:157
QString iconPath() const
The path to the icon.
Definition qgsaction.h:154
QString command() const
Returns the command that is executed by this action.
Definition qgsaction.h:165
QString shortTitle() const
The short title is used to label user interface elements like buttons.
Definition qgsaction.h:139
bool isEnabledOnlyWhenEditable() const
Returns whether only enabled in editable mode.
Definition qgsaction.h:181
bool capture() const
Whether to capture output for display when this action is run.
Definition qgsaction.h:177
QUuid id() const
Returns a unique id for this action.
Definition qgsaction.h:145
void init(const QgsActionManager &action, const QgsAttributeTableConfig &attributeTableConfig)
QgsAttributeActionDialog(const QgsActionManager &actions, QWidget *parent=nullptr)
QList< QgsAction > actions() const
QgsAttributeTableConfig::ActionWidgetStyle attributeTableWidgetStyle() const
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.
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.