Exporting types work now

This commit is contained in:
Pulak Malhotra 2021-08-05 17:31:53 +05:30
parent bf1c4a2128
commit 7e9eede5dc
2 changed files with 7 additions and 2 deletions

View File

@ -3545,7 +3545,7 @@ QList<TypeDescription> CutterCore::getAllPrimitiveTypes()
exp.type = typeObject[RJsonKey::type].toString();
exp.size = (int)typeObject[RJsonKey::size].toVariant().toULongLong();
exp.category = tr("Primitive");
exp.category = "Primitive";
primitiveTypes << exp;
}

View File

@ -275,7 +275,12 @@ void TypesWidget::on_actionExport_Types_triggered()
return;
}
QTextStream fileOut(&file);
fileOut << Core()->cmdRaw("tc");
for (const auto &type : types) {
if (type.category == "Primitive"){
continue;
}
fileOut << Core()->getTypeAsC(type.type, type.category) << "\n";
}
file.close();
}