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 33#include < qcontainerfwd.h>
44#include < qobject.h>
55#include < qqmllist.h>
6+ #include < qtimer.h>
67
78#include " generation.hpp"
89
@@ -12,8 +13,10 @@ void Reloadable::componentComplete() {
1213 if (this ->engineGeneration != nullptr ) {
1314 // When called this way there is no chance a reload will have old data,
1415 // 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 {
1720 QObject::connect (
1821 this ->engineGeneration ,
1922 &EngineGeneration::reloadFinished,
You can’t perform that action at this time.
0 commit comments