Bug report #18361

When adding raster layers, the layers are sorted in the reverse order from the selection in the file open dialog

Added by Patrick Dunford over 6 years ago. Updated over 5 years ago.

Category:Map Legend
Affected QGIS version:3.0.0 Regression?:No
Operating System:Debian 9.3 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:26251


Steps to reproduce:
Open some rasters in a project
When selecting the rasters in the open dialog box, pay attention to the file name sorting order
The files are sorted in the reverse order when added, if the order in the dialog box is set to file name ascending, the rasters will be added in the file name descending order.


#1 Updated by Giovanni Manghi over 6 years ago

  • Category changed from Unknown to Map Legend

#2 Updated by Patrick Dunford about 6 years ago

It will probably be upstream from Qt

#3 Updated by Patrick Dunford over 5 years ago

After further evaluating in 3.4.1
  • The filenames are returned from the file open dialog in the same order as they were selected in the file open dialog (i.e. when viewed in the "Raster Datasets" source field in the Data Source Manager dialog)

in this instance this field's contents are
"/home/patrick/Maps/References/Region - Otago-Southland/Section - Makarewa-Centre Bush/C1964full-92X62x1-92N43x1.jpg" "/home/patrick/Maps/References/Region - Otago-Southland/Section - Makarewa-Centre Bush/C1978full-92X63-92N44.jpg" "/home/patrick/Maps/References/Region - Otago-Southland/Section - Makarewa-Centre Bush/C1978full-92X63x1-92N43x1.jpg"

  • however when the layers are loaded into the layers list they appear in the reverse order to this.

The reason for the behaviour appears to be the same as in Gimp which behaves the same way. That is, the first layer is loaded first. The second layer is then loaded into the layer list above the previously opened layer, and so on.

The expectation from the user perspective, however, is that the subsequent layers would be loaded into the layer list below the previously opened layer.

Also available in: Atom PDF