import Qt 4.7 Rectangle { id: rectangle1 radius: 10 border.color: "#000666"; property alias textInLineEdit:text_input1.text signal enterPressed(string text); function setText(string) { textInLineEdit = string; } TextInput { id: text_input1 width: rectangle1.width-20 height: rectangle1.height*0.6; text: "textInput" transformOrigin: Item.Left anchors.centerIn: parent selectByMouse: true; font.pixelSize: rectangle1.height * .5; onCursorPositionChanged: moveCursorSelection(cursorPosition); focus: rectangle1.focus; Keys.onPressed: { if ((event.key == Qt.Key_Enter) || (event.key == Qt.Key_Return)) rectangle1.enterPressed(text_input1.text) } } Rectangle { id: shadeDisable anchors.centerIn: parent; radius: parent.radius color: "grey"; opacity: 0 width: parent.width; height: parent.height; } states: [ State { name: "FokusState"; when: text_input1.focus==true && rectangle1.enabled==true; PropertyChanges { target: rectangle1 border.width: 3 } }, State { name: "DisableState"; when: rectangle1.enabled==false; PropertyChanges { target: shadeDisable; z: 3; opacity: 0.5 } } ] }