core/reloader: add reload signals for visual notifications

This commit is contained in:
outfoxxed 2024-05-30 02:39:37 -07:00
parent 569c40494d
commit 7feae55ebe
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
5 changed files with 48 additions and 6 deletions

View file

@ -265,12 +265,16 @@ void EngineGeneration::assignIncubationController() {
this->engine->setIncubationController(controller);
}
EngineGeneration* EngineGeneration::findEngineGeneration(QQmlEngine* engine) {
return g_generations.value(engine);
}
EngineGeneration* EngineGeneration::findObjectGeneration(QObject* object) {
while (object != nullptr) {
auto* context = QQmlEngine::contextForObject(object);
if (context != nullptr) {
if (auto* generation = g_generations.value(context->engine())) {
if (auto* generation = EngineGeneration::findEngineGeneration(context->engine())) {
return generation;
}
}