Exporting types work now

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

View File

@ -3601,7 +3601,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();
}