qfieldsync
qfieldsync copied to clipboard
QGis Extension QField : changing type numeric
Hi,
A QGis project is connected to 2 postgres/postgis layers : eu_grille_pg09 and eu_chambre_pg10.
This layers contain char attributes and numeric attributes, for exmple 'alt_couv' defined with double precision in postgres.
Extension QField Sync "transform" this QGis project in QField project with gpkg data ... *et là c'est le drame" ... the numeric attributes are not decimal :
Impossible to enter an altitude without decimal numbers.
Any one for a solution ?
Thank's a lot and best regards.
Gérard Sollberger HKD Géomatique Vaud SA
My environnement :
QGis 3.12.1 QField Sync extension : 3.1.6 postgres 9 et 10 QField on dive Mobile : 1.4.4 Device mobile : Samsung Galaxy Tab Active 2 tmp-qfield.zip
Hi
Can you check on "formulaire d'attributs" if "text edit" or "range" widgets are used? In the latest version only "range" will work for doubles (but this will change again in future versions and "text edit" support for numeric will be back).
Hi Matthias, I've tried the 2 options (text edit and range) ... both doesn't work :-( On QField, the comma sign in the virtual keyboard is not "usable".
Any other idea ?
Best regards.
Gérard
Use the point below the OK?
it doesn't work ...
this is he configuration of the attribute "profondeur" in the qgs file, used by qfield
Can you test the "simple bee farming" demo project, open the form for a bee hive and edit "yearly harvest (kg)". Does it work there?
where may i download this proejct ?
It's preinstalled in qfield, so should already be there.
It can also be downloaded from https://github.com/opengisch/QField/tree/master/resources/demo_projects
OK, thanks, I've tried this project with my Samsung Tab Active 2 and my Samsung S8 phone ... the coma isn't usable ...
I've been testing this now with two different releases and I also see strange effects.
I do have a ,
on my keyboard which is replaced with nothing on save (e.g. 33,5
-> save -> 335
).
I also do have a .
on my keyboard. If I press it, nothing happens (i.e. the number in the text edit stays unchanged).
the same ...
I have a different behavior on 1.4.4 and on master than you have. Comma is disabled like @gsollberger described, but I can enter dots. Why @m-kuhn has the same behavior on commas but cannot enter dots I don't know. Maybe language settings? But anyway, I think the behavior on Matthias system with comma is what it is otherwise with dots.
My behavior on master:
- (int) Range widget: removes the dot during entering again - since it's not allowed - value without decimals stored
- (int) Text Edit widget: accepts dots but on save it rounds the value (should react like range, this is the bug I mentioned here https://github.com/opengisch/QField/commit/fbb0c9759139420fe1683255e75ae1b035970fc3#r39657048 but it does not have anything to do with this issue) - value without decimals stored
- (real) Range widget: dots accepted - value with decimals stored
- (real) Text Edit widget: dots accepted - value with decimals stored
My behavior on 1.4.4 is like it should:
- (int) Range widget: removes the dot during entering again - since it's not allowed - value without decimals stored
- (int) Text Edit widget:removes the dot during entering again - since it's not allowed - value without decimals stored
- (real) Range widget: dots accepted - value with decimals stored
- (real) Text Edit widget: dots accepted - value with decimals stored
So I think I cannot reproduce @gsollberger issue. I can enter decimals in your project with 1.4.4
Do I misunderstand something? :thinking:
Here is the project I used to test integer range, integer text edit, double range and double text edit. Maybe you want to have a try @gsollberger
Btw. the demo projects yearly harvest field is integer - so the behavior at @m-kuhn covers mine (just having comma but dot instead)...
Found a lead. When setting my phone to "Français (Suisse)" I can reproduce the issue of @gsollberger
No solution yet.
Apparently on the swiss-french locale configured, still the dot is displayed to enter as separator. But the DoubleValidator
does not accept it. I had no success in setting the DoubleValidator
s locale: Qt.locale("C")
to set the validators locale setting to the C locale.
Additionally I tried to set this in main.cpp, but it has no influence. The decimalPoint
is still a comma after:
setlocale(LC_NUMERIC, "C");
QLocale::setDefault( QLocale::system() );
See a possible workaround here https://github.com/opengisch/qfield/pull/1047
@gsollberger short summary:
There is a problem with entering numeric (decimal) values. In some translations/locales. As a short term solution you can set your device to English. We will be looking into a fix for this. If you would like to speed up things, please contact [email protected].
Hi, Yeah ! it works ;-) I'll configure my device in english . Thank's for the workaround and Best regards.
Gérard
@gsollberger can we ask you to test the apk in https://github.com/opengisch/QField/pull/1047#issuecomment-654216140 ? Thank you!
Mais en français :-)
Pardon, David. @gsollberger est-ce que je peux vous demander de tester si l'apk dans https://github.com/opengisch/QField/pull/1047#issuecomment-654216140 marche? Merci!
I actually wanted to say, that the tests have to be done with a device set to french. But I guess it was clear for both or you before. Sorry, for the confusion. :slightly_smiling_face:
Hi, Sorry for my very late answer ... i wasn't much available this days. Where can i download the apk ? Thanks and best regards. Gérard
See link in my previous message https://github.com/opengisch/qfieldsync/issues/153#issuecomment-654244159
Thank's for your answer. I confirm : it works with french language device. Tnak's for your work. Best regards.
Gérard
Thank you for the feedback !
Hi guys,
I still have the issue you are describing here. I have tried for the qgep_import.vw_manhole view on the field _depth.
I have the issue with both French or English language.
QGIS: 3.10.6 QField : 1.7.8 Galaxy Tab A7 Android 10
Thanks a lot