Bug report #16637

Problem with empty values in getFeatures with OrderBy

Added by Marcos Medeiros over 3 years ago. Updated about 3 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Expressions
Affected QGIS version:2.16.1 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:24537

Description

I am trying to display features list on my own QAbstractTableModel.
By now it can sort columns just fine when all rows contains data. But whenever the column contains NULL/empty values the QgsVectorLayer::getFeatures method crash the application.

Code:
QgsFeatureRequest req;

req.addOrderBy(mLayer->attributeDisplayName(column), order == Qt::AscendingOrder);

QgsFeatureIterator it = mLayer->getFeatures(req);

QgsFeature feature;
long row = 0;
while (it.nextFeature(feature)) {
mRowToFeatureId[row++] = feature.id();
}

History

#1 Updated by Nyall Dawson over 3 years ago

  • Status changed from Open to Feedback

2.16 is no longer supported. Is this reproducible in 2.18.9?

#2 Updated by Giovanni Manghi about 3 years ago

  • Resolution set to not reproducable
  • Status changed from Feedback to Closed

Closing for lack of feedback, please reopen if necessary.

Also available in: Atom PDF