Hello, I am trying go give active focus on a TextInput belonging to a delegate item of a TableView.
Here is a minimal code for the delegate: // MyClickableWidget.qml import QtQuick 2.3 FocusScope { id: scope property alias text: label.text //FocusScope needs to bind to visual properties of the children property alias color: rectangle.color x: rectangle.x y: rectangle.y width: rectangle.width height: rectangle.height Rectangle { id: rectangle color: "lightsteelblue" width: 175 height: 25 radius: 10 antialiasing: true border.color: "blue" TextInput { id: label anchors.centerIn: parent focus: true } } MouseArea { anchors.fill: parent onClicked: { scope.focus = true; } } } So, my goal is to give active focus to label when the delegate is clicked. import QtQuick 2.3 import QtQuick.Controls 1.2 Rectangle { id: window width: 400 height: 150 ListModel { id: model ListElement {x: 42; y: 84} ListElement {x: 126; y: 168} } TableView { id: table anchors.fill: parent model: model focus: true itemDelegate: MyClickableWidget { color: "lightgreen" text: styleData.value } rowDelegate: Rectangle { height: 50 } TableViewColumn { role: "x" width: 180 } TableViewColumn { role: "y" width: 180 } } } When I run this example, I have to click two times on a delegate to focus the internal label and I don't understand why. Using a ListView instead of a TableView give me the expected behavior. Am I missing something with the focus chain mechanism? Jean-BenoƮt Hubert _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest