Bug report #5862

Updating composer label text via python - problem with Item Properties panel

Added by James Stott over 8 years ago. Updated over 8 years ago.

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

Description

I am writing a plugin that replaces the text of a composer label based on its itemID. The text in the label says "Original text" in this example.

When I change the text of the label using:

item.setText("Hello World")

the label changes on the composer but the text in the Item Properties panel for the label doesn't, it stays as "Original text".

If I call item.displayText() before and after I change the label text this returns "Hello World".

How do I get the text to change in the Item Properties panel? Using qgis 1.8 and 1.9

If I save the project and reopen it, it displays the changed text "Hello World".

I have attached a screenshot to demonstrate.

Composer_Problem.jpg (198 KB) James Stott, 2012-06-25 07:24 AM

History

#1 Updated by Marco Hugentobler over 8 years ago

  • Status changed from Open to Closed

Update should work with 4e36df067. Please test and report back

#2 Updated by James Stott over 8 years ago

thanks for looking at this. I will test once osgeo4w updates to a new version and let you know.

#3 Updated by James Stott over 8 years ago

It works with this mornings update.

Thanks for fixing this.

Any chance this can make its way into the next release (1.8.1?) so I can utilise it on a stable version of QGIS rather than having to wait for 1.9/2.0 to come out?

Also available in: Atom PDF