Feature request #10544

Allow math expressions in print composer size and position controls

Added by Alexandre Neto over 8 years ago. Updated over 4 years ago.

Category:Map Composer/Printing
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:18952


One very handy feature that many design software have is the ability to use simple math expressions in size and position controls fields.

For instance, if you have an item with a height of x, and you want to double it's height, you would be able to simply type after the x value '* 2' and press enter. The control would solve the math expression and set the new value. The same could be done with +, - , / and even %

Associated revisions

Revision 7400106e
Added by Nyall Dawson almost 8 years ago

[FEATURE] Evaluate expressions entered in QgsDoubleSpinBox

Allows entry of QGIS expressions into the spin box. The expression
is evaluated on enter or loss of focus and then discarded.

(refs #10544)

Revision dfe79807
Added by Nyall Dawson almost 8 years ago

Flip all composer double spin boxes to QgsDoubleSpin (refs #10544)

Add clear buttons to applicable properties.

Revision 697ef510
Added by Nyall Dawson almost 8 years ago

Also evaluate expressions entered in QgsSpinBox

and flip all composer spin boxes to QgsSpinBox (refs #10544)


#1 Updated by Andreas Neumann over 8 years ago

There is an ongoing contract (a swiss province and Nyall Dawson) that will implement expression support for page resizing in Atlas serial printing.

This is kind of similar to your request - but slightly different. I guess you need just a temporary expression to calculate stuff, not in the atlas printing context.

#2 Updated by Nyall Dawson over 8 years ago

Yeah - that's what I'm thinking. A temporary expression which evaluates once and then updates the text box with the evaluated value.

#3 Updated by Giovanni Manghi over 5 years ago

  • Easy fix? set to No

#4 Updated by Alexandre Neto over 5 years ago

I had the feeling that this was done already. Am I wrong?

#5 Updated by Giovanni Manghi over 5 years ago

  • Description updated (diff)
  • Status changed from Open to Feedback

#6 Updated by Nyall Dawson over 5 years ago

Not completely - there's still some widgets which use line edits instead of spin boxes and I'd like to allow math in these too

#7 Updated by Alexandre Neto over 4 years ago

Any changes on this? Are there still widgets not allowing math?

I wouldn't mind help on that.

Also available in: Atom PDF