[Qgis-user] Custom form checkbox widget

Bernhard Ströbl bernhard.stroebl at jena.de
Wed Jan 13 23:37:14 PST 2016


Hi Ross,

to accomodate many fields you may customize the DataDrivenInputMask and 
use tabs to sort your fields in a logical order [1]

If you store only true/false values you should use a boolean field 
(IMHO) and not an integer or varchar.

Bernhard

[1] 
https://github.com/bstroebl/DataDrivenInputMask/wiki/Configuration-of-masks

Am 13.01.2016 um 16:14 schrieb McDonaldR:
> Bernhard,
>
> That is excellent!  That should meet most of our form requirements bar those with specific layouts to accommodate many fields.
>
> I discovered that the Checkbox edit widget needed different values in the settings depending on the field type in the PostgreSQL table.
>
> For example:
>
> field1 – varchar
> field2 – integer
> field3 – Boolean
>
> in QGIS set the edit widget on each field to CHECKBOX
>
> field1 – TRUE/FALSE
> field2 – 1/0
> field3 – t/f
>
> Then it works as expected.
>
> -----Original Message-----
> From: Qgis-user [mailto:qgis-user-bounces at lists.osgeo.org] On Behalf Of Bernhard Ströbl
> Sent: 13 January 2016 14:11
> To: qgis-user at lists.osgeo.org
> Subject: Re: [Qgis-user] Custom form checkbox widget
>
> Hi Ross,
>
> if you are using PostgreSQL as data store, you might want to give my
> plugin DataDrivenInputMask [1] a try. This should make custom forms
> unnecessary.
>
> Bernhard
>
> [1] http://plugins.qgis.org/plugins/DataDrivenInputMask/
>
> Am 13.01.2016 um 15:01 schrieb McDonaldR:
>> Hi List
>>
>> I have a table in PostGIS with a Boolean field which allows for
>> TRUE/FALSE, t/f, true/false, y/n, yes/no, on/off, 1/0 values.
>>
>> I have a custom form in QGIS for that table and the edit widget for that
>> field is set to checkbox.  In the checkbox widget settings there are two
>> options for
>>
>> ·Representation for checked state:
>>
>> ·Representation for unchecked state:
>>
>> The custom form only shows the correct value in the pop-up form if the
>> values above are set to ‘t’ and ‘f’ respectively.  If I set them to any
>> of the other options the checkbox in the form is always blank even
>> though the value in the field in the table is populated with TRUE or FALSE.
>>
>> So, the question is whether this is a Qt or QGIS enforced behaviour?
>>
>> If it is, and the only options for checked/unchecked state are t/f, then
>> shouldn’t they be set by default?
>>
>> I am using QGIS 2.12.2 on Win 7 32bit with PostgresSQL 9.2.14 and
>> PostGIS 2.1.8.
>>
>> Thanks in advance
>>
>> Ross
>>
>> *Ross McDonald *|**GIS Data Coordinator | Resources Department, IT
>> Division | Angus Council, Angus House, Orchardbank Business Park,
>> Forfar, DD8 1AT
>>
>> T: *01307 476419* | F: 01307 476401 | E: mcdonaldr at angus.gov.uk
>> <mailto:mcdonaldr at angus.gov.uk> **
>>
>> This message is strictly confidential. If you have received this in
>> error, please inform the sender and remove it from your system. If
>> received in error you may not copy, print, forward or use it or any
>> attachment in any way. This message is not capable of creating a legal
>> contract or a binding representation and does not represent the views of
>> Angus Council. Emails may be monitored for security and network
>> management reasons.Messages containing inappropriate content may be
>> intercepted. Angus Council does not accept any liability for any harm
>> that may be caused to the recipient system or data on it by this message
>> or any attachment.
>>
>>
>>
>> __________ Information from ESET Mail Security, version of virus
>> signature database 12862 (20160113) __________
>>
>> The message was checked by ESET Mail Security.
>> http://www.eset.com
>>
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>
>
> __________ Information from ESET Mail Security, version of virus signature database 12862 (20160113) __________
>
> The message was checked by ESET Mail Security.
> http://www.eset.com
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>
> This message is strictly confidential. If you have received this in error, please inform the sender and remove it from your system. If received in error you may not copy, print, forward or use it or any attachment in any way. This message is not capable of creating a legal contract or a binding representation and does not represent the views of Angus Council. Emails may be monitored for security and network management reasons. Messages containing inappropriate content may be intercepted. Angus Council does not accept any liability for any harm that may be caused to the recipient system or data on it by this message or any attachment.
>

-- 
Bernhard Ströbl
Anwendungsbetreuer GIS

Kommunale Immobilien Jena
Am Anger 26
07743 Jena

Tel.: 03641 49- 5190
E-Mail: bernhard.stroebl at jena.de
Internet: www.kij.de


Kommunale Immobilien Jena
Eigenbetrieb der Stadt Jena
Werkleiter: Karl-Hermann Kliewe


__________ Information from ESET Mail Security, version of virus signature database 12866 (20160114) __________

The message was checked by ESET Mail Security.
http://www.eset.com





More information about the Qgis-user mailing list