添加data.json

dev-VirtualTexture
wuyize 2022-11-19 17:27:06 +08:00
parent 4b97ece85d
commit 064675a847
2 changed files with 28 additions and 1 deletions

View File

@ -10,7 +10,8 @@ void PreviewWindow::show()
{ {
mainScene->clear(); mainScene->clear();
QFile settingFile; QFile settingFile;
settingFile.setFileName("C:/Users/Karlis/Desktop/data.json"); settingFile.setFileName("../data.json");
settingFile.open(QFile::ReadOnly); settingFile.open(QFile::ReadOnly);
QByteArray setting = settingFile.readAll().trimmed(); QByteArray setting = settingFile.readAll().trimmed();
QJsonDocument jsonDoc(QJsonDocument::fromJson(setting)); QJsonDocument jsonDoc(QJsonDocument::fromJson(setting));

26
data.json Normal file
View File

@ -0,0 +1,26 @@
{
"elements":[
{
"type":"polygon",
"data":{
"points":[{"x":20,"y":30},{"x":20,"y":50},{"x":50,"y":100},{"x":20,"y":30}]
}
},
{
"type":"polygon",
"data":{
"points":[{"x":100,"y":100},{"x":100,"y":500},{"x":500,"y":500},{"x":100,"y":100}]
}
},
{
"type":"round",
"data":{
"x-axis":500,
"y-axis":500,
"angle":360
}
}
]
}