CPoiMapSidebar: Make use of Qt 5 signals and slots
This commit is contained in:
parent
9c4c387696
commit
2d811bfe94
|
@ -278,8 +278,8 @@ void CPoiMapSidebar::OnPickButtonClicked()
|
||||||
if (pButton == ui->AddPoiFromViewportButton)
|
if (pButton == ui->AddPoiFromViewportButton)
|
||||||
{
|
{
|
||||||
Editor()->EnterPickMode(ENodeType::Script, true, false, false);
|
Editor()->EnterPickMode(ENodeType::Script, true, false, false);
|
||||||
connect(Editor(), SIGNAL(PickModeExited()), this, SLOT(StopPicking()));
|
connect(Editor(), &CWorldEditor::PickModeExited, this, &CPoiMapSidebar::StopPicking);
|
||||||
connect(Editor(), SIGNAL(PickModeClick(SRayIntersection,QMouseEvent*)), this, SLOT(OnPoiPicked(SRayIntersection,QMouseEvent*)));
|
connect(Editor(), &CWorldEditor::PickModeClick, this, &CPoiMapSidebar::OnPoiPicked);
|
||||||
|
|
||||||
pButton->setChecked(true);
|
pButton->setChecked(true);
|
||||||
ui->MapMeshesButton->setChecked(false);
|
ui->MapMeshesButton->setChecked(false);
|
||||||
|
@ -287,17 +287,17 @@ void CPoiMapSidebar::OnPickButtonClicked()
|
||||||
|
|
||||||
mPickType = EPickType::AddPOIs;
|
mPickType = EPickType::AddPOIs;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!pButton->isChecked())
|
if (!pButton->isChecked())
|
||||||
|
{
|
||||||
Editor()->ExitPickMode();
|
Editor()->ExitPickMode();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Editor()->EnterPickMode(ENodeType::Model, false, false, true);
|
Editor()->EnterPickMode(ENodeType::Model, false, false, true);
|
||||||
connect(Editor(), SIGNAL(PickModeExited()), this, SLOT(StopPicking()));
|
connect(Editor(), &CWorldEditor::PickModeExited, this, &CPoiMapSidebar::StopPicking);
|
||||||
connect(Editor(), SIGNAL(PickModeHoverChanged(SRayIntersection,QMouseEvent*)), this, SLOT(OnModelHover(SRayIntersection,QMouseEvent*)));
|
connect(Editor(), &CWorldEditor::PickModeHoverChanged, this, &CPoiMapSidebar::OnModelHover);
|
||||||
pButton->setChecked(true);
|
pButton->setChecked(true);
|
||||||
|
|
||||||
if (pButton == ui->MapMeshesButton)
|
if (pButton == ui->MapMeshesButton)
|
||||||
|
@ -305,7 +305,6 @@ void CPoiMapSidebar::OnPickButtonClicked()
|
||||||
mPickType = EPickType::AddMeshes;
|
mPickType = EPickType::AddMeshes;
|
||||||
ui->UnmapMeshesButton->setChecked(false);
|
ui->UnmapMeshesButton->setChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (pButton == ui->UnmapMeshesButton)
|
else if (pButton == ui->UnmapMeshesButton)
|
||||||
{
|
{
|
||||||
mPickType = EPickType::RemoveMeshes;
|
mPickType = EPickType::RemoveMeshes;
|
||||||
|
@ -326,9 +325,9 @@ void CPoiMapSidebar::StopPicking()
|
||||||
mpHoverModel = nullptr;
|
mpHoverModel = nullptr;
|
||||||
|
|
||||||
Editor()->ExitPickMode();
|
Editor()->ExitPickMode();
|
||||||
disconnect(Editor(), SIGNAL(PickModeExited()), this, 0);
|
disconnect(Editor(), &CWorldEditor::PickModeExited, this, nullptr);
|
||||||
disconnect(Editor(), SIGNAL(PickModeHoverChanged(SRayIntersection,QMouseEvent*)), this, 0);
|
disconnect(Editor(), &CWorldEditor::PickModeHoverChanged, this, nullptr);
|
||||||
disconnect(Editor(), SIGNAL(PickModeClick(SRayIntersection,QMouseEvent*)), this, 0);
|
disconnect(Editor(), &CWorldEditor::PickModeClick, this, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPoiMapSidebar::OnInstanceListButtonClicked()
|
void CPoiMapSidebar::OnInstanceListButtonClicked()
|
||||||
|
|
Loading…
Reference in New Issue