QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
editorwidgets
qgsactionwidgetwrapper.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsactionwidgetwrapper.h - QgsActionWidgetWrapper
3
4
---------------------
5
begin : 14.8.2021
6
copyright : (C) 2021 by Alessandro Pasotti
7
email : elpaso at itopen dot it
8
***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
#ifndef QGSACTIONWIDGETWRAPPER_H
17
#define QGSACTIONWIDGETWRAPPER_H
18
19
#include "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
#include "
qgsaction.h
"
22
#include "
qgswidgetwrapper.h
"
23
24
#include <QPushButton>
25
26
class
QgsMessageBar
;
27
33
class
GUI_EXPORT
QgsActionWidgetWrapper
:
public
QgsWidgetWrapper
34
{
35
Q_OBJECT
36
37
public
:
46
QgsActionWidgetWrapper
(
QgsVectorLayer
*
layer
, QWidget *editor, QWidget *parent,
QgsMessageBar
*messageBar =
nullptr
);
47
48
public
:
52
void
setAction
(
const
QgsAction
&action );
53
54
// QgsWidgetWrapper interface
55
bool
valid
()
const override
;
56
QWidget *
createWidget
( QWidget *parent )
override
;
57
void
initWidget
( QWidget *editor )
override
;
58
59
public
slots:
60
61
void
setFeature
(
const
QgsFeature
&feature )
override
;
62
void
setEnabled
(
bool
enabled )
override
;
63
64
private
:
65
QgsMessageBar
*mMessageBar =
nullptr
;
66
QPushButton *mActionButton =
nullptr
;
67
QgsAction
mAction;
68
QgsFeature
mFeature;
69
};
70
71
#endif
// QGSACTIONWIDGETWRAPPER_H
QgsActionWidgetWrapper::setAction
void setAction(const QgsAction &action)
Sets the action.
Definition
qgsactionwidgetwrapper.cpp:45
QgsActionWidgetWrapper::QgsActionWidgetWrapper
QgsActionWidgetWrapper(QgsVectorLayer *layer, QWidget *editor, QWidget *parent, QgsMessageBar *messageBar=nullptr)
Create an action widget wrapper.
Definition
qgsactionwidgetwrapper.cpp:30
QgsAction
Utility class that encapsulates an action based on vector attributes.
Definition
qgsaction.h:38
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:60
QgsMessageBar
A bar for displaying non-blocking messages to the user.
Definition
qgsmessagebar.h:61
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
QgsWidgetWrapper::setFeature
virtual void setFeature(const QgsFeature &feature)=0
Is called when the value of the widget needs to be changed.
QgsWidgetWrapper::valid
virtual bool valid() const =0
Returns true if the widget has been properly initialized.
QgsWidgetWrapper::initWidget
virtual void initWidget(QWidget *editor)
This method should initialize the editor widget with runtime data.
Definition
qgswidgetwrapper.cpp:109
QgsWidgetWrapper::QgsWidgetWrapper
QgsWidgetWrapper(QgsVectorLayer *vl, QWidget *editor=nullptr, QWidget *parent=nullptr)
Create a new widget wrapper.
Definition
qgswidgetwrapper.cpp:42
QgsWidgetWrapper::layer
QgsVectorLayer * layer() const
Returns the vector layer associated with the widget.
Definition
qgswidgetwrapper.cpp:94
QgsWidgetWrapper::createWidget
virtual QWidget * createWidget(QWidget *parent)=0
This method should create a new widget with the provided parent.
QgsWidgetWrapper::setEnabled
virtual void setEnabled(bool enabled)
Is used to enable or disable the edit functionality of the managed widget.
Definition
qgswidgetwrapper.cpp:114
qgis_sip.h
qgsaction.h
qgswidgetwrapper.h
Generated on
for QGIS API Documentation by
1.17.0