Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove redundant code
  • Loading branch information
signedav committed Jan 21, 2019
1 parent ad9613f commit 73e774b
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp
Expand Up @@ -218,6 +218,7 @@ void QgsValueRelationWidgetWrapper::setValue( const QVariant &value )
}
}
mComboBox->setCurrentIndex( idx );
mComboBox->setEnabled( mEnabled );
}
else if ( mLineEdit )
{
Expand All @@ -229,6 +230,7 @@ void QgsValueRelationWidgetWrapper::setValue( const QVariant &value )
break;
}
}
mLineEdit->setEnabled( mEnabled );
}
}

Expand Down Expand Up @@ -387,27 +389,4 @@ void QgsValueRelationWidgetWrapper::setEnabled( bool enabled )
return;

mEnabled = enabled;

if ( mTableWidget )
{
auto signalBlockedTableWidget = whileBlocking( mTableWidget );
Q_UNUSED( signalBlockedTableWidget )

for ( int j = 0; j < mTableWidget->rowCount(); j++ )
{
for ( int i = 0; i < mTableWidget->columnCount(); ++i )
{
QTableWidgetItem *item = mTableWidget->item( j, i );
if ( item )
{
if ( enabled )
item->setFlags( item->flags() | Qt::ItemIsEnabled );
else
item->setFlags( item->flags() & ~Qt::ItemIsEnabled );
}
}
}
}
else
QgsEditorWidgetWrapper::setEnabled( enabled );
}

0 comments on commit 73e774b

Please sign in to comment.