From 064675a84730a0dc108f5620106586da7fcc4b1c Mon Sep 17 00:00:00 2001 From: wuyize Date: Sat, 19 Nov 2022 17:27:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0data.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Editor/PreviewWindow.cpp | 3 ++- data.json | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 data.json diff --git a/ArchitectureColoredPainting/src/Editor/PreviewWindow.cpp b/ArchitectureColoredPainting/src/Editor/PreviewWindow.cpp index 9de0d83..c71e68e 100644 --- a/ArchitectureColoredPainting/src/Editor/PreviewWindow.cpp +++ b/ArchitectureColoredPainting/src/Editor/PreviewWindow.cpp @@ -10,7 +10,8 @@ void PreviewWindow::show() { mainScene->clear(); QFile settingFile; - settingFile.setFileName("C:/Users/Karlis/Desktop/data.json"); + settingFile.setFileName("../data.json"); + settingFile.open(QFile::ReadOnly); QByteArray setting = settingFile.readAll().trimmed(); QJsonDocument jsonDoc(QJsonDocument::fromJson(setting)); diff --git a/data.json b/data.json new file mode 100644 index 0000000..e9053a7 --- /dev/null +++ b/data.json @@ -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 + } + } +] + + +} \ No newline at end of file