2

I have a qspinbox which use int values only. Also i have checkbox. If checkbox == 0, qspinbox must use int values only, but if checkbox == 1, qspinbox must use float values only. Is It possible? Maybe it is possible with qdoublespinbox?

1 Answers1

3

Use a QDoubleSpinBox. When the checkbox is not checked, set the precision of the spinbox to 0. You do that by setting the decimals property.

You might also need to change the singleStep property if you're not using the default (which is 1.0).

Nikos C.
  • 50,738
  • 9
  • 71
  • 96