Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-41256

French keyboard's dot key (numeric keypad) does not work as input

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.2.1
    • None
    • Windows

    Description

      I'm working on a French Windows 7 computer.

      When I try to type a decimal number in a QDoubleSpinBox control or a QLineEdit validated by a QDoubleValidator, pressing the dot numeric keypad button does nothing....I would expect it to insert a decimal separator!

      Like Microsoft Excel does: if I press "1" "." and "2" from the numeric keypad, is writes "1,2" in the selected cell (because "," is the decimal separator on my machine).

      I attached a main.cpp as an example.

       
      #include <QApplication>
      #include <QVBoxLayout>
      #include <QLabel>
      #include <QSpinBox>
      #include <QDialog>
      #include <QDoubleValidator>
      #include <QLineEdit>
      
      class Dialog : public QDialog
      {
      public:
          Dialog()
          {
              QVBoxLayout* layout = new QVBoxLayout( this );
      
              layout->addWidget( new QLabel( QLocale().toString( 3.14 ), this ) );
              layout->addWidget( new QDoubleSpinBox( this ) );
      
              QLineEdit* edit = new QLineEdit( this );
              edit->setValidator( new QDoubleValidator() );
              layout->addWidget( edit );
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          Dialog w;
          w.show();
      
          return a.exec();
      }
      

      When compiled and executed, here's what I see:

      • The QLabel displays "3,14" which means french QLocale is correctly used (else, it would display 3.14, english default stype). OK
      • The QDoubleSpinBox diplays "0,00". OK
      • I can type a decimal value in the spinbox using the ',' standard keyboard key. OK
      • I cannot type a decimal value in the spinbox using the '.' standard keyboard key. OK
      • But when I press the dot key from my numerical French keypad, nothing happens! This is supposed to enter a decimal separator, whatever locale setting is being used!

      Note: Qt 4.7 used to work fine displaying and using "." as a separator, Qt 5.2 appears to be smart enough to automatically change "." to "," on my PC, but not smart enough to make the keypad "." key work

      Attachments

        1. keypad.png
          keypad.png
          3 kB
        2. main.cpp
          0.7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            peppe Giuseppe D'Angelo
            jpo38 Jean Porcherot
            Votes:
            8 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes