[PyQt] QDoubleSpinBox and decimal separator

Henrik Pauli henrik.pauli at gmail.com
Fri May 16 11:18:52 BST 2008


On Friday 16 May 2008, simone wrote:
> Hi, I have a problem with a QDoubleSpinBox on Windows.
>
> In my locale, the decimal separator is ',' and not '.'. If I try to
> write a decimal separator in a QDoubleSpinBox via the '.' button in the
> numeric pad, the spinbox doesn't accept the value and I have to hit the
> ',' button under the 'k' key. This happens also in the QDoubleSpinBox
> example in the Qt (C++) Demo.
>
> Obviously, the final user (me... :D) doesn't want this issue... :)
>
> I think to subclass the QDoubleSpinBox to catch the keypress event. Is
> it possible to emit a ',' key press event when I hit the '.' in the
> numeric pad? If yes, have you some code to post? :D
>

Does your numeric-dot key really emit a period, or does it emit a comma?

I think the problem might lie in that your keyboard layout doesn’t agree with 
your locale settings — in which case, see if there’s a variant with num-dot 
emitting a comma, or if there isn’t such, report it to the XKB people.



More information about the PyQt mailing list