Browse Source

small changes

cl-refactor
yann300 10 years ago
parent
commit
98788b69b6
  1. 12
      mix/qml/QAddressView.qml
  2. 1
      mix/qml/QBoolTypeView.qml
  3. 17
      mix/qml/StructView.qml
  4. 4
      mix/qml/TransactionDialog.qml

12
mix/qml/QAddressView.qml

@ -88,6 +88,7 @@ ColumnLayout
function init()
{
btnAdd.visible = isArray()
textinput.readOnly = readOnly
if (isArray() || readOnly)
displayInput = true
@ -101,25 +102,28 @@ ColumnLayout
if (!trCombobox.visible)
{
rowCombobox.visible = false
rowCombobox.height = 0
trCombobox.height = 0
textinput.anchors.top = textinput.parent.top
}
if (!readOnly)
{
trCombobox.currentIndex = 0
for (var k = 0; k < ctrModel.count; k++)
{
if (ctrModel.get(k).value === value)
{
trCombobox.currentIndex = k;
return;
trCombobox.currentIndex = k
break
}
}
trCombobox.currentIndex = 0;
}
if (!isArray())
trCombobox.update()
else if (value === "")
textinput.text = "[]"
}
function select(address)

1
mix/qml/QBoolTypeView.qml

@ -53,7 +53,6 @@ Item
for (var k in JSON.parse(boolArray.text))
formattedparam.push(parseInt(format(param[k])))
boolArray.text = JSON.stringify(formattedparam)
}
}

17
mix/qml/StructView.qml

@ -16,8 +16,10 @@ Column
spacing: 0
property int colHeight
onValueChanged:
function clear()
{
value = {}
members = []
colHeight = 0
}
@ -119,18 +121,23 @@ Column
}
item.onValueChanged.connect(function() {
vals[pname] = item.value;
valueChanged();
syncValue(vals, pname)
});
var newWidth = nameLabel.width + typeLabel.width + item.width + 108;
if (root.width < newWidth)
root.width = newWidth;
if (item.finalize)
item.finalize()
syncValue(vals, pname)
}
function syncValue(vals, pname)
{
vals[pname] = item.value;
valueChanged();
}
function getValue()
{
var r = "";

4
mix/qml/TransactionDialog.qml

@ -120,7 +120,6 @@ Dialog {
var type = parameter.type;
var pname = parameter.name;
paramsModel.push({ name: pname, type: type });
console.log(JSON.stringify(paramsModel))
}
function loadParameters() {
@ -153,8 +152,7 @@ Dialog {
function initTypeLoader()
{
paramScroll.value = {}
paramScroll.members = []
paramScroll.clear()
paramScroll.value = paramValues;
paramScroll.members = paramsModel;
paramScroll.updateView()

Loading…
Cancel
Save