core/lazyloader: add activeAsync property

This commit is contained in:
outfoxxed 2024-04-30 17:01:09 -07:00
parent 658f3cf411
commit 4db28fe725
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
2 changed files with 17 additions and 0 deletions

View file

@ -88,6 +88,12 @@ void LazyLoader::setActive(bool active) {
}
}
void LazyLoader::setActiveAsync(bool active) {
if (active == (this->targetActive || this->targetLoading)) return;
if (active) this->setLoading(true);
else this->setActive(false);
}
QQmlComponent* LazyLoader::component() const {
return this->cleanupComponent ? nullptr : this->mComponent;
}