|
@ -5,10 +5,12 @@ import QtQuick.Controls.Styles 1.3 |
|
|
Item |
|
|
Item |
|
|
{ |
|
|
{ |
|
|
property alias value: textinput.text |
|
|
property alias value: textinput.text |
|
|
property alias contractCreationTr: ctrModel |
|
|
property alias accountRef: ctrModel |
|
|
|
|
|
property string subType |
|
|
|
|
|
property bool readOnly |
|
|
id: editRoot |
|
|
id: editRoot |
|
|
height: 20 |
|
|
height: 20 |
|
|
width: 200 |
|
|
width: 320 |
|
|
|
|
|
|
|
|
SourceSansProBold |
|
|
SourceSansProBold |
|
|
{ |
|
|
{ |
|
@ -17,19 +19,19 @@ Item |
|
|
|
|
|
|
|
|
function init() |
|
|
function init() |
|
|
{ |
|
|
{ |
|
|
trCombobox.visible = ctrModel.count > 1; //index 0 is a blank value. |
|
|
trCombobox.visible = !readOnly |
|
|
if (value.indexOf("<") === 0) |
|
|
textinput.readOnly = readOnly |
|
|
|
|
|
if (!readOnly) |
|
|
{ |
|
|
{ |
|
|
for (var k = 0; k < ctrModel.count; k++) |
|
|
for (var k = 0; k < ctrModel.count; k++) |
|
|
{ |
|
|
{ |
|
|
if ("<" + ctrModel.get(k).functionId + ">" === value) |
|
|
if (ctrModel.get(k).value === value) |
|
|
{ |
|
|
{ |
|
|
trCombobox.currentIndex = k; |
|
|
trCombobox.currentIndex = k; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
trCombobox.currentIndex = 0; |
|
|
trCombobox.currentIndex = 0; |
|
|
value = ""; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -43,7 +45,7 @@ Item |
|
|
text: value |
|
|
text: value |
|
|
width: parent.width |
|
|
width: parent.width |
|
|
height: parent.width |
|
|
height: parent.width |
|
|
wrapMode: Text.WrapAnywhere |
|
|
wrapMode: Text.WordWrap |
|
|
clip: true |
|
|
clip: true |
|
|
font.family: boldFont.name |
|
|
font.family: boldFont.name |
|
|
MouseArea { |
|
|
MouseArea { |
|
@ -73,7 +75,7 @@ Item |
|
|
property bool selected: false |
|
|
property bool selected: false |
|
|
id: trCombobox |
|
|
id: trCombobox |
|
|
model: ctrModel |
|
|
model: ctrModel |
|
|
textRole: "functionId" |
|
|
textRole: "itemid" |
|
|
height: 20 |
|
|
height: 20 |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
anchors.left: textinput.parent.right |
|
|
anchors.left: textinput.parent.right |
|
@ -84,7 +86,10 @@ Item |
|
|
return; |
|
|
return; |
|
|
else if (currentText !== " - ") |
|
|
else if (currentText !== " - ") |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (model.get(currentIndex).type === "contract") |
|
|
textinput.text = "<" + currentText + ">"; |
|
|
textinput.text = "<" + currentText + ">"; |
|
|
|
|
|
else |
|
|
|
|
|
textinput.text = model.get(currentIndex).value; //address |
|
|
trCombobox.selected = true; |
|
|
trCombobox.selected = true; |
|
|
} |
|
|
} |
|
|
else if (textinput.text.indexOf("<") === 0) |
|
|
else if (textinput.text.indexOf("<") === 0) |
|
|