Skip to content

Commit

Permalink
better workfloow for app splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierLDff committed Aug 20, 2024
1 parent b61bbcf commit f642d15
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions qml/Qaterial/SplashScreenApplication.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ Item

onStatusChanged: function()
{
if(splashScreenLoader.status === Loader.Ready)
if(!active)
return

if(splashScreenLoader.status === Loader.Ready && !applicationLoader.active)
{
applicationLoader.active = true
if(splashScreenLoader.item)
{
console.log("SplashScreenLoaderApplication: SplashScreen loaded")
splashScreenLoader.item.show()
}
else
{
console.error("SplashScreenApplication: SplashScreen loaded, but item is null")
console.error("SplashScreenLoaderApplication: SplashScreen loaded, but item is null")
}
}
}
Expand All @@ -38,8 +42,11 @@ Item
{
if(applicationLoader.item)
{
console.log("SplashScreenApplication: Application loaded")
applicationLoader.item.show()
splashScreenLoader.item.close()

console.log("Deactivate splashScreenLoader")
Qt.callLater(_laterDeactiveSplashScreen)
}
else
{
Expand All @@ -50,6 +57,7 @@ Item
}

function _laterActiveSplashScreen() { splashScreenLoader.active = true }
function _laterDeactiveSplashScreen() { splashScreenLoader.active = false }

Component.onCompleted: () => Qt.callLater(_laterActiveSplashScreen)
}

0 comments on commit f642d15

Please sign in to comment.