Expand Up
@@ -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;
Expand Down
Expand Up
@@ -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 ;
Expand Down
Expand Up
@@ -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...
Expand Down
Expand Up
@@ -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 ;
Expand Down