Ref T730, initially update cockpit UI values "after some time", just to make sure the UI refelcts the context state

This commit is contained in:
Klaus Basan
2019-10-10 01:16:58 +02:00
committed by Mat Sutcliffe
parent 10f696d558
commit fc70767636

View File

@@ -81,6 +81,14 @@ namespace BlackGui
// network
connect(sGui->getIContextNetwork(), &IContextNetwork::changedAtcStationsOnlineDigest, this, &CCockpitComComponent::onAtcStationsChanged, Qt::QueuedConnection);
QPointer<CCockpitComComponent> 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);
}