mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Fix option "show label" on relation editor
If the option was disabled, the label was still shown.
This commit is contained in:
parent
8e09f4e9c1
commit
d8b3adab94
@ -1927,8 +1927,6 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt
|
||||
|
||||
QgsRelationWidgetWrapper *rww = setupRelationWidgetWrapper( relDef->relation(), context );
|
||||
|
||||
rww->setShowLabel( relDef->showLabel() );
|
||||
|
||||
QgsAttributeFormRelationEditorWidget *formWidget = new QgsAttributeFormRelationEditorWidget( rww, this );
|
||||
formWidget->createSearchWidgetWrappers( mContext );
|
||||
|
||||
@ -1938,6 +1936,7 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt
|
||||
rww->setShowLinkButton( relDef->showLinkButton() );
|
||||
rww->setShowUnlinkButton( relDef->showUnlinkButton() );
|
||||
rww->setShowSaveChildEditsButton( relDef->showSaveChildEditsButton() );
|
||||
rww->setShowLabel( relDef->showLabel() );
|
||||
|
||||
mWidgets.append( rww );
|
||||
mFormWidgets.append( formWidget );
|
||||
|
@ -228,8 +228,7 @@ void QgsRelationEditorWidget::setRelationFeature( const QgsRelation &relation, c
|
||||
connect( mRelation.referencingLayer(), &QgsVectorLayer::editingStarted, this, &QgsRelationEditorWidget::updateButtons );
|
||||
connect( mRelation.referencingLayer(), &QgsVectorLayer::editingStopped, this, &QgsRelationEditorWidget::updateButtons );
|
||||
|
||||
if ( mShowLabel )
|
||||
setTitle( relation.name() );
|
||||
updateTitle();
|
||||
|
||||
QgsVectorLayer *lyr = relation.referencingLayer();
|
||||
|
||||
@ -340,7 +339,7 @@ void QgsRelationEditorWidget::setRelations( const QgsRelation &relation, const Q
|
||||
connect( mNmRelation.referencedLayer(), &QgsVectorLayer::editingStopped, this, &QgsRelationEditorWidget::updateButtons );
|
||||
}
|
||||
|
||||
setTitle( relation.name() );
|
||||
updateTitle();
|
||||
|
||||
QgsVectorLayer *lyr = relation.referencingLayer();
|
||||
|
||||
@ -972,10 +971,7 @@ void QgsRelationEditorWidget::setShowLabel( bool showLabel )
|
||||
{
|
||||
mShowLabel = showLabel;
|
||||
|
||||
if ( mShowLabel && mRelation.isValid() )
|
||||
setTitle( mRelation.name() );
|
||||
else
|
||||
setTitle( QString() );
|
||||
updateTitle();
|
||||
}
|
||||
|
||||
void QgsRelationEditorWidget::showContextMenu( QgsActionMenu *menu, const QgsFeatureId fid )
|
||||
@ -1014,6 +1010,14 @@ void QgsRelationEditorWidget::unsetMapTool()
|
||||
disconnect( mMapToolDigitize, &QgsMapToolDigitizeFeature::digitizingCompleted, this, &QgsRelationEditorWidget::onDigitizingCompleted );
|
||||
}
|
||||
|
||||
void QgsRelationEditorWidget::updateTitle()
|
||||
{
|
||||
if ( mShowLabel && mRelation.isValid() )
|
||||
setTitle( mRelation.name() );
|
||||
else
|
||||
setTitle( QString() );
|
||||
}
|
||||
|
||||
QgsFeature QgsRelationEditorWidget::feature() const
|
||||
{
|
||||
return mFeature;
|
||||
|
@ -250,6 +250,7 @@ class GUI_EXPORT QgsRelationEditorWidget : public QgsCollapsibleGroupBox
|
||||
void initDualView( QgsVectorLayer *layer, const QgsFeatureRequest &request );
|
||||
void setMapTool( QgsMapTool *mapTool );
|
||||
void unsetMapTool();
|
||||
void updateTitle();
|
||||
|
||||
QgsDualView *mDualView = nullptr;
|
||||
QPointer<QgsMessageBarItem> mMessageBarItem;
|
||||
|
Loading…
x
Reference in New Issue
Block a user