[QGIS-Developer] Typed Variables?

Matthias Kuhn matthias at opengis.ch
Wed Jun 10 09:32:45 PDT 2020


Hi Andreas,

If required, the variable UI (and serialization to ini/project/...) 
could made typable.

But for this use case, add a variable with 0 (or 1) and use

CASE WHEN @debug THEN
   'We are debugging'
ELSE
   'No debug'
END

That should just work

Matthias

On 6/10/20 5:26 PM, Andreas Neumann wrote:
>
> Hi,
>
> I have a question about the variables that can be defined on different 
> scopes. They are most of the times (or always?) strings, if I manually 
> define them - right? Some of the automatic variables might be of a 
> different type (like date, layer, etc.)
>
> Can I also manually define a "typed" variable? E.g. a boolean true 
> instead of 'true' as a string?
>
> That way I could directly use variables without having to add CASE 
> WHEN END statements ...
>
> My use case would be to have a boolean "debugging" variable. If it is 
> set to true, then certain parts of the form with internal IDs would be 
> visible, if set to false, they would be hidden.
>
> Thanks,
>
> Andreas
>
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200610/17bb2cf8/attachment.html>


More information about the QGIS-Developer mailing list