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.04k stars 2.92k forks source link

Recent Display Expressions on an Editor Form Don't Take Effect When Selected #47066

Open ttreker opened 2 years ago

ttreker commented 2 years ago

What is the bug or the crash?

Setting up custom display expressions on an editor in form mode and using them has a bug. If having setup several such expressions, one then selects one of the previous display expressions from the drop-down list, it will show this selected expression as the one having been selected but the display won't reformat to it. It remains formatted per the previous expression.

Steps to reproduce the issue

  1. Create a new project with a clean profile.
  2. Create a feature LineString layer in Spatialite with a few text fields.
  3. On the Layer Properties on the Attributes Form turn on the Drag and Drop Designer.
  4. Leave the default form as-is and save and close the properties.
  5. Throw in an OSM background for orientation and navigate to an area of choice (this step is not necessary to demonstrate the issue).
  6. Add three or four features with all the fields populated with differing data and save them.
  7. Bring up the layer editor and put it in form mode.
  8. Define a few differing display expressions and apply them as you define them. (you can save them or not in User Expressions for future reference).
  9. As created per above the expressions will take effect and reformat the display.
  10. Now, from the drop down recent expressions list select one of the previous expressions.
  11. This expression will show as the current expression but the display will remain displaying according to the last selected expression.
  12. You can bring up the Expression Editor, clear it, select one of your previous expressions from the Recent (Generic) expressions list into the Expression Editor, select OK and it will properly apply showing the desired view.

So there is a cumbersome work-around but it is less than ideal.

In Pictures

Default Display on name Expression

Created a Custom Display Expression

Applied the Custom Display Expression

Failed Selection

Versions

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

QGIS version | 3.22.3-Białowieża | QGIS code revision | 1628765ec7 -- | -- | -- | -- Qt version | 5.15.2 Python version | 3.9.2 GDAL/OGR version | 3.2.2 PROJ version | 7.2.1 EPSG Registry database version | v10.008 (2020-12-16) GEOS version | 3.9.0-CAPI-1.16.2 SQLite version | 3.34.1 PDAL version | 2.2.0 PostgreSQL client version | 13.5 (Debian 13.5-0+deb11u1) SpatiaLite version | 5.0.1 QWT version | 6.1.4 QScintilla2 version | 2.11.6 OS version | Debian GNU/Linux 11 (bullseye)   |   |   |   Active Python plugins grassprovider | 2.12.99 sagaprovider | 2.12.99 db_manager | 0.1.20 MetaSearch | 0.3.5 processing | 2.12.99

Operating System: Debian GNU/Linux 11 KDE Plasma Version: 5.20.5 KDE Frameworks Version: 5.78.0 Qt Version: 5.15.2 Kernel Version: 5.10.0-11-amd64 OS Type: 64-bit Processor: 1 × Intel® Core™ i7-9850H CPU @ 2.60GHz Memory: 15.6 GiB of RAM Graphics Processor: llvmpipe

Supported QGIS version

New profile

Additional context

No response

gioman commented 2 years ago

Confirmed here too on 3.22.3 on Win10.