CLinkDialog: Make use of Qt 5 signals and slots
This commit is contained in:
parent
993f018bd1
commit
8f0a3669d4
|
@ -191,17 +191,18 @@ void CLinkDialog::OnPickFromViewportClicked()
|
||||||
if (pButton && pButton->isChecked())
|
if (pButton && pButton->isChecked())
|
||||||
{
|
{
|
||||||
mpEditor->EnterPickMode(ENodeType::Script, true, false, false);
|
mpEditor->EnterPickMode(ENodeType::Script, true, false, false);
|
||||||
connect(mpEditor, SIGNAL(PickModeClick(SRayIntersection,QMouseEvent*)), this, SLOT(OnPickModeClick(SRayIntersection,QMouseEvent*)));
|
connect(mpEditor, &CWorldEditor::PickModeClick, this, &CLinkDialog::OnPickModeClick);
|
||||||
connect(mpEditor, SIGNAL(PickModeExited()), this, SLOT(OnPickModeExit()));
|
connect(mpEditor, &CWorldEditor::PickModeExited, this, &CLinkDialog::OnPickModeExit);
|
||||||
|
|
||||||
QPushButton *pOtherButton = (pButton == ui->SenderPickFromViewport ? ui->ReceiverPickFromViewport : ui->SenderPickFromViewport);
|
QPushButton *pOtherButton = (pButton == ui->SenderPickFromViewport ? ui->ReceiverPickFromViewport : ui->SenderPickFromViewport);
|
||||||
pOtherButton->setChecked(false);
|
pOtherButton->setChecked(false);
|
||||||
|
|
||||||
mIsPicking = true;
|
mIsPicking = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
{
|
||||||
mpEditor->ExitPickMode();
|
mpEditor->ExitPickMode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLinkDialog::OnPickModeClick(const SRayIntersection& rkHit, QMouseEvent* /*pEvent*/)
|
void CLinkDialog::OnPickModeClick(const SRayIntersection& rkHit, QMouseEvent* /*pEvent*/)
|
||||||
|
@ -220,8 +221,8 @@ void CLinkDialog::OnPickModeExit()
|
||||||
{
|
{
|
||||||
ui->SenderPickFromViewport->setChecked(false);
|
ui->SenderPickFromViewport->setChecked(false);
|
||||||
ui->ReceiverPickFromViewport->setChecked(false);
|
ui->ReceiverPickFromViewport->setChecked(false);
|
||||||
disconnect(mpEditor, SIGNAL(PickModeClick(SRayIntersection,QMouseEvent*)), this, 0);
|
disconnect(mpEditor, &CWorldEditor::PickModeClick, this, nullptr);
|
||||||
disconnect(mpEditor, SIGNAL(PickModeExited()), this, 0);
|
disconnect(mpEditor, &CWorldEditor::PickModeExited, this, nullptr);
|
||||||
mIsPicking = false;
|
mIsPicking = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue