Bug report #14203

representation for Checked state doesn't work for boolean widgets

Added by Tudor Bărăscu almost 9 years ago. Updated almost 9 years ago.

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

Description

I'm trying to add a Postgis layer that has columns with boolean values and I want to display each of them using different values, e.g. Active - Inactive, Yes - No etc.

By making the settings in the "representation for check state" area, I noticed that they aren't propagated to the table and I only see 't' and 'f'.

There is however a time when the values I've setup appear.. when I click the value in the attribute table..

As a workaround I can setup a value map type of widget, but that messes up the custom ui's for those who use them (and I do).

I tested with master and 2.12.3 on Debian Stretch

History

#1 Updated by Tudor Bărăscu almost 9 years ago

  • Target version set to Version 2.14

#2 Updated by Giovanni Manghi almost 9 years ago

  • Status changed from Open to Feedback

what is the datatype of the columns your are using for the boolean widget?

#3 Updated by Tudor Bărăscu almost 9 years ago

Hi Giovanni,

It's boolean (I already wrote that in the issue definition).
My expectations were/are: for a boolean field, I can setup whatever is displayed in the attribute table etc. for the True and for False values.
Am I having wrong expectations?

If so, what is the purpose for the "representation for Checked state" of the checkbox widget.

Tested on Windows also and QGIS 2.8.6.1

#4 Updated by Giovanni Manghi almost 9 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

Hi Tudor,

Am I having wrong expectations?

yes. If the datatype is boolean then the only thing you can write into the column is t/f. You can use other datatypes and the "boolean" edit widget to have the users write whatever you want using the checkbox in the qgis table of attributes.

#5 Updated by Tudor Bărăscu almost 9 years ago

Thanks for the info, it's clear now.

From my perspective, as the widget knows it has a boolean field, I could set it up to display anything I wanted as behind the scenes it would have saved 't' and 'f'.

It's a nice to have feature then.

All the best!

Tudor

Also available in: Atom PDF