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

QQuickWidget can't get keyboard input when placed on QGraphicsScene

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Ubuntu

      Description

       

              auto scene = new QGraphicsScene;
      	scene->addWidget(new QLineEdit("I'm QLineEdit and I'm interactive on the scene!"))->setGeometry({0, 0, 400, 30});
      	scene->addWidget(new QQuickWidget(QUrl("qrc:/Foo.qml")))->setY(40);
      	auto view = new QGraphicsView(scene);
      
      	v_layout->addWidget(view, 1);
      	window.setLayout(v_layout);
      	window.show();

      Foo.qml contains  `TextArea` item which is supposed to get user input, even though the item is focused (focus property is true) text cursor does not appear.

              TextArea {
                  anchors {
                      fill: parent
                      margins: 1
                  }
                  text: qsTr("TextArea here, I should be interactive.. but I'm not :(")   + qsTr("\nI have focus: ") + focus
              }

       

        Attachments

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

          Activity

            People

            • Assignee:
              tvete Paul Olav Tvete
              Reporter:
              osmaczny Patryk Osmaczko
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes