QGIS API Documentation
4.3.0-Master (0ad0cdb9438)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgsattributedialog.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsattributedialog.h - description
3
-------------------
4
begin : October 2004
5
copyright : (C) 2004 by Marco Hugentobler
6
email : marco.hugentobler@autoform.ch
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
#ifndef QGSATTRIBUTEDIALOG_H
18
#define QGSATTRIBUTEDIALOG_H
19
20
#include "qgis_gui.h"
21
#include "
qgis_sip.h
"
22
#include "
qgsattributeeditorcontext.h
"
23
#include "
qgsattributeform.h
"
24
#include "
qgsmaplayeractioncontextgenerator.h
"
25
#include "
qgstrackedvectorlayertools.h
"
26
27
#include <QDialog>
28
#include <QGridLayout>
29
#include <QMenuBar>
30
31
class
QgsHighlight
;
32
class
QgsActionMenu
;
33
39
class
GUI_EXPORT
QgsAttributeDialog
:
public
QDialog,
public
QgsMapLayerActionContextGenerator
40
{
41
Q_OBJECT
42
43
public
:
55
QgsAttributeDialog
(
56
QgsVectorLayer
*vl,
57
QgsFeature
*thepFeature,
58
bool
featureOwner,
59
QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
,
60
bool
showDialogButtons =
true
,
61
const
QgsAttributeEditorContext
&context =
QgsAttributeEditorContext
()
62
);
63
64
~QgsAttributeDialog
()
override
;
65
70
void
setHighlight
(
QgsHighlight
*h );
71
75
QgsAttributeForm
*
attributeForm
()
const
{
return
mAttributeForm; }
76
80
const
QgsFeature
*
feature
()
const
{
return
&mAttributeForm->feature(); }
81
87
bool
editable
()
const
{
return
mAttributeForm->editable(); }
88
94
void
setMode(
QgsAttributeEditorContext::Mode
mode );
95
101
void
setEditCommandMessage
(
const
QString &message ) { mAttributeForm->setEditCommandMessage( message ); }
102
110
bool
event( QEvent *e )
override
;
111
112
void
showEvent( QShowEvent *event )
override
;
113
120
void
setExtraContextScope(
QgsExpressionContextScope
*extraScope
SIP_TRANSFER
);
121
122
QgsMapLayerActionContext
createActionContext
()
override
;
123
124
public
slots:
125
void
accept()
override
;
126
void
reject()
override
;
127
129
void
show();
130
131
private
:
132
void
init(
QgsVectorLayer
*layer,
QgsFeature
*feature,
const
QgsAttributeEditorContext
&context,
bool
showDialogButtons );
133
134
QString mSettingsPath;
135
// Used to sync multiple widgets for the same field
136
QgsHighlight
*mHighlight =
nullptr
;
137
QString mReturnvarname;
138
QgsAttributeForm
*mAttributeForm =
nullptr
;
139
std::unique_ptr<QgsFeature> mOwnedFeature;
140
QgsMessageBar
*mMessageBar =
nullptr
;
141
142
QgsTrackedVectorLayerTools
mTrackedVectorLayerTools;
143
144
QgsActionMenu
*mMenu;
145
QMenuBar *mMenuBar =
nullptr
;
146
147
static
int
sFormCounter;
148
149
bool
mFirstShow =
true
;
150
void
saveGeometry();
151
void
restoreGeometry();
152
};
153
154
#endif
QgsActionMenu
A menu that is populated automatically with the actions defined for a given layer.
Definition
qgsactionmenu.h:38
QgsAttributeDialog::attributeForm
QgsAttributeForm * attributeForm() const
Returns the attribute form.
Definition
qgsattributedialog.h:75
QgsAttributeDialog::feature
const QgsFeature * feature() const
Returns the current feature of the attribute form.
Definition
qgsattributedialog.h:80
QgsAttributeDialog::setEditCommandMessage
void setEditCommandMessage(const QString &message)
Sets the edit command message (Undo) that will be used when the dialog is accepted.
Definition
qgsattributedialog.h:101
QgsAttributeDialog::editable
bool editable() const
Is this dialog editable?
Definition
qgsattributedialog.h:87
QgsAttributeDialog::setHighlight
void setHighlight(QgsHighlight *h)
setHighlight
Definition
qgsattributedialog.cpp:66
QgsAttributeDialog::QgsAttributeDialog
QgsAttributeDialog(QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QWidget *parent=nullptr, bool showDialogButtons=true, const QgsAttributeEditorContext &context=QgsAttributeEditorContext())
Create an attribute dialog for a given layer and feature.
Definition
qgsattributedialog.cpp:33
QgsAttributeEditorContext
Contains context information for attribute editor widgets.
Definition
qgsattributeeditorcontext.h:42
QgsAttributeEditorContext::Mode
Mode
modes
Definition
qgsattributeeditorcontext.h:48
QgsAttributeForm
The attribute form widget for vector layer features.
Definition
qgsattributeform.h:48
QgsExpressionContextScope
Single scope for storing variables and functions for use within a QgsExpressionContext.
Definition
qgsexpressioncontext.h:119
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:60
QgsHighlight
Highlights features on the map.
Definition
qgshighlight.h:63
QgsMapLayerActionContextGenerator
An interface for objects which can create a QgsMapLayerActionContext.
Definition
qgsmaplayeractioncontextgenerator.h:31
QgsMapLayerActionContextGenerator::createActionContext
virtual QgsMapLayerActionContext createActionContext()=0
Creates a QgsMapLayerActionContext.
QgsMapLayerActionContext
Encapsulates the context in which a QgsMapLayerAction action is executed.
Definition
qgsmaplayeractioncontext.h:34
QgsMessageBar
A bar for displaying non-blocking messages to the user.
Definition
qgsmessagebar.h:61
QgsTrackedVectorLayerTools
Vector layer tools subclass which "tracks" edits.
Definition
qgstrackedvectorlayertools.h:29
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:35
qgsattributeeditorcontext.h
qgsattributeform.h
qgsmaplayeractioncontextgenerator.h
qgstrackedvectorlayertools.h
Generated on
for QGIS API Documentation by
1.17.0