We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a038f0 commit 5040f37Copy full SHA for 5040f37
src/core/reload.cpp
@@ -3,6 +3,7 @@
3
#include <qcontainerfwd.h>
4
#include <qobject.h>
5
#include <qqmllist.h>
6
+#include <qtimer.h>
7
8
#include "generation.hpp"
9
@@ -12,8 +13,10 @@ void Reloadable::componentComplete() {
12
13
if (this->engineGeneration != nullptr) {
14
// When called this way there is no chance a reload will have old data,
15
// but this will at least help prevent weird behaviors due to never getting a reload.
- if (this->engineGeneration->reloadComplete) this->reload();
16
- else {
+ if (this->engineGeneration->reloadComplete) {
17
+ // Delayed due to Component.onCompleted running after QQmlParserStatus::componentComplete.
18
+ QTimer::singleShot(0, this, &Reloadable::onReloadFinished);
19
+ } else {
20
QObject::connect(
21
this->engineGeneration,
22
&EngineGeneration::reloadFinished,
0 commit comments