mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Ref T592, made dock widget related slots Qt::QueuedConnection
Rational: the widget emits floating but is not yet in full floating state, so with a direct connection we deal a bit too early with the widget. Much more stable (hopefully) using queued connection, then all the handling is done if the window is really a floating window.
This commit is contained in:
committed by
Mat Sutcliffe
parent
423a7dc6f8
commit
9f0daa58ea
@@ -87,7 +87,7 @@ namespace BlackGui
|
||||
bool CAircraftComponent::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget)
|
||||
{
|
||||
CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea(parentDockableWidget);
|
||||
const bool c = connect(this->getParentInfoArea(), &CInfoArea::changedInfoAreaTabBarIndex, this, &CAircraftComponent::onInfoAreaTabBarChanged);
|
||||
const bool c = connect(this->getParentInfoArea(), &CInfoArea::changedInfoAreaTabBarIndex, this, &CAircraftComponent::onInfoAreaTabBarChanged, Qt::QueuedConnection);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "failed connect");
|
||||
Q_ASSERT_X(parentDockableWidget, Q_FUNC_INFO, "missing parent");
|
||||
return c && parentDockableWidget;
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace BlackGui
|
||||
bool CAtcStationComponent::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget)
|
||||
{
|
||||
CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea(parentDockableWidget);
|
||||
const bool c = connect(this->getParentInfoArea(), &CInfoArea::changedInfoAreaTabBarIndex, this, &CAtcStationComponent::infoAreaTabBarChanged);
|
||||
const bool c = connect(this->getParentInfoArea(), &CInfoArea::changedInfoAreaTabBarIndex, this, &CAtcStationComponent::infoAreaTabBarChanged, Qt::QueuedConnection);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "failed connect");
|
||||
Q_ASSERT_X(parentDockableWidget, Q_FUNC_INFO, "missing parent");
|
||||
return c && parentDockableWidget;
|
||||
|
||||
@@ -27,9 +27,9 @@ namespace BlackGui
|
||||
ui->setupUi(this);
|
||||
m_minHeightInfoArea = ui->comp_CockpitInfoArea->minimumHeight();
|
||||
|
||||
connect(ui->wip_CockpitComPanelShowHideBar, &CShowHideBar::toggleShowHide, this, &CCockpitComponent::onToggleShowHideDetails);
|
||||
connect(ui->comp_CockpitComComponent, &CCockpitComComponent::requestCom1TextMessage, this, &CCockpitComponent::onRequestTextMessageCom1);
|
||||
connect(ui->comp_CockpitComComponent, &CCockpitComComponent::requestCom2TextMessage, this, &CCockpitComponent::onRequestTextMessageCom2);
|
||||
connect(ui->wip_CockpitComPanelShowHideBar, &CShowHideBar::toggleShowHide, this, &CCockpitComponent::onToggleShowHideDetails, Qt::QueuedConnection);
|
||||
connect(ui->comp_CockpitComComponent, &CCockpitComComponent::requestCom1TextMessage, this, &CCockpitComponent::onRequestTextMessageCom1, Qt::QueuedConnection);
|
||||
connect(ui->comp_CockpitComComponent, &CCockpitComComponent::requestCom2TextMessage, this, &CCockpitComponent::onRequestTextMessageCom2, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
CCockpitComponent::~CCockpitComponent()
|
||||
@@ -41,7 +41,7 @@ namespace BlackGui
|
||||
bool ok = CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea(parentDockableWidget);
|
||||
if (ok && parentDockableWidget)
|
||||
{
|
||||
ok = connect(parentDockableWidget, &QDockWidget::topLevelChanged, this, &CCockpitComponent::onToggleFloating);
|
||||
ok = connect(parentDockableWidget, &QDockWidget::topLevelChanged, this, &CCockpitComponent::onToggleFloating, Qt::QueuedConnection);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
@@ -285,14 +285,14 @@ namespace BlackGui
|
||||
|
||||
// save
|
||||
a = new QAction(CIcons::save16(), "Save state", this);
|
||||
c = connect(a, &QAction::triggered, this, &CNavigatorDialog::saveToSettings);
|
||||
c = connect(a, &QAction::triggered, this, &CNavigatorDialog::saveToSettings, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
this->addAction(a);
|
||||
|
||||
// close
|
||||
const QIcon i(CIcons::changeIconBackgroundColor(this->style()->standardIcon(QStyle::SP_TitleBarCloseButton), Qt::white, QSize(16, 16)));
|
||||
a = new QAction(i, "Close", this);
|
||||
c = connect(a, &QAction::triggered, this, &CNavigatorDialog::close);
|
||||
c = connect(a, &QAction::triggered, this, &CNavigatorDialog::close, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
this->addAction(a);
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace BlackGui
|
||||
bool CTextMessageComponent::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget)
|
||||
{
|
||||
bool c = CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea(parentDockableWidget);
|
||||
c = c && connect(this->getDockWidgetInfoArea(), &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CTextMessageComponent::topLevelChanged);
|
||||
c = c && connect(this->getDockWidgetInfoArea(), &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CTextMessageComponent::topLevelChanged, Qt::QueuedConnection);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace BlackGui
|
||||
bool CWeatherComponent::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget)
|
||||
{
|
||||
CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea(parentDockableWidget);
|
||||
bool c = connect(this->getParentInfoArea(), &CInfoArea::changedInfoAreaTabBarIndex, this, &CWeatherComponent::infoAreaTabBarChanged);
|
||||
bool c = connect(this->getParentInfoArea(), &CInfoArea::changedInfoAreaTabBarIndex, this, &CWeatherComponent::infoAreaTabBarChanged, Qt::QueuedConnection);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "failed connect");
|
||||
Q_ASSERT_X(parentDockableWidget, Q_FUNC_INFO, "missing parent");
|
||||
return c && parentDockableWidget;
|
||||
|
||||
Reference in New Issue
Block a user