Bug report #17617

QGIS master: is_layer_visible () does not update automatically

Added by salvatore fiandaca almost 3 years ago. Updated about 2 years ago.

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

Description

I used the function is_layer_visible () to change the appearance of the labels, but you need to do a manual refresc, it does not update automatically.

N3.jpg - screenshot (178 KB) salvatore fiandaca, 2017-12-04 10:19 AM

History

#1 Updated by Giovanni Manghi almost 3 years ago

  • Status changed from Open to Feedback

Is this a regression (works as expected in 2.18.* or earlier)?

#2 Updated by Giovanni Manghi almost 3 years ago

  • Subject changed from QGIS master d0e927a84f - is_layer_visible () does not update automatically to QGIS master: is_layer_visible () does not update automatically

#3 Updated by Giovanni Manghi almost 3 years ago

  • Category changed from Symbology to Labelling

#4 Updated by Giovanni Manghi over 2 years ago

Feedback needed here. Is a regression in QGIS 3 (did it worked as expected in QGIS 2)?

#5 Updated by salvatore fiandaca over 2 years ago

In QGIS 2, the is_layer_visible function does not exist; so it's not a regression.

#6 Updated by Giovanni Manghi about 2 years ago

Still true on the latest master?

#7 Updated by salvatore fiandaca about 2 years ago

Giovanni Manghi wrote:

Still true on the latest master?

yes, it is still true in the last master - gnu / linux mint 19
as soon as I can I try in win 10

#8 Updated by Giovanni Manghi about 2 years ago

  • Category changed from Labelling to Expressions
  • Operating System deleted (win 10 64b)
  • Status changed from Feedback to Open

#9 Updated by Nyall Dawson about 2 years ago

I think this is a "wont fix". Expressions in QGIS can be very complex and adding a method to determine the dependencies of an expression would be almost impossible. For instance, there's also expressions which fetch features from other layers, expressions which calculate aggregates from other layers, expressions which use related features, etc. We'd also need to consider all these cases and force a refresh whenever any of the dependencies change. But then there's also expressions which rely on variables too. Then there's also the need to consider everywhere expressions can be used which may need refreshing... e.g. canvas renders, layout items, virtual fields, data defined properties, etc.

I think given the extreme complexity of solving this and the easy workaround (refresh the canvas manually) it should be tagged as "wontfix"

#10 Updated by salvatore fiandaca about 2 years ago

Nyall Dawson wrote:

I think this is a "wont fix". Expressions in QGIS can be very complex and adding a method to determine the dependencies of an expression would be almost impossible. For instance, there's also expressions which fetch features from other layers, expressions which calculate aggregates from other layers, expressions which use related features, etc. We'd also need to consider all these cases and force a refresh whenever any of the dependencies change. But then there's also expressions which rely on variables too. Then there's also the need to consider everywhere expressions can be used which may need refreshing... e.g. canvas renders, layout items, virtual fields, data defined properties, etc.

I think given the extreme complexity of solving this and the easy workaround (refresh the canvas manually) it should be tagged as "wontfix"

Thanks for the reply

#11 Updated by Giovanni Manghi about 2 years ago

So... closing?

#12 Updated by salvatore fiandaca about 2 years ago

Giovanni Manghi wrote:

So... closing?

for me, Nyall explanation is ok

#13 Updated by Giovanni Manghi about 2 years ago

  • Resolution set to wontfix
  • Status changed from Open to Closed

Also available in: Atom PDF