27 , mOwnedFeature( featureOwner ? thepFeature : nullptr )
29 init( vl, thepFeature, context, showDialogButtons );
46 void QgsAttributeDialog::saveGeometry()
53 void QgsAttributeDialog::restoreGeometry()
69 mAttributeForm->
save();
92 setWindowTitle( tr(
"%1 - Feature Attributes" ).arg( layer->
name() ) );
93 setLayout(
new QGridLayout() );
94 layout()->setMargin( 0 );
97 if ( showDialogButtons )
100 mAttributeForm =
new QgsAttributeForm( layer, *feature, trackedContext,
this );
102 layout()->addWidget( mAttributeForm );
103 QDialogButtonBox *buttonBox = mAttributeForm->findChild<QDialogButtonBox *>();
106 connect( layer, &QObject::destroyed,
this, &QWidget::close );
108 mMenu =
new QgsActionMenu( layer, mAttributeForm->
feature(), QStringLiteral(
"Feature" ), this );
109 if ( !mMenu->actions().isEmpty() )
111 QMenuBar *menuBar =
new QMenuBar(
this );
112 menuBar->addMenu( mMenu );
113 layout()->setMenuBar( menuBar );
122 mAttributeForm->
setMode( mode );
128 if ( e->type() == QEvent::WindowActivate && mHighlight )
130 else if ( e->type() == QEvent::WindowDeactivate && mHighlight )
133 return QDialog::event( e );
const QgsVectorLayerTools * vectorLayerTools() const
Returns the associated vector layer tools.
This class is a composition of two QSettings instances:
A form was opened as a new dialog.
This class contains context information for attribute editor widgets.
~QgsAttributeDialog() override
void setHighlight(QgsHighlight *h)
setHighlight
void setVectorLayerTools(QgsVectorLayerTools *vlTools)
Sets the associated vector layer tools.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
void saveGeometry(QWidget *widget, const QString &keyName)
Save the wigget geometry into settings.
bool restoreGeometry(QWidget *widget, const QString &keyName)
Restore the wigget geometry from settings.
void show()
Show the dialog non-blocking. Reparents this dialog to be a child of the dialog form.
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.
A class for highlight features on the map.
bool event(QEvent *e) override
Intercept window activate/deactive events to show/hide the highlighted feature.
void setFormMode(FormMode mode)
Sets the form mode.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
const QgsFeature * feature()
void setMode(QgsAttributeForm::Mode mode)
Toggles the form mode.
Represents a vector layer which manages a vector based data sets.