opengisch / qfieldsync

Sync your projects to QField
https://qfield.org/
GNU Lesser General Public License v3.0
53 stars 26 forks source link

QGis Extension QField : changing type numeric #153

Open gsollberger opened 4 years ago

gsollberger commented 4 years ago

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 : 79334718-1c14e080-7f21-11ea-9206-962e9378e3e6

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

m-kuhn commented 4 years ago

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).

gsollberger commented 4 years ago

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 Screenshot_20200603-145549_QField

m-kuhn commented 4 years ago

Use the point below the OK?

gsollberger commented 4 years ago

it doesn't work ...

gsollberger commented 4 years ago

Annotation 2020-06-03 150118 this is he configuration of the attribute "profondeur" in the qgs file, used by qfield

m-kuhn commented 4 years ago

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? Screenshot_20200603-150608_QField

gsollberger commented 4 years ago

where may i download this proejct ?

m-kuhn commented 4 years ago

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

gsollberger commented 4 years ago

OK, thanks, I've tried this project with my Samsung Tab Active 2 and my Samsung S8 phone ... the coma isn't usable ...

m-kuhn commented 4 years ago

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).

gsollberger commented 4 years ago

the same ...

signedav commented 4 years ago

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:

My behavior on 1.4.4 is like it should:

So I think I cannot reproduce @gsollberger issue. I can enter decimals in your project with 1.4.4 WhatsApp Image 2020-06-04 at 09 25 18

Do I misunderstand something? :thinking:

signedav commented 4 years ago

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

doubletrouble.zip

Btw. the demo projects yearly harvest field is integer - so the behavior at @m-kuhn covers mine (just having comma but dot instead)...

signedav commented 4 years ago

Found a lead. When setting my phone to "Français (Suisse)" I can reproduce the issue of @gsollberger

signedav commented 4 years ago

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 DoubleValidators 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() );
signedav commented 4 years ago

See a possible workaround here https://github.com/opengisch/qfield/pull/1047

m-kuhn commented 4 years ago

@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 info@opengis.ch.

gsollberger commented 4 years ago

Hi, Yeah ! it works ;-) I'll configure my device in english . Thank's for the workaround and Best regards.

Gérard

m-kuhn commented 4 years ago

@gsollberger can we ask you to test the apk in https://github.com/opengisch/QField/pull/1047#issuecomment-654216140 ? Thank you!

signedav commented 4 years ago

Mais en français :-)

m-kuhn commented 4 years ago

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!

signedav commented 4 years ago

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:

gsollberger commented 4 years ago

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

m-kuhn commented 4 years ago

See link in my previous message https://github.com/opengisch/qfieldsync/issues/153#issuecomment-654244159

gsollberger commented 4 years ago

Thank's for your answer. I confirm : it works with french language device. Tnak's for your work. Best regards.

Gérard

m-kuhn commented 4 years ago

Thank you for the feedback !

varrieta commented 3 years ago

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