QGIS API Documentation 3.99.0-Master (7d2ca374f2d)
Loading...
Searching...
No Matches
qgsattributeactiondialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsattributeactiondialog.h - 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
23#ifndef QGSATTRIBUTEACTIONDIALOG_H
24#define QGSATTRIBUTEACTIONDIALOG_H
25
26// We don't want to expose this in the public API
27
28#include "ui_qgsattributeactiondialogbase.h"
29
30#include "qgis.h"
31#include "qgis_gui.h"
33
34#include <QMap>
35
36#define SIP_NO_FILE
37
39class QgsVectorLayer;
40class QgsAction;
41
47class GUI_EXPORT QgsAttributeActionDialog : public QWidget, private Ui::QgsAttributeActionDialogBase
48{
49 Q_OBJECT
50 private:
51 enum ColumnIndexes
52 {
53 Type,
54 Description,
55 ShortTitle,
56 ActionText,
57 Capture,
58 ActionScopes,
59 NotificationMessage,
60 EnabledOnlyWhenEditable
61 };
62
64 enum Role
65 {
66 ActionType = Qt::UserRole,
67 ActionId = Qt::UserRole + 1
68 };
69
70 public:
71 QgsAttributeActionDialog( const QgsActionManager &actions, QWidget *parent = nullptr );
72
73 void init( const QgsActionManager &action, const QgsAttributeTableConfig &attributeTableConfig );
74
75 QList<QgsAction> actions() const;
76
77 bool showWidgetInAttributeTable() const;
78
80
81 private slots:
82 void moveUp();
83 void moveDown();
84 void remove();
85 void insert();
86 void duplicate();
87 void addDefaultActions();
88 void itemDoubleClicked( QTableWidgetItem *item );
89 void updateButtons();
90
91 private:
92 void insertRow( int row, const QgsAction &action );
93 void 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 = false );
94 void swapRows( int row1, int row2 );
95 QgsAction rowToAction( int row ) const;
96
97 QString textForType( Qgis::AttributeActionType type );
98
99 void rowSelected( int row );
100
101 QString uniqueName( QString name );
102
103 QgsVectorLayer *mLayer = nullptr;
104};
105
106#endif
AttributeActionType
Attribute action types.
Definition qgis.h:4797
Storage and management of actions associated with a layer.
Utility class that encapsulates an action based on vector attributes.
Definition qgsaction.h:38
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.
ActionWidgetStyle
The style of the action widget in the attribute table.
Represents a vector layer which manages a vector based dataset.