File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ QVariant QgsMergeAttributesDialog::minimumAttribute( int col )
327
327
328
328
if ( numberOfConsideredFeatures < 1 )
329
329
{
330
- return QString ( );
330
+ return QVariant ( mVectorLayer -> pendingFields ()[col]. type () );
331
331
}
332
332
333
333
return QVariant ( minimumValue );
@@ -377,6 +377,12 @@ QVariant QgsMergeAttributesDialog::meanAttribute( int col )
377
377
++numberOfConsideredFeatures;
378
378
}
379
379
}
380
+
381
+ if ( numberOfConsideredFeatures < 1 )
382
+ {
383
+ return QVariant ( mVectorLayer ->pendingFields ()[col].type () );
384
+ }
385
+
380
386
double mean = sum / numberOfConsideredFeatures;
381
387
return QVariant ( mean );
382
388
}
@@ -401,6 +407,13 @@ QVariant QgsMergeAttributesDialog::medianAttribute( int col )
401
407
402
408
double medianValue;
403
409
int size = valueList.size ();
410
+
411
+
412
+ if ( size < 1 )
413
+ {
414
+ return QVariant ( mVectorLayer ->pendingFields ()[col].type () );
415
+ }
416
+
404
417
bool even = ( size % 2 ) < 1 ;
405
418
if ( even )
406
419
{
You can’t perform that action at this time.
0 commit comments