[Qgis-developer] Expressions in print composer

Andreas Neumann a.neumann at carto.net
Tue Sep 25 02:13:42 PDT 2012


 Hi Hugo,

 I am open to replacements of $CURRENT_DATE(). We'd need to make sure, 
 however, that the new proposal of [% $now %] would also allow a way to 
 set the date format, e.g. german date, french date, english date or some 
 specific user defined format.

 Is your proposed change in line with what other text replacements of 
 the new expression builder do, e.g. in the label placement?

 Would the label in print composer gain a new GUI that would allow the 
 user to specify an expression?

 How about backwards compatibility of $CURRENT_DATE() ? Although it 
 wasn't well documented, I taught a lot of people about using 
 $CURRENT_DATE() - would the old syntax still work with the new proposal?

 It would be best if Marco H. could comment, since he implemented the 
 current label object in print composer.

 Thanks,
 Andreas

 On Tue, 25 Sep 2012 11:01:05 +0200, Hugo Mercier wrote:
> Hi all,
>
> I am currently working on the integration of the Atlas plugin into 
> the core.
>
> I noticed the "replaceDateText" method of the QgsComposerLabel class
> that is aimed at dealing with the very specific "$CURRENT_DATE"
> expression and replace it with ... the current date.
>
> For the sake of homogeneity and considering we have a powerful way of
> handling expressions, why not consider text in labels where
> expressions are surrounded by '[%' and '%]'. So $CURRENT_DATE would 
> be
> replaced by date manipulations based on '[% $now %]' ?
>
> The other change I propose is to enhance the optional "substitution
> map" that can be set on an expression text. It is used to define
> special column names like $layerid, $CWD and so on when using Actions
> on a layer. Until now, they are used for text replacement and cannot
> be used within an expression.
> My proposal is to make them first-class citizen within the grammar.
>
> I have a local branch with these proposed changes. If there is no
> special objections, I am about to propose them.

-- 
 --
 Andreas Neumann
 Böschacherstrasse 10A
 8624 Grüt (Gossau ZH)
 Switzerland


More information about the Qgis-developer mailing list