CSceneViewport: Make use of push_back over operator<<
This commit is contained in:
parent
aacf10f74c
commit
09b724fbb2
|
@ -200,12 +200,20 @@ void CSceneViewport::CreateContextMenu()
|
||||||
mpPlayFromHereAction = new QAction(tr("Play from here"), this);
|
mpPlayFromHereAction = new QAction(tr("Play from here"), this);
|
||||||
connect(mpPlayFromHereAction, &QAction::triggered, this, &CSceneViewport::OnPlayFromHere);
|
connect(mpPlayFromHereAction, &QAction::triggered, this, &CSceneViewport::OnPlayFromHere);
|
||||||
|
|
||||||
QList<QAction*> Actions;
|
const QList<QAction*> Actions{
|
||||||
Actions << mpToggleSelectAction
|
mpToggleSelectAction,
|
||||||
<< mpHideSelectionSeparator << mpHideSelectionAction << mpHideUnselectedAction
|
mpHideSelectionSeparator,
|
||||||
<< mpHideHoverSeparator << mpHideHoverNodeAction << mpHideHoverTypeAction << mpHideHoverLayerAction
|
mpHideSelectionAction,
|
||||||
<< mpUnhideSeparator << mpUnhideAllAction << mpPlayFromHereSeparator << mpPlayFromHereAction;
|
mpHideUnselectedAction,
|
||||||
|
mpHideHoverSeparator,
|
||||||
|
mpHideHoverNodeAction,
|
||||||
|
mpHideHoverTypeAction,
|
||||||
|
mpHideHoverLayerAction,
|
||||||
|
mpUnhideSeparator,
|
||||||
|
mpUnhideAllAction,
|
||||||
|
mpPlayFromHereSeparator,
|
||||||
|
mpPlayFromHereAction,
|
||||||
|
};
|
||||||
mpContextMenu->addActions(Actions);
|
mpContextMenu->addActions(Actions);
|
||||||
|
|
||||||
// Select Connected menu
|
// Select Connected menu
|
||||||
|
@ -220,9 +228,11 @@ void CSceneViewport::CreateContextMenu()
|
||||||
mpSelectConnectedAllAction = new QAction(tr("...via all links"), this);
|
mpSelectConnectedAllAction = new QAction(tr("...via all links"), this);
|
||||||
connect(mpSelectConnectedAllAction, &QAction::triggered, this, &CSceneViewport::OnSelectConnected);
|
connect(mpSelectConnectedAllAction, &QAction::triggered, this, &CSceneViewport::OnSelectConnected);
|
||||||
|
|
||||||
QList<QAction*> SelectConnectedActions;
|
mpSelectConnectedMenu->addActions({
|
||||||
SelectConnectedActions << mpSelectConnectedOutgoingAction << mpSelectConnectedIncomingAction << mpSelectConnectedAllAction;
|
mpSelectConnectedOutgoingAction,
|
||||||
mpSelectConnectedMenu->addActions(SelectConnectedActions);
|
mpSelectConnectedIncomingAction,
|
||||||
|
mpSelectConnectedAllAction,
|
||||||
|
});
|
||||||
mpContextMenu->insertMenu(mpHideSelectionSeparator, mpSelectConnectedMenu);
|
mpContextMenu->insertMenu(mpHideSelectionSeparator, mpSelectConnectedMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +247,7 @@ void CSceneViewport::FindConnectedObjects(uint32 InstanceID, bool SearchOutgoing
|
||||||
if (!pScript) return;
|
if (!pScript) return;
|
||||||
|
|
||||||
CScriptObject *pInst = pScript->Instance();
|
CScriptObject *pInst = pScript->Instance();
|
||||||
rIDList << InstanceID;
|
rIDList.push_back(InstanceID);
|
||||||
|
|
||||||
if (SearchOutgoing)
|
if (SearchOutgoing)
|
||||||
{
|
{
|
||||||
|
@ -438,8 +448,9 @@ void CSceneViewport::OnSelectConnected()
|
||||||
FindConnectedObjects(static_cast<CScriptNode*>(mpMenuNode)->Instance()->InstanceID(), SearchOutgoing, SearchIncoming, InstanceIDs);
|
FindConnectedObjects(static_cast<CScriptNode*>(mpMenuNode)->Instance()->InstanceID(), SearchOutgoing, SearchIncoming, InstanceIDs);
|
||||||
|
|
||||||
QList<CSceneNode*> Nodes;
|
QList<CSceneNode*> Nodes;
|
||||||
|
Nodes.reserve(InstanceIDs.size());
|
||||||
for (const uint32 ID : InstanceIDs)
|
for (const uint32 ID : InstanceIDs)
|
||||||
Nodes << mpScene->NodeForInstanceID(ID);
|
Nodes.push_back(mpScene->NodeForInstanceID(ID));
|
||||||
|
|
||||||
const bool ShouldClear = ((qApp->keyboardModifiers() & Qt::ControlModifier) == 0);
|
const bool ShouldClear = ((qApp->keyboardModifiers() & Qt::ControlModifier) == 0);
|
||||||
mpEditor->BatchSelectNodes(Nodes, ShouldClear, tr("Select Connected"));
|
mpEditor->BatchSelectNodes(Nodes, ShouldClear, tr("Select Connected"));
|
||||||
|
|
Loading…
Reference in New Issue