It is just an ordinary text field on a composer layout I think. I don't use the atlas functionality.

On 4/08/21 10:19 am, Nyall Dawson wrote:
On Wed, 4 Aug 2021 at 06:17, Patrick Dunford <enzedrailm...@gmail.com> wrote:
Good day

I am wishing to create a value in a field on a composer layout that
reads the value of another field on the layout and calculates a value to
be displayed.

For example, I have an existing field called Filename on the layout and
in a python script running in the main window console, I have this code
that reads the value of the Filename field as follows:

layoutTitle = "Landscape 16:9 Header Nav Copyright Filename 2021"

project = QgsProject.instance()
projectLayoutManager = project.layoutManager()
layout = projectLayoutManager.layoutByName(layoutTitle)

fileNameLabel = layout.itemById('Filename')
fileNameText = fileNameLabel.text()


Obviously I am hoping that doing this from a field within the layout
that reads another field on the same layout will be much simpler than
the above. How exactly would I achieve that?
Just to clarify -- by "field" do you mean "a field value from the
atlas layer", or "a text label item"?

Nyall
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to