Browse Source

merged latest develop

cl-refactor
arkpar 10 years ago
parent
commit
ddc3ddb21e
  1. 2
      mix/ContractCallDataEncoder.cpp
  2. 2
      mix/SolidityType.h
  3. 88
      mix/qml/StructView.qml

2
mix/ContractCallDataEncoder.cpp

@ -122,7 +122,7 @@ QStringList ContractCallDataEncoder::decode(QList<QVariableDeclaration*> const&
r.append(toString(decodeInt(rawParam)));
else if (type == QSolidityType::Type::Bool)
r.append(toString(decodeBool(rawParam)));
else if (type == QSolidityType::Type::String || type == QSolidityType::Type::Hash)
else if (type == QSolidityType::Type::Bytes || type == QSolidityType::Type::Hash)
r.append(toString(decodeBytes(rawParam)));
else if (type == QSolidityType::Type::Struct)
r.append("struct"); //TODO

2
mix/SolidityType.h

@ -42,7 +42,7 @@ struct SolidityType
Hash,
Bool,
Address,
String,
Bytes,
Enum,
Struct
};

88
mix/qml/StructView.qml

@ -42,45 +42,10 @@ Item
text: "="
Layout.preferredWidth: 15
}
/*
Component.onCompleted: {
var t = type.type;
var src = undefined;
if (t === QSolidityType.SignedInteger || t === QSolidityType.UnsignedInteger)
src = "qrc:/qml/QIntTypeView.qml"
else if (t === QSolidityType.Bool)
src = "qrc:/qml/QBoolTypeView.qml"
else if (t === QSolidityType.String)
src = "qrc:/qml/QStringTypeView.qml"
else if (t === QSolidityType.Hash || t === QSolidityType.Address)
src = "qrc:/qml/QHashTypeView.qml"
else if (t === QSolidityType.Struct)
src = "qrc:/qml/StructView.qml";
else
return null;
typeLoader.setSource(src, {
height: 20,
width: 150,
value: typeLoader.getCurrent().value
});
console.log(src);
}
*/
Loader
{
id: typeLoader
Layout.preferredWidth: 150
/*
Binding {
target: typeLoader.item
property: "membersModel"
value: type.members
when: typeLoader.status === Loader.Ready
}*/
sourceComponent:
{
var t = modelData.type.type;
@ -88,7 +53,7 @@ Item
return Qt.createComponent("qrc:/qml/QIntTypeView.qml");
else if (t === QSolidityType.Bool)
return Qt.createComponent("qrc:/qml/QBoolTypeView.qml");
else if (t === QSolidityType.String)
else if (t === QSolidityType.Bytes)
return Qt.createComponent("qrc:/qml/QStringTypeView.qml");
else if (t === QSolidityType.Hash || t === QSolidityType.Address)
return Qt.createComponent("qrc:/qml/QHashTypeView.qml");
@ -124,57 +89,6 @@ Item
return {};
return "";
}
Component
{
id: intViewComp
QIntTypeView
{
height: 20
width: 150
id: intView
}
}
Component
{
id: boolViewComp
QBoolTypeView
{
height: 20
width: 150
id: boolView
defaultValue: "1"
Component.onCompleted:
{
var current = getValue()
(current === "" ? text = defaultValue : text = current);
}
}
}
Component
{
id: stringViewComp
QStringTypeView
{
height: 20
width: 150
id: stringView
}
}
Component
{
id: hashViewComp
QHashTypeView
{
height: 20
width: 150
id: hashView
}
}
}
}
}

Loading…
Cancel
Save