diff --git a/.vscode/launch.json b/.vscode/launch.json index 8d32a568..a1c5c1f3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -99,6 +99,30 @@ "program": "${workspaceFolder}/../build_ScreenPlay_Qt_6.3.2_Clang_RelWithDebInfo/bin/ScreenPlayWallpaper.app/Contents/MacOS/ScreenPlayWallpaper", "type": "cppdbg" } + }, + { + "name": "ScreenPlayWidget Debug", + "request": "launch", + "type": "cppvsdbg", // Must be set otherwise VSCode does not know we want to debug c++ + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "internalConsoleOptions": "openOnSessionStart", + "windows": { + "environment": [ + { + "name": "Path", + "value": "${env:Path};${workspaceFolder}\\..\\aqt\\6.4.2\\msvc2019_64\\bin\\;${workspaceFolder}\\..\\aqt\\6.4.2\\msvc2019_64\\modules\\;${workspaceFolder}\\..\\aqt\\6.4.2\\msvc2019_64\\qml\\;" + } + ], + "type": "cppvsdbg", + "program": "${workspaceFolder}/../build_ScreenPlay_Qt_6.4.2_MSVC_Debug/bin/ScreenPlayWidget.exe" + }, + "osx": { + "MIMode": "lldb", + "program": "${workspaceFolder}/../build_ScreenPlay_Qt_6.3.2_Clang_Debug/bin/ScreenPlayWidget.app/Contents/MacOS/ScreenPlayWidget", + "type": "cppdbg" + } } ] } \ No newline at end of file diff --git a/ScreenPlay/qml/Create/WizardsFiles/QMLWidgetMain.qml b/ScreenPlay/qml/Create/WizardsFiles/QMLWidgetMain.qml index a5fad5f2..1c7c35a9 100644 --- a/ScreenPlay/qml/Create/WizardsFiles/QMLWidgetMain.qml +++ b/ScreenPlay/qml/Create/WizardsFiles/QMLWidgetMain.qml @@ -5,8 +5,15 @@ Item { implicitWidth: 300 implicitHeight: 200 + Rectangle { + id: background + anchors.fill:parent + opacity: 0.9 + color: "#333333" + } + Text { - id: name + id: text text: qsTr("My Widget 🚀") anchors.centerIn: parent } diff --git a/ScreenPlayUtil/src/projectfile.cpp b/ScreenPlayUtil/src/projectfile.cpp index 7b45fbdb..740c321b 100644 --- a/ScreenPlayUtil/src/projectfile.cpp +++ b/ScreenPlayUtil/src/projectfile.cpp @@ -23,10 +23,6 @@ bool ProjectFile::init() return false; // Required: - if (!obj.contains("description")) - return false; - description = obj.value("description").toString(); - if (!obj.contains("file")) return false; file = obj.value("file").toString(); @@ -38,7 +34,17 @@ bool ProjectFile::init() if (!obj.contains("type")) return false; + auto typeParsed = ScreenPlayUtil::getInstalledTypeFromString(obj.value("type").toString()); + if (!typeParsed) { + qWarning() << "Type could not parsed from: " << *typeParsed; + return false; + } + type = typeParsed.value(); + // Optional: + if (!obj.contains("description")) + description = obj.value("description").toString(); + if (obj.contains("previewGIF")) previewGIF = obj.value("previewGIF").toString(); @@ -51,10 +57,8 @@ bool ProjectFile::init() if (obj.contains("previewThumbnail")) { preview = obj.value("previewThumbnail").toString(); } else { - if (!obj.contains("preview")) { - return false; - } - preview = obj.value("preview").toString(); + if (obj.contains("preview")) + preview = obj.value("preview").toString(); } if (obj.contains("tags")) { @@ -68,13 +72,7 @@ bool ProjectFile::init() } } - auto typeParsed = ScreenPlayUtil::getInstalledTypeFromString(obj.value("type").toString()); - if (!typeParsed) { - qWarning() << "Type could not parsed from: " << *typeParsed; - return false; - } - type = typeParsed.value(); if (type == InstalledType::InstalledType::GifWallpaper) { preview = previewGIF; }