qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.5k stars 2.99k forks source link

Value relation / Value map widgets - List of values is always ordered even if "Order by value" is NOT marked #50445

Closed theudebert closed 2 years ago

theudebert commented 2 years ago

What is the bug or the crash?

In value relation widgets and value map widgets, the list of values in the dropdown list at attribute form is always ordered. Even if the option "Order by value" is NOT marked.

Steps to reproduce the issue

My list of keys + values. Watch the order of the key / value pairs! I want QGIS to show me THIS Order in the widget! screen01

Settings for the value realtion widget screen02

Resulting dropdown list in attribute form. Watch the order of the key / value pairs! They are ordered by value! screen03

Versions

QGIS version | 3.22.11-Białowieża | QGIS code revision | 106d33d7 -- | -- | -- | -- Qt version | 5.15.3 Python version | 3.9.5 GDAL/OGR version | 3.5.1 PROJ version | 9.1.0 EPSG Registry database version | v10.074 (2022-08-01) GEOS version | 3.10.3-CAPI-1.16.1 SQLite version | 3.38.1 PDAL version | 2.4.3 PostgreSQL client version | 14.3 SpatiaLite version | 5.0.1 QWT version | 6.1.6 QScintilla2 version | 2.13.1 OS version | Windows 10 Version 2009   |   |   |   Active Python plugins autoSaver | 2.6 DigitizingTools | 1.5.1 LAStools | 1.4 NNJoin | 3.1.3 ParallelLineConstruction | 0.2 powerpan | 2.0 QuickWKT | 3.1 slyr_community | 4.0.2 SpreadsheetLayers | 2.0.1 db_manager | 0.1.20 processing | 2.12.99 QGIS version 3.22.11-Białowieża QGIS code revision [106d33d7](https://github.com/qgis/QGIS/commit/106d33d7) Qt version 5.15.3 Python version 3.9.5 GDAL/OGR version 3.5.1 PROJ version 9.1.0 EPSG Registry database version v10.074 (2022-08-01) GEOS version 3.10.3-CAPI-1.16.1 SQLite version 3.38.1 PDAL version 2.4.3 PostgreSQL client version 14.3 SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009 Active Python plugins autoSaver 2.6 DigitizingTools 1.5.1 LAStools 1.4 NNJoin 3.1.3 ParallelLineConstruction 0.2 powerpan 2.0 QuickWKT 3.1 slyr_community 4.0.2 SpreadsheetLayers 2.0.1 db_manager 0.1.20 processing 2.12.99 ### Supported QGIS version - [X] I'm running a supported QGIS version according to the roadmap. ### New profile - [X] I tried with a new QGIS profile ### Additional context _No response_
elpaso commented 2 years ago

The option allows to order by value instead of key, in your case the order is the same.

theudebert commented 2 years ago

I know the option allows to order by value. And from my point of view, the list should NOT be ordered by values, when the option is not activated. But the list is ordered by value anyway!

elpaso commented 2 years ago

What you are seeing is the default order (by key). In you test case the order by key and the order by value are the same, the checkbox has no effect.

To make an effective test you should use something like this:

Key Value a b b a

and then check if the checkbox makes a difference.