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 {
27
27
readonly property Rectangle stageRect: contentRect
28
28
signal loaded ()
29
29
signal failedToLoad ()
30
+ signal loadingAborted ()
30
31
31
32
id: root
32
33
engine: loader .engine
@@ -39,6 +40,11 @@ ProjectScene {
39
40
loader .fileName = fileName;
40
41
}
41
42
43
+ function stopLoading () {
44
+ if (priv .loading )
45
+ loader .stopLoading ();
46
+ }
47
+
42
48
QtObject {
43
49
id: priv
44
50
property bool loading: false
@@ -54,10 +60,27 @@ ProjectScene {
54
60
onLoadingFinished: {
55
61
priv .loading = false ;
56
62
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 ;
61
84
}
62
85
63
86
onStageChanged: stage .loadCostume ();
You can’t perform that action at this time.
0 commit comments