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

Editable SpinBox's text input doesn't have focus when the SpinBox is focused

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.0 Beta 3
    • 5.10
    • Quick: Controls 2
    • None
    • 039c25daac5ec6b96c0aa074eae2a983a1b5aabd

    Description

      With the code below, the user should be able to start typing a value for the SpinBox, but it's necessary to press tab first to give the TextInput active focus:

      import QtQuick 2.9
      import QtQuick.Controls 2.0
      
      ApplicationWindow {
          id: window
          visible: true
          width: 640
          height: 600
      
          onActiveFocusItemChanged: print(activeFocusItem)
      
          SpinBox {
              focus: true
              editable: true
          }
      }
      

      Compare a similar Qt Widgets application that behaves as expected:

      #include <QApplication>
      #include <QtWidgets>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QWidget widget;
          widget.resize(400, 400);
          QSpinBox *spinBox = new QSpinBox(&widget);
          widget.show();
          return app.exec();
      }
      

      Attachments

        Activity

          People

            mitch_curtis Mitch Curtis
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: