Skip to content
Permalink
Browse files

remove redundant code

  • Loading branch information
signedav committed Jan 21, 2019
1 parent ad9613f commit 73e774b75a3159c6d9965433d39e74e93b6005c9
Showing with 2 additions and 23 deletions.
  1. +2 −23 src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp
@@ -218,6 +218,7 @@ void QgsValueRelationWidgetWrapper::setValue( const QVariant &value )
}
}
mComboBox->setCurrentIndex( idx );
mComboBox->setEnabled( mEnabled );
}
else if ( mLineEdit )
{
@@ -229,6 +230,7 @@ void QgsValueRelationWidgetWrapper::setValue( const QVariant &value )
break;
}
}
mLineEdit->setEnabled( mEnabled );
}
}

@@ -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.
You can’t perform that action at this time.