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

[Layout] Allow use of item variables to change an item's own properties #26657

Open
qgib opened this issue Apr 19, 2018 · 5 comments
Open

[Layout] Allow use of item variables to change an item's own properties #26657

qgib opened this issue Apr 19, 2018 · 5 comments
Labels
Feature Request Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks

Comments

@qgib
Copy link
Contributor

qgib commented Apr 19, 2018

Author Name: Harrissou Santanna (@DelazJ)
Original Redmine Issue: 18770
Affected QGIS version: 3.5(master)
Redmine category:map_composer/printing


Let's add a map item and try to change its position using data-defined properties.
If I write expression like @case when @layout_pageheight >210 then 10 else 40 end@ for the X position data-defined button, then anytime i change the page size crossing the 210, I can see the map item moving in the layout. Great!
Now if i write @case when @map_scale >5000 then 10 else 40 end@ for the same property and change the scale of the map item, it does not move... until something else triggers its displacement ie:

  • I use the select/move item button to move the item
  • I manually change the X position spinbox value
  • or I have another call (let's say the one with layout_pageheight) that triggers a movement

In all these case, it will move to the data-defined position.

I checked with other internal variable of the map item (map_rotation, eg) and other items (eg, label item with its rotation data-defined button using item_id variable) and anytime I use an interval variable to set a property of the item, no change occurs dynamically.

This makes the layout item's variables a bit useless (as you can not even call them from another item properties in 2.18).

Affects both 2.18 and 3.1 (master)

@qgib
Copy link
Contributor Author

qgib commented Apr 19, 2018

Author Name: Nyall Dawson (@nyalldawson)


Other actions trigger a refresh too - e.g. clicking refresh, changing to a new atlas feature, exporting the layout.

@qgib
Copy link
Contributor Author

qgib commented Apr 19, 2018

Author Name: Harrissou Santanna (@DelazJ)


I could have bet that I tried the refresh button unsuccessfully but i'd have lost... So yes, my list was not complete.
Anyway, good to see that when output time comes, the expressions are applied.

@qgib
Copy link
Contributor Author

qgib commented Jan 20, 2019

Author Name: Jürgen Fischer (@jef-n)


Please test with QGIS 3.4 - QGIS 2.18 reached it's end of life.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jan 21, 2019

Author Name: Harrissou Santanna (@DelazJ)


Confirmed on master 3.5. Using @map_scale does not visually trigger the map item placement in my example; you may need to eg refresh the dialog beforehand.


  • version was changed from 2.18.18 to 3.5(master)
  • status_id was changed from Feedback to Open

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks labels May 25, 2019
@nyalldawson nyalldawson changed the title [Layout] Using an item variable to change its own properties dynamically does not work [Layout] Allow use of item variables to change an item's own properties Sep 27, 2019
@nyalldawson nyalldawson added Feature Request and removed Bug Either a bug report, or a bug fix. Let's hope for the latter! labels Sep 27, 2019
@nyalldawson
Copy link
Collaborator

This is a feature request, not a bug -- it relates to other open feature requests concerning handling of dependencies in layout expressions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks
Projects
None yet
Development

No branches or pull requests

2 participants