import Qt 4.7 Rectangle{ id:rectangle1 width: 220 height: newPlugin ? textPath.height+50 : textInfo.height+50 focus: true; property int focusIndex:-1; property bool newPlugin:false; function setInfo(string){ textInfo.text = string; } function setPath(string){ textPath.text = string; } function setButtonText(string){ saveButton.textInButton=string; } function setNew(bool){ newPlugin=bool; } function setFocus(){ if(focusIndex==0){ browseButton.focus=true; if(!browseButton.opacity) focusIndex++; } if(focusIndex==1){ saveButton.focus = true if(!saveButton.enabled) focusIndex++; } if(focusIndex>1){ focusIndex=-1; focus=true; } } signal saveButtonClicked(); signal browseButtonClicked(); signal heightChange(int intiger); Keys.onTabPressed: { focusIndex++; setFocus(); } onHeightChanged:{ heightChange((newPlugin ? textPath.height+50 : textInfo.height+50)); } SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } color : myPalette.window; Text { id: textInfo text: "Tekst: " height: paintedHeight+5; anchors.right: parent.right anchors.left: parent.left anchors.top: parent.top wrapMode: Text.Wrap; transformOrigin: Item.Left font.pixelSize: 12 } Text { id: textPath text: qsTr("Dictionary file: not selected") height: paintedHeight+5; anchors.top: parent.top anchors.right: browseButton.left anchors.left: parent.left wrapMode: Text.Wrap; transformOrigin: Item.Left font.pixelSize: 12 opacity: 0 } Button { id: browseButton width: 80; height: 25; textInButton: qsTr("Browse"); anchors.top: parent.top anchors.topMargin: 10 anchors.right: parent.right opacity: 0 onClicked: rectangle1.browseButtonClicked(); } Button { id: saveButton height: 30 anchors.bottom: parent.bottom textInButton: qsTr("Save") anchors.right: parent.right anchors.left: parent.left onClicked: rectangle1.saveButtonClicked(); } states: [ State { name: "new" when: newPlugin==true PropertyChanges { target: textInfo; opacity: 0} PropertyChanges { target: textPath; opacity: 1} PropertyChanges { target: browseButton; opacity: 1 } } ] }