File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 3
3
#include < qcontainerfwd.h>
4
4
#include < qobject.h>
5
5
#include < qqmllist.h>
6
+ #include < qtimer.h>
6
7
7
8
#include " generation.hpp"
8
9
@@ -12,8 +13,10 @@ void Reloadable::componentComplete() {
12
13
if (this ->engineGeneration != nullptr ) {
13
14
// When called this way there is no chance a reload will have old data,
14
15
// but this will at least help prevent weird behaviors due to never getting a reload.
15
- if (this ->engineGeneration ->reloadComplete ) this ->reload ();
16
- else {
16
+ if (this ->engineGeneration ->reloadComplete ) {
17
+ // Delayed due to Component.onCompleted running after QQmlParserStatus::componentComplete.
18
+ QTimer::singleShot (0 , this , &Reloadable::onReloadFinished);
19
+ } else {
17
20
QObject::connect (
18
21
this ->engineGeneration ,
19
22
&EngineGeneration::reloadFinished,
You can’t perform that action at this time.
0 commit comments