28 #include <QProgressDialog>
31 const QString& shapefileName,
bool onlySelectedFeatures,
34 if ( !layerA && !layerB )
57 if ( onlySelectedFeatures )
60 QgsFeatureIds::const_iterator it = selectionB.constBegin();
61 for ( ; it != selectionB.constEnd(); ++it )
73 p->setMaximum( selectionA.size() );
76 int processedFeatures = 0;
77 it = selectionA.constBegin();
78 for ( ; it != selectionA.constEnd(); ++it )
82 p->setValue( processedFeatures );
85 if ( p && p->wasCanceled() )
99 p->setValue( selectionA.size() );
114 p->setMaximum( featureCount );
116 int processedFeatures = 0;
125 p->setValue( processedFeatures );
127 if ( p && p->wasCanceled() )
136 p->setValue( featureCount );
149 if ( !featureGeometry )
154 QList<QgsFeatureId> intersects;
156 QList<QgsFeatureId>::const_iterator it = intersects.constBegin();
158 for ( ; it != intersects.constEnd(); ++it )
186 QList<QString> names;
187 for (
int idx = 0; idx < fieldListA.
count(); ++idx )
188 names.append( fieldListA[idx].name() );
190 for (
int idx = 0; idx < fieldListB.
count(); ++idx )
194 while ( names.contains( field.
name() ) )
196 QString name = QString(
"%1_%2" ).arg( field.
name() ).arg( count );
200 fieldListA.
append( field );
201 names.append( field.
name() );
207 attributesA += attributesB;