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

NumLock does not work by default for number entry using keypad (acts as cursor)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.1.0
    • None
    • Debian GNU/Linux unstable on amd64 with Qt 5.1.0 under KDE 4.10. Linux kernel 3.10.
    • c583a0277dc0a2b0721c7901427b1ca3cb7dc1c6

    Description

      See minimal testcase below. In this example, I have a
      QDoubleSpinBox, but the problem also shows with QSpinBox and QLineEdit, so I suspect this is a general input problem. It may not belong to the Input method components--it seemed like the most appropriate, but please reassign if not.

      I start the test program with NumLock enabled on the keyboard.
      It's not possible to enter numbers using the numeric keypad--it's in cursor key mode. 2 and 8 (i.e. up and down) increase and decrease the spinbox number by one, but I can't enter numbers as expected.
      If I press NumLock twice (i.e. turn it off and on again) then it's possible to enter numbers using the keypad.

      If I start the test program with NumLock disabled, then I get exactly the same behaviour as above.

      It looks like Qt is not respecting the state of NumLock when it initially starts up, and it's defaulting the keypad to the NumLock off state (i.e. cursor keys). Number entry mode is only enabled when NumLock is next set to on. I would have expected that Qt would respect the NumLock state.

      Regards,
      Roger

      Built with "g++ -o test test.cpp $(pkg-config --cflags --libs Qt5Core Qt5Gui Qt5Widgets) -fPIC"

      ------
      #include <QApplication>
      #include <QDoubleSpinBox>
      #include <QMainWindow>

      int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);

      QMainWindow w;
      w.setCentralWidget(new QDoubleSpinBox(&w));
      w.show();

      return a.exec();
      }
      ------

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            paeglis Gatis Paeglis
            rleigh Roger Leigh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes