File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import ScratchCPP.Render
8
8
import "internal"
9
9
10
10
ProjectScene {
11
- property string fileName
11
+ readonly property string fileName : loader . fileName
12
12
property int stageWidth: 480
13
13
property int stageHeight: 360
14
14
property alias fps: loader .fps
@@ -28,6 +28,10 @@ ProjectScene {
28
28
stageScale: (stageWidth == 0 || stageHeight == 0 ) ? 1 : Math .min (width / stageWidth, height / stageHeight)
29
29
onFileNameChanged: priv .loading = true ;
30
30
31
+ function load (fileName ) {
32
+ loader .fileName = fileName;
33
+ }
34
+
31
35
QtObject {
32
36
id: priv
33
37
property bool loading: false
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ void ProjectLoader::setFileName(const QString &newFileName)
59
59
if (m_loadThread.isRunning ())
60
60
m_loadThread.waitForFinished ();
61
61
62
- if (m_fileName == newFileName)
62
+ if (newFileName. isEmpty () )
63
63
return ;
64
64
65
65
m_fileName = newFileName;
You can’t perform that action at this time.
0 commit comments