[Qgis-developer] Field Menu Range settings odd behaviour

roy roy royroge at outlook.com
Wed Feb 22 08:44:45 PST 2017


Hi,

working with Field menu range in QGIS 2.18 I notice that the problem

is still there despite the introduction of costraint:

say that i want to set a range for an integer field
called "numfield" with

min value 1

max value 5

step 1

at this point i would expect that QGIS only accepts "1 2 3 4 5" and
throw an error if i insert 6

to enforce this behaviour I set some costraints:

not NULL

"numfield" >= 1 AND "numfield" <=5

while editing infact if i erroneously insert "6" QGIS will not complain
and will happily save the maximun value for range (i.e. 5) i find this odd
and a way to defeat the hole pourpose of my setting.

What is really happening is that QGIS automatically change the value I insert
with the max range value which is clearly an error that leads to data corruption;

if someone can confirm i'll open a Bug report.

Thanks, Roy.




Il 21/11/2016 09:40, Matthias Kuhn ha scritto:
> Hi,
>
> With QGIS 2.16 constraints have been introduced that are able to check
> entered values and provide feedback as well as prevent the user from
> clicking ok:
>
> https://www.qgis.org/en/site/forusers/visualchangelog216/index.html#feature-constraints-on-widgets
>
> All the best
> Matthias
>
> On 11/21/2016 09:18 AM, roy roy wrote:
>> Hi:)
>> Anybody interest in this issue?
>>
>> Il 17/11/2016 11:36, roy roy ha scritto:
>>> Hi,
>>>
>>> working with field menu (QGIS 2.14.8 OSGEO4W64) i noted a behaviour that
>>> i find misleading and
>>>
>>> could potentially lead to severe errors in edit session:
>>>
>>> say that i want to set a range for an integer field with
>>>
>>> min value 1
>>>
>>> max value 5
>>>
>>> step 1
>>>
>>> at this point i would expect that QGIS only accepts "1 2 3 4 5" and
>>> throw an error if i insert 6
>>>
>>> while editing; infact if i erroneously insert "6" QGIS will not complain
>>> and happily save the
>>>
>>> maximun value for range (i.e 5) i find this odd and a way to defeat the
>>> hole pourpose of my
>>>
>>> setting.
>>>
>>> I think this is a bug, can anyone confirm? If this is the expected
>>> behaviour i think the logic
>>>
>>> of this tool is flawed because QGIS should not insert values at his own
>>> will but should instead warn the
>>>
>>> user that the value is outside the expected range.
>>>
>>>
>>> Thanks, Roy.
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Qgis-developer mailing list
>>> Qgis-developer at lists.osgeo.org
>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer



More information about the Qgis-developer mailing list