Skip to content
Permalink
Browse files

Fix #10337 - Allow attribute form on all features (new QgsFeatures ar…

…e invalid)
  • Loading branch information
NathanW2 committed May 25, 2014
1 parent 41e37e1 commit 9bdc932e9648d885352da772dc13687562617d43
Showing with 4 additions and 10 deletions.
  1. +1 −1 src/gui/qgsattributedialog.cpp
  2. +3 −9 src/gui/qgsattributeform.cpp
@@ -150,5 +150,5 @@ void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, QgsAt
mDialog->layout()->addWidget( mAttributeForm );
QDialogButtonBox* buttonBox = mAttributeForm->findChild<QDialogButtonBox*>();
connect( buttonBox, SIGNAL( rejected() ), mDialog, SLOT( close() ) );
connect( buttonBox, SIGNAL( accepted() ), mDialog, SLOT( close() ) );
connect( buttonBox, SIGNAL( accepted() ), mDialog, SLOT( accept() ) );
}
@@ -227,21 +227,15 @@ void QgsAttributeForm::onAttributeDeleted( int idx )

void QgsAttributeForm::synchronizeEnabledState()
{
bool enabled = mLayer->isEditable();
Q_FOREACH( QgsWidgetWrapper* ww, mWidgets )
{
if ( mFeature.isValid() && mLayer->isEditable() )
{
ww->setEnabled( true );
}
else
{
ww->setEnabled( false );
}
ww->setEnabled( enabled );
}

QPushButton* okButton = mButtonBox->button( QDialogButtonBox::Ok );
if ( okButton )
okButton->setEnabled( mFeature.isValid() && mLayer->isEditable() );
okButton->setEnabled( enabled );
}

void QgsAttributeForm::init()

0 comments on commit 9bdc932

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