Skip to content
Permalink
Browse files

fixed problem with saving first entry

  • Loading branch information
signedav committed Nov 6, 2017
1 parent 2c0d518 commit 52240ad7f7ad8d413ab2b9b60a7daf6de0ad3fc3
Showing with 9 additions and 10 deletions.
  1. +6 −3 src/app/qgsattributesformproperties.cpp
  2. +3 −7 src/app/qgsattributetypedialog.cpp
@@ -46,7 +46,7 @@ QgsAttributesFormProperties::QgsAttributesFormProperties( QgsVectorLayer *layer,
mFormLayoutTree->setType( DnDTree::Type::Drop );

// AttributeTypeDialog
mAttributeTypeDialog = new QgsAttributeTypeDialog( mLayer, 0, mAttributeTypeFrame );
mAttributeTypeDialog = new QgsAttributeTypeDialog( mLayer, -1, mAttributeTypeFrame );
mAttributeTypeDialog->layout()->setMargin( 0 );
mAttributeTypeFrame->layout()->setMargin( 0 );
mAttributeTypeFrame->layout()->addWidget( mAttributeTypeDialog );
@@ -79,8 +79,8 @@ void QgsAttributesFormProperties::init()
initLayoutConfig();
initInitPython();

//mAttributeTypeDialog->setEnabled( false );
//mAttributeRelationEdit->setEnabled( false );
mAttributeTypeDialog->setEnabled( false );
mAttributeRelationEdit->setEnabled( false );
}

void QgsAttributesFormProperties::initAvailableWidgetsTree()
@@ -264,6 +264,9 @@ void QgsAttributesFormProperties::loadAttributeTypeDialog()

void QgsAttributesFormProperties::storeAttributeTypeDialog()
{
if ( mAttributeTypeDialog->fieldIdx() < 0 )
return;

FieldConfig cfg;

cfg.mEditable = mAttributeTypeDialog->fieldEditable();
@@ -45,8 +45,9 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl, int fieldIdx
, mFieldIdx( fieldIdx )
{
setupUi( this );
//removed selectionListWidget: connect( selectionListWidget, &QListWidget::currentRowChanged, this, &QgsAttributeTypeDialog::selectionListWidget_currentRowChanged );
setWindowTitle( tr( "Edit Widget Properties - %1 (%2)" ).arg( vl->fields().at( fieldIdx ).name(), vl->name() ) );

if ( fieldIdx < 0 )
return;

QMapIterator<QString, QgsEditorWidgetFactory *> it( QgsGui::editorWidgetRegistry()->factories() );
QStandardItemModel *widgetTypeModel = qobject_cast<QStandardItemModel *>( mWidgetTypeComboBox->model() );
@@ -89,11 +90,6 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl, int fieldIdx
restoreGeometry( settings.value( QStringLiteral( "Windows/QgsAttributeTypeDialog/geometry" ) ).toByteArray() );

constraintExpressionWidget->setLayer( vl );

// TODO, what should this help be connected to?
#if 0
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsAttributeTypeDialog::showHelp );
#endif
}

QgsAttributeTypeDialog::~QgsAttributeTypeDialog()

0 comments on commit 52240ad

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