When reading QJsonArray it gives always 0
-
Or use a proper QDoubleSpinbox
-
wrote on 12 Feb 2021, 11:55 last edited by
Or a
QLineEdit
with an input mask, so you can be sure that is input of this widget gonna be a number. Then you can write it as double to your Json. -
@JonB ı didnt get my json from anywhere. I create it by myself
wrote on 12 Feb 2021, 12:03 last edited by@suslucoder said in When reading QJsonArray it gives always 0:
ı didnt get my json from anywhere. I create it by myself
So this is not a widget issue, at least at this stage. It's a question of OP deciding on a type to be used in the JSON.
-
Exactly. You should format the data properly when you save it. Then the whole problem will just go away and a plain
toDouble()
will work when reading the file. -
Exactly. You should format the data properly when you save it. Then the whole problem will just go away and a plain
toDouble()
will work when reading the file.wrote on 15 Feb 2021, 06:11 last edited byThanks for all answers. I will reformat my json file and try it again
21/25