Important: Please read the Qt Code of Conduct -

QIntValidator and Swedish QLocale problem

  • Hello,
    I have reported this issue as a bug (, but I wonder if anyone has a thought about the following problem. If I set a QIntValidator which allows negative numbers on a QLineEdit, the field blocks the minus character in the Swedish QLocale.

    Here is a quick sample:
    QLineEdit* entry = new QLineEdit();
    QLocale loc("sv_SE");
    QIntValidator* pValidator = new QIntValidator(-9, 9, entry);

    When the locale is set to "en_US" (US English) or even "fi_FI" (Finnish), the user can enter negative values in the field. However, the Swedish locale block the user from typing a minus sign. Does anyone know of a reason why this would be intentional, or is this issue truly a bug?


  • Lifetime Qt Champion


    The fix is on its way

  • Lifetime Qt Champion

    The bug has been fixed

Log in to reply