This commit is contained in:
Juergen E. Fischer 2012-06-08 00:51:43 +02:00
parent 945bfe7745
commit 2d722b1a56
2 changed files with 209 additions and 205 deletions

File diff suppressed because it is too large Load Diff

View File

@ -155,11 +155,13 @@ QComboBox* QgsMergeAttributesDialog::createMergeComboBox( QVariant::Type columnT
{
newComboBox->addItem( tr( "Concatenation" ) );
}
if ( columnType == QVariant::Double )
else if ( columnType == QVariant::Double )
{
newComboBox->addItem( tr( "Mean" ) );
}
newComboBox->addItem( tr( "Skip attribute" ) );
QObject::connect( newComboBox, SIGNAL( currentIndexChanged( const QString& ) ),
this, SLOT( comboValueChanged( const QString& ) ) );
return newComboBox;
@ -228,13 +230,7 @@ void QgsMergeAttributesDialog::selectedRowChanged()
void QgsMergeAttributesDialog::refreshMergedValue( int col )
{
//get QComboBox
QWidget* cellWidget = mTableWidget->cellWidget( 0, col );
if ( !cellWidget )
{
return;
}
QComboBox* comboBox = qobject_cast<QComboBox *>( cellWidget );
QComboBox* comboBox = qobject_cast<QComboBox *>( mTableWidget->cellWidget( 0, col ) );
if ( !comboBox )
{
return;
@ -267,6 +263,10 @@ void QgsMergeAttributesDialog::refreshMergedValue( int col )
{
evalText = concatenationAttributeString( col );
}
else if ( mergeBehaviourString == tr( "Skip attribute" ) )
{
evalText = tr( "Skipped" );
}
else //an existing feature value
{
int featureId = mergeBehaviourString.split( " " ).at( 1 ).toInt(); //probably not very robust for translations...
@ -562,6 +562,10 @@ QgsAttributeMap QgsMergeAttributesDialog::mergedAttributesMap() const
{
int idx = mTableWidget->horizontalHeaderItem( i )->data( Qt::UserRole ).toInt();
QComboBox* comboBox = qobject_cast<QComboBox *>( mTableWidget->cellWidget( 0, i ) );
if ( comboBox && comboBox->currentText() == tr( "Skip attribute" ) )
continue;
QTableWidgetItem* currentItem = mTableWidget->item( mFeatureList.size() + 1, i );
if ( !currentItem )
continue;