Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full row conditional formatting formats wrong full rows #34122

Closed
uclaros opened this issue Jan 29, 2020 · 4 comments · Fixed by #34305
Closed

Full row conditional formatting formats wrong full rows #34122

uclaros opened this issue Jan 29, 2020 · 4 comments · Fixed by #34305
Assignees
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority

Comments

@uclaros
Copy link
Contributor

uclaros commented Jan 29, 2020

Describe the bug
In the attribute table, full row conditional formatting formats wrong rows when the attribute table is sorted and then refreshed. Some rows that should be formatted are not, and some that should not be, they are.

How to Reproduce
Open the attribute table from the attached project, sort by some column and hit refresh.
The highlight condition is "top" % 10 = 0 and "right" % 10 = 0 and the rows that should be highlighted are the ones with "shouldbegreen" = 1.

QGIS and OS versions
Happens on qgis master, but also on older builds like 3.8, both linux and windows. Haven't tested others.

Additional context
Could be the same bug as #28352, though no edits are required to reproduce it so I opened a new one.

Here is a sample project and dataset. I added lots of rows so it's easier for the bug to appear.
bug.zip

@uclaros uclaros added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 29, 2020
@gioman
Copy link
Contributor

gioman commented Jan 30, 2020

Confirmed also here. This is bad as it could lead to wrong and potentially dangerous decisions made by looking at color codes...

@luipir
Copy link
Contributor

luipir commented Jan 30, 2020

FYI @NathanW2

@NathanW2
Copy link
Member

NathanW2 commented Jan 30, 2020 via email

@uclaros
Copy link
Contributor Author

uclaros commented Jan 30, 2020

It's easy to miss it since everything works perfectly until you need to refresh.

@elpaso elpaso self-assigned this Feb 5, 2020
elpaso added a commit to elpaso/QGIS that referenced this issue Feb 5, 2020
Fixes qgis#34122

The original implementation was storing the styles
in an hash keyed by the row number from the model
index, but that one changes when the table is reloaded.

By using feature id as a key instead, the style association
with the feature is maintained through sort/reload
operations.
nyalldawson pushed a commit that referenced this issue Feb 5, 2020
Fixes #34122

The original implementation was storing the styles
in an hash keyed by the row number from the model
index, but that one changes when the table is reloaded.

By using feature id as a key instead, the style association
with the feature is maintained through sort/reload
operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants