mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-01 00:05:25 -04:00
Add some configuration
This commit is contained in:
parent
493bdb1bf2
commit
a780febb42
@ -966,7 +966,9 @@ void DnDTree::onItemDoubleClicked( QTreeWidgetItem *item, int column )
|
||||
QWidget *baseWidget = new QWidget();
|
||||
baseWidget->setLayout( baseLayout );
|
||||
|
||||
if ( itemData.type() == QgsAttributesFormProperties::DnDTreeItemData::Container )
|
||||
switch ( itemData.type() )
|
||||
{
|
||||
case QgsAttributesFormProperties::DnDTreeItemData::Container:
|
||||
{
|
||||
QDialog dlg;
|
||||
dlg.setWindowTitle( tr( "Configure Container" ) );
|
||||
@ -1025,7 +1027,9 @@ void DnDTree::onItemDoubleClicked( QTreeWidgetItem *item, int column )
|
||||
item->setText( 0, title->text() );
|
||||
}
|
||||
}
|
||||
else if ( itemData.type() == QgsAttributesFormProperties::DnDTreeItemData::Relation )
|
||||
break;
|
||||
|
||||
case QgsAttributesFormProperties::DnDTreeItemData::Relation:
|
||||
{
|
||||
QDialog dlg;
|
||||
dlg.setWindowTitle( tr( "Configure Relation Editor" ) );
|
||||
@ -1058,7 +1062,44 @@ void DnDTree::onItemDoubleClicked( QTreeWidgetItem *item, int column )
|
||||
item->setData( 0, QgsAttributesFormProperties::DnDTreeRole, itemData );
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
case QgsAttributesFormProperties::DnDTreeItemData::QmlWidget:
|
||||
{
|
||||
QDialog dlg;
|
||||
dlg.setWindowTitle( tr( "Configure QML Widget" ) );
|
||||
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 );
|
||||
layout->addRow( showLinkButton );
|
||||
layout->addRow( showUnlinkButton );
|
||||
|
||||
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();
|
||||
itemData.setShowLabel( showLabelCheckbox->isChecked() );
|
||||
itemData.setRelationEditorConfiguration( relEdCfg );
|
||||
|
||||
item->setData( 0, QgsAttributesFormProperties::DnDTreeRole, itemData );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case QgsAttributesFormProperties::DnDTreeItemData::Field:
|
||||
{
|
||||
QDialog dlg;
|
||||
dlg.setWindowTitle( tr( "Configure Field" ) );
|
||||
@ -1080,6 +1121,8 @@ void DnDTree::onItemDoubleClicked( QTreeWidgetItem *item, int column )
|
||||
item->setData( 0, QgsAttributesFormProperties::DnDTreeRole, itemData );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DnDTree::Type DnDTree::type() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user