From fc7076763642b76c6a999ef8f83458cf77074255 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 10 Oct 2019 01:16:58 +0200 Subject: [PATCH] Ref T730, initially update cockpit UI values "after some time", just to make sure the UI refelcts the context state --- src/blackgui/components/cockpitcomcomponent.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/blackgui/components/cockpitcomcomponent.cpp b/src/blackgui/components/cockpitcomcomponent.cpp index a4c2212c7..900570a6b 100644 --- a/src/blackgui/components/cockpitcomcomponent.cpp +++ b/src/blackgui/components/cockpitcomcomponent.cpp @@ -81,6 +81,14 @@ namespace BlackGui // network connect(sGui->getIContextNetwork(), &IContextNetwork::changedAtcStationsOnlineDigest, this, &CCockpitComComponent::onAtcStationsChanged, Qt::QueuedConnection); + + QPointer myself(this); + QTimer::singleShot(10 * 1000, this, [ = ] + { + if (!sGui || sGui->isShuttingDown() || !myself) { return; } + const CSimulatedAircraft aircraft = sGui->getIContextOwnAircraft()->getOwnAircraft(); + this->updateCockpitFromContext(aircraft, CIdentifier::fake()); + }); } } @@ -94,7 +102,7 @@ namespace BlackGui void CCockpitComComponent::paintEvent(QPaintEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event) CStyleSheetUtility::useStyleSheetInDerivedWidget(this); }