CLinkDialog: Make use of Qt 5 signals and slots

This commit is contained in:
Lioncash 2020-07-03 07:39:41 -04:00
parent 993f018bd1
commit 8f0a3669d4
1 changed files with 6 additions and 5 deletions

View File

@ -191,18 +191,19 @@ void CLinkDialog::OnPickFromViewportClicked()
if (pButton && pButton->isChecked())
{
mpEditor->EnterPickMode(ENodeType::Script, true, false, false);
connect(mpEditor, SIGNAL(PickModeClick(SRayIntersection,QMouseEvent*)), this, SLOT(OnPickModeClick(SRayIntersection,QMouseEvent*)));
connect(mpEditor, SIGNAL(PickModeExited()), this, SLOT(OnPickModeExit()));
connect(mpEditor, &CWorldEditor::PickModeClick, this, &CLinkDialog::OnPickModeClick);
connect(mpEditor, &CWorldEditor::PickModeExited, this, &CLinkDialog::OnPickModeExit);
QPushButton *pOtherButton = (pButton == ui->SenderPickFromViewport ? ui->ReceiverPickFromViewport : ui->SenderPickFromViewport);
pOtherButton->setChecked(false);
mIsPicking = true;
}
else
{
mpEditor->ExitPickMode();
}
}
void CLinkDialog::OnPickModeClick(const SRayIntersection& rkHit, QMouseEvent* /*pEvent*/)
{
@ -220,8 +221,8 @@ void CLinkDialog::OnPickModeExit()
{
ui->SenderPickFromViewport->setChecked(false);
ui->ReceiverPickFromViewport->setChecked(false);
disconnect(mpEditor, SIGNAL(PickModeClick(SRayIntersection,QMouseEvent*)), this, 0);
disconnect(mpEditor, SIGNAL(PickModeExited()), this, 0);
disconnect(mpEditor, &CWorldEditor::PickModeClick, this, nullptr);
disconnect(mpEditor, &CWorldEditor::PickModeExited, this, nullptr);
mIsPicking = false;
}