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

add Y page offset expression #37568

Merged
merged 2 commits into from
Aug 21, 2020

Conversation

olivierdalang
Copy link
Contributor

Description

This PR adds the layout_pageoffsets expression, to be used in the layout composer. The expression returns an array of Y coordinates of the top of each page in the layout, allowing to dynamically position items on pages in a context where page sizes may change.

Example to set an item at 2.5mm from the top of page 2 (for the data-defined position Y of a map item) :

@layout_pageoffsets[1] + 2.5

This constitutes a workaround for #37567

@stale
Copy link

stale bot commented Jul 20, 2020

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible
    In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request.
    If there is no further activity on this pull request, it will be closed in a week.

@stale stale bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jul 20, 2020
@m-kuhn
Copy link
Member

m-kuhn commented Jul 21, 2020

@nyalldawson how does that look to you?

@stale
Copy link

stale bot commented Jul 29, 2020

While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist.

@stale stale bot closed this Jul 29, 2020
@olivierdalang
Copy link
Contributor Author

Not stale

@olivierdalang olivierdalang reopened this Jul 29, 2020
@stale stale bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jul 29, 2020
@m-kuhn
Copy link
Member

m-kuhn commented Jul 29, 2020

this looks good to me, I'd like to merge end of the week if there are no objections.

@nyalldawson
Copy link
Collaborator

LGTM - but can you add a unit test please?

@nyalldawson nyalldawson added Expressions Related to the QGIS expression engine or specific expression functions Feature Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks labels Aug 4, 2020
@nyalldawson nyalldawson changed the title [layout expressions] add Y page offset expression add Y page offset expression Aug 4, 2020
@zacharlie zacharlie added the Changelog Items that are queued to appear in the visual changelog - remove after harvesting label Aug 4, 2020
@nyalldawson nyalldawson added the Requires Tests! Waiting on the submitter to add unit tests before eligible for merging label Aug 17, 2020
this is useful for dynamically position items
relative to pages in multi-pages layouts
@olivierdalang
Copy link
Contributor Author

@nyalldawson Done, is it ok like this ?

@olivierdalang olivierdalang removed the Requires Tests! Waiting on the submitter to add unit tests before eligible for merging label Aug 19, 2020
@nyalldawson nyalldawson merged commit 7b91f79 into qgis:master Aug 21, 2020
@zacharlie zacharlie added ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Aug 28, 2020
@olivierdalang olivierdalang deleted the layout_pageoffset_expression branch October 15, 2020 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChangelogHarvested This PR description has been harvested in the Changelog already. Expressions Related to the QGIS expression engine or specific expression functions Feature Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants