Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
None
Description
Have the code below and try to refactor the first Rectangle element into a component.
Result: The filename wrongly becomes ParentItem.qml. QuickFix operation should not be permitted here due to missing id.
Suggestion: Have the quickfix operation search all the items in children of Rectangle {} and pick the first one with an id property. Also, check for objectName properties and use the first one found as a filename if no id's are available.
import Qt 4.7 Item { Item { id: parentItem Rectangle { width: parent.width height: 74 TextInput { id: filterText anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter onTextChanged: { contactsModel.filterText = filterText.text } font.pixelSize: 25 } Image { id: clearFilterButton anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: 0 source: "images/button.png" width: 40 Text{ font.pixelSize: 25 color: "#d8d8d8" text: "X" anchors.centerIn: parent } MouseArea { anchors.fill: parent onClicked: { filterText.text = "" } } } } } }