Skip to content
Permalink
Browse files

remove relation editor on double clik in form editor (#36123)

there is now the panel on the right for this
  • Loading branch information
3nids committed May 1, 2020
1 parent dd560f4 commit 347d048125dbe6abd4cb1dfdf2f37cd11b4f23b3
Showing with 1 addition and 39 deletions.
  1. +1 −39 src/gui/vector/qgsattributesformproperties.cpp
@@ -1182,46 +1182,8 @@ void QgsAttributesDnDTree::onItemDoubleClicked( QTreeWidgetItem *item, int colum
{
case QgsAttributesFormProperties::DnDTreeItemData::Container:
case QgsAttributesFormProperties::DnDTreeItemData::WidgetType:
break;

case QgsAttributesFormProperties::DnDTreeItemData::Relation:
{
QDialog dlg;
dlg.setWindowTitle( tr( "Configure Relation Editor" ) );
QFormLayout *layout = new QFormLayout() ;
dlg.setLayout( layout );
layout->addWidget( baseWidget );

QCheckBox *showLinkButton = new QCheckBox( tr( "Show link button" ) );
showLinkButton->setChecked( itemData.relationEditorConfiguration().showLinkButton );
QCheckBox *showUnlinkButton = new QCheckBox( tr( "Show unlink button" ) );
showUnlinkButton->setChecked( itemData.relationEditorConfiguration().showUnlinkButton );
QCheckBox *showSaveChildEditsButton = new QCheckBox( tr( "Show save child layer edits button" ) );
showSaveChildEditsButton->setChecked( itemData.relationEditorConfiguration().showSaveChildEditsButton );
layout->addRow( showLinkButton );
layout->addRow( showUnlinkButton );
layout->addRow( showSaveChildEditsButton );

QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );

connect( buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept );
connect( buttonBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject );

dlg.layout()->addWidget( buttonBox );

if ( dlg.exec() )
{
QgsAttributesFormProperties::RelationEditorConfiguration relEdCfg;
relEdCfg.showLinkButton = showLinkButton->isChecked();
relEdCfg.showUnlinkButton = showUnlinkButton->isChecked();
relEdCfg.showSaveChildEditsButton = showSaveChildEditsButton->isChecked();
itemData.setShowLabel( showLabelCheckbox->isChecked() );
itemData.setRelationEditorConfiguration( relEdCfg );

item->setData( 0, QgsAttributesFormProperties::DnDTreeRole, itemData );
}
}
break;
break;

case QgsAttributesFormProperties::DnDTreeItemData::QmlWidget:
{

0 comments on commit 347d048

Please sign in to comment.
You can’t perform that action at this time.