File tree Expand file tree Collapse file tree 1 file changed +27
-4
lines changed Expand file tree Collapse file tree 1 file changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ ProjectScene {
2727 readonly property Rectangle stageRect: contentRect
2828 signal loaded ()
2929 signal failedToLoad ()
30+ signal loadingAborted ()
3031
3132 id: root
3233 engine: loader .engine
@@ -39,6 +40,11 @@ ProjectScene {
3940 loader .fileName = fileName;
4041 }
4142
43+ function stopLoading () {
44+ if (priv .loading )
45+ loader .stopLoading ();
46+ }
47+
4248 QtObject {
4349 id: priv
4450 property bool loading: false
@@ -54,10 +60,27 @@ ProjectScene {
5460 onLoadingFinished: {
5561 priv .loading = false ;
5662
57- if (loadStatus)
58- loaded ();
59- else
60- failedToLoad ();
63+ switch (loadStatus) {
64+ case ProjectLoader .Loaded :
65+ loaded ();
66+ break ;
67+
68+ case ProjectLoader .Failed :
69+ failedToLoad ();
70+ break ;
71+
72+ case ProjectLoader .Aborted :
73+ loadingAborted ();
74+ break ;
75+
76+ default :
77+ break ;
78+ }
79+ }
80+
81+ onLoadStatusChanged: {
82+ if (loadStatus === ProjectLoader .Loading )
83+ priv .loading = true ;
6184 }
6285
6386 onStageChanged: stage .loadCostume ();
You can’t perform that action at this time.
0 commit comments