QGIS API Documentation 3.99.0-Master (26c88405ac0)
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#define SIP_NO_FILE
28
29#include "ui_qgsattributeactiondialogbase.h"
30
31#include "qgis.h"
32#include "qgis_gui.h"
34
35#include <QMap>
36
38class QgsVectorLayer;
39class QgsAction;
40
46class GUI_EXPORT QgsAttributeActionDialog : public QWidget, private Ui::QgsAttributeActionDialogBase
47{
48 Q_OBJECT
49 private:
50 enum ColumnIndexes
51 {
52 Type,
53 Description,
54 ShortTitle,
55 ActionText,
56 Capture,
57 ActionScopes,
58 NotificationMessage,
59 EnabledOnlyWhenEditable
60 };
61
63 enum Role
64 {
65 ActionType = Qt::UserRole,
66 ActionId = Qt::UserRole + 1
67 };
68
69 public:
70 QgsAttributeActionDialog( const QgsActionManager &actions, QWidget *parent = nullptr );
71
72 void init( const QgsActionManager &action, const QgsAttributeTableConfig &attributeTableConfig );
73
74 QList<QgsAction> actions() const;
75
76 bool showWidgetInAttributeTable() const;
77
79
80 private slots:
81 void moveUp();
82 void moveDown();
83 void remove();
84 void insert();
85 void duplicate();
86 void addDefaultActions();
87 void itemDoubleClicked( QTableWidgetItem *item );
88 void updateButtons();
89
90 private:
91 void insertRow( int row, const QgsAction &action );
92 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 );
93 void swapRows( int row1, int row2 );
94 QgsAction rowToAction( int row ) const;
95
96 QString textForType( Qgis::AttributeActionType type );
97
98 void rowSelected( int row );
99
100 QString uniqueName( QString name );
101
102 QgsVectorLayer *mLayer = nullptr;
103};
104
105#endif
AttributeActionType
Attribute action types.
Definition qgis.h:4675
Storage and management of actions associated with a layer.
Utility class that encapsulates an action based on vector attributes.
Definition qgsaction.h:37
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.