29 #include <QProgressDialog>
32 const QString& shapefileName,
bool onlySelectedFeatures,
35 if ( !layerA && !layerB )
58 if ( onlySelectedFeatures )
61 QgsFeatureIds::const_iterator it = selectionB.constBegin();
62 for ( ; it != selectionB.constEnd(); ++it )
64 if ( !layerB->
featureAtId( *it, currentFeature,
true,
true ) )
74 p->setMaximum( selectionA.size() );
77 int processedFeatures = 0;
78 it = selectionA.constBegin();
79 for ( ; it != selectionA.constEnd(); ++it )
83 p->setValue( processedFeatures );
86 if ( p && p->wasCanceled() )
90 if ( !layerA->
featureAtId( *it, currentFeature,
true,
true ) )
100 p->setValue( selectionA.size() );
117 p->setMaximum( featureCount );
119 int processedFeatures = 0;
125 p->setValue( processedFeatures );
127 if ( p && p->wasCanceled() )
136 p->setValue( featureCount );
149 if ( !featureGeometry )
154 QList<int> intersects;
156 QList<int>::const_iterator it = intersects.constBegin();
158 for ( ; it != intersects.constEnd(); ++it )
160 if ( !vl->
featureAtId( *it, overlayFeature,
true,
true ) )
186 QList<QString> names;
187 QMap<int, QgsField>::const_iterator j = fieldListA.constBegin();
188 while ( j != fieldListA.constEnd() )
190 names.append( j.value().name() );
193 QMap<int, QgsField>::const_iterator i = fieldListB.constBegin();
195 int fcount = fieldListA.size();
197 while ( i != fieldListB.constEnd() )
200 while ( names.contains( field.
name() ) )
202 QString name = field.
name();
203 name.append(
"_" ).append( QString( count ) );
207 fieldListA.insert( fcount, field );
216 QMap<int, QVariant>::const_iterator i = attributeMapB.constBegin();
218 int fcount = attributeMapA.size();
219 while ( i != attributeMapB.constEnd() )
221 attribute = i.value();
222 attributeMapA.insert( fcount, attribute );