diff --git a/src/Mod/Robot/Gui/TaskDlgSimulate.cpp b/src/Mod/Robot/Gui/TaskDlgSimulate.cpp index 79871a59f7..a24bea02af 100644 --- a/src/Mod/Robot/Gui/TaskDlgSimulate.cpp +++ b/src/Mod/Robot/Gui/TaskDlgSimulate.cpp @@ -37,14 +37,11 @@ TaskDlgSimulate::TaskDlgSimulate(Robot::RobotObject *pcRobotObject,Robot::Trajec { rob = new TaskRobot6Axis(pcRobotObject); ctr = new TaskRobotControl(pcRobotObject); - + trac = new TaskTrajectory(pcRobotObject,pcTrajectoryObject); msg = new TaskRobotMessages(pcRobotObject); - - - QObject::connect( - trac, SIGNAL(axisChanged(float, float, float, float, float, float, const Base::Placement&)), - rob, SLOT(setAxis(float, float, float, float, float, float, const Base::Placement&))); + + QObject::connect(trac, &TaskTrajectory::axisChanged, rob, &TaskRobot6Axis::setAxis); Content.push_back(rob); Content.push_back(ctr); diff --git a/src/Mod/Robot/Gui/TaskEdge2TracParameter.cpp b/src/Mod/Robot/Gui/TaskEdge2TracParameter.cpp index 0a97695656..42e78fccab 100644 --- a/src/Mod/Robot/Gui/TaskEdge2TracParameter.cpp +++ b/src/Mod/Robot/Gui/TaskEdge2TracParameter.cpp @@ -53,9 +53,11 @@ TaskEdge2TracParameter::TaskEdge2TracParameter(Robot::Edge2TracObject *pcObject, this->groupLayout()->addWidget(proxy); - QObject::connect(ui->pushButton_HideShow,SIGNAL(clicked()),this,SLOT(hideShow())); - QObject::connect(ui->doubleSpinBoxSizing,SIGNAL(valueChanged (double)),this,SLOT(sizingValueChanged(double))); - QObject::connect(ui->checkBoxOrientation,SIGNAL(toggled (bool)),this,SLOT(orientationToggled(bool))); + QObject::connect(ui->pushButton_HideShow, &QPushButton::clicked, this, &TaskEdge2TracParameter::hideShow); + QObject::connect(ui->doubleSpinBoxSizing, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskEdge2TracParameter::sizingValueChanged); + QObject::connect(ui->checkBoxOrientation, &QCheckBox::toggled, + this, &TaskEdge2TracParameter::orientationToggled); setHideShowObject(); diff --git a/src/Mod/Robot/Gui/TaskRobot6Axis.cpp b/src/Mod/Robot/Gui/TaskRobot6Axis.cpp index 5aee5c7457..1acf5d16bc 100644 --- a/src/Mod/Robot/Gui/TaskRobot6Axis.cpp +++ b/src/Mod/Robot/Gui/TaskRobot6Axis.cpp @@ -49,17 +49,17 @@ TaskRobot6Axis::TaskRobot6Axis(Robot::RobotObject *pcRobotObject,QWidget *parent this->groupLayout()->addWidget(proxy); - QObject::connect(ui->horizontalSlider_Axis1,SIGNAL(sliderMoved(int)),this,SLOT(changeSliderA1(int))); - QObject::connect(ui->horizontalSlider_Axis2,SIGNAL(sliderMoved(int)),this,SLOT(changeSliderA2(int))); - QObject::connect(ui->horizontalSlider_Axis3,SIGNAL(sliderMoved(int)),this,SLOT(changeSliderA3(int))); - QObject::connect(ui->horizontalSlider_Axis4,SIGNAL(sliderMoved(int)),this,SLOT(changeSliderA4(int))); - QObject::connect(ui->horizontalSlider_Axis5,SIGNAL(sliderMoved(int)),this,SLOT(changeSliderA5(int))); - QObject::connect(ui->horizontalSlider_Axis6,SIGNAL(sliderMoved(int)),this,SLOT(changeSliderA6(int))); + QObject::connect(ui->horizontalSlider_Axis1, &QSlider::sliderMoved, this, &TaskRobot6Axis::changeSliderA1); + QObject::connect(ui->horizontalSlider_Axis2, &QSlider::sliderMoved, this, &TaskRobot6Axis::changeSliderA2); + QObject::connect(ui->horizontalSlider_Axis3, &QSlider::sliderMoved, this, &TaskRobot6Axis::changeSliderA3); + QObject::connect(ui->horizontalSlider_Axis4, &QSlider::sliderMoved, this, &TaskRobot6Axis::changeSliderA4); + QObject::connect(ui->horizontalSlider_Axis5, &QSlider::sliderMoved, this, &TaskRobot6Axis::changeSliderA5); + QObject::connect(ui->horizontalSlider_Axis6, &QSlider::sliderMoved, this, &TaskRobot6Axis::changeSliderA6); + QObject::connect(ui->pushButtonChooseTool, &QPushButton::clicked, this, &TaskRobot6Axis::createPlacementDlg); - QObject::connect(ui->pushButtonChooseTool,SIGNAL(clicked()),this,SLOT(createPlacementDlg())); - - if(pcRobotObject) + if (pcRobotObject) { setRobot(pcRobotObject); + } } TaskRobot6Axis::~TaskRobot6Axis() diff --git a/src/Mod/Robot/Gui/TaskRobot6Axis.h b/src/Mod/Robot/Gui/TaskRobot6Axis.h index dfe71800a8..b47067cfef 100644 --- a/src/Mod/Robot/Gui/TaskRobot6Axis.h +++ b/src/Mod/Robot/Gui/TaskRobot6Axis.h @@ -52,7 +52,7 @@ public: void setRobot(Robot::RobotObject *pcRobotObject); -private Q_SLOTS: +public Q_SLOTS: void setAxis(float A1,float A2,float A3,float A4,float A5,float A6,const Base::Placement &Tcp); void changeSliderA1(int value); void changeSliderA2(int value); diff --git a/src/Mod/Robot/Gui/TaskTrajectory.cpp b/src/Mod/Robot/Gui/TaskTrajectory.cpp index 1035e27a05..f052535545 100644 --- a/src/Mod/Robot/Gui/TaskTrajectory.cpp +++ b/src/Mod/Robot/Gui/TaskTrajectory.cpp @@ -78,21 +78,23 @@ TaskTrajectory::TaskTrajectory(Robot::RobotObject *pcRobotObject,Robot::Trajecto } - QObject::connect(ui->ButtonStepStart ,SIGNAL(clicked()),this,SLOT(start())); - QObject::connect(ui->ButtonStepStop ,SIGNAL(clicked()),this,SLOT(stop())); - QObject::connect(ui->ButtonStepRun ,SIGNAL(clicked()),this,SLOT(run())); - QObject::connect(ui->ButtonStepBack ,SIGNAL(clicked()),this,SLOT(back())); - QObject::connect(ui->ButtonStepForward ,SIGNAL(clicked()),this,SLOT(forward())); - QObject::connect(ui->ButtonStepEnd ,SIGNAL(clicked()),this,SLOT(end())); + QObject::connect(ui->ButtonStepStart , &QPushButton::clicked, this, &TaskTrajectory::start); + QObject::connect(ui->ButtonStepStop , &QPushButton::clicked, this, &TaskTrajectory::stop); + QObject::connect(ui->ButtonStepRun , &QPushButton::clicked, this, &TaskTrajectory::run); + QObject::connect(ui->ButtonStepBack , &QPushButton::clicked, this, &TaskTrajectory::back); + QObject::connect(ui->ButtonStepForward , &QPushButton::clicked, this, &TaskTrajectory::forward); + QObject::connect(ui->ButtonStepEnd , &QPushButton::clicked, this, &TaskTrajectory::end); // set up timer timer = new QTimer( this ); timer->setInterval(100); - QObject::connect(timer ,SIGNAL(timeout ()),this,SLOT(timerDone())); + QObject::connect(timer, &QTimer::timeout, this, &TaskTrajectory::timerDone); - QObject::connect( ui->timeSpinBox ,SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double)) ); - QObject::connect( ui->timeSlider ,SIGNAL(valueChanged(int) ), this, SLOT(valueChanged(int)) ); + QObject::connect(ui->timeSpinBox, qOverload(&QDoubleSpinBox::valueChanged), + this, qOverload(&TaskTrajectory::valueChanged)); + QObject::connect(ui->timeSlider, qOverload(&QSlider::valueChanged), + this, qOverload(&TaskTrajectory::valueChanged)); // get the view provider ViewProv = dynamic_cast(Gui::Application::Instance->activeDocument()->getViewProvider(pcRobotObject) ); diff --git a/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.cpp b/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.cpp index f7b4d5562b..ac87760151 100644 --- a/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.cpp +++ b/src/Mod/Robot/Gui/TaskTrajectoryDressUpParameter.cpp @@ -62,7 +62,8 @@ TaskTrajectoryDressUpParameter::TaskTrajectoryDressUpParameter(Robot::Trajectory PosAdd = pcObject->PosAdd.getValue(); viewPlacement(); - QObject::connect(ui->toolButtonChoosePlacement,SIGNAL(clicked()),this,SLOT(createPlacementDlg())); + QObject::connect(ui->toolButtonChoosePlacement, &QToolButton::clicked, + this, &TaskTrajectoryDressUpParameter::createPlacementDlg); } diff --git a/src/Mod/Robot/Gui/TrajectorySimulate.cpp b/src/Mod/Robot/Gui/TrajectorySimulate.cpp index 1a13a0b144..96fdef6b74 100644 --- a/src/Mod/Robot/Gui/TrajectorySimulate.cpp +++ b/src/Mod/Robot/Gui/TrajectorySimulate.cpp @@ -76,20 +76,21 @@ TrajectorySimulate::TrajectorySimulate(Robot::RobotObject *pcRobotObject,Robot:: } - QObject::connect(ui->ButtonStepStart, SIGNAL(clicked()), this, SLOT(start())); - QObject::connect(ui->ButtonStepStop, SIGNAL(clicked()), this, SLOT(stop())); - QObject::connect(ui->ButtonStepRun, SIGNAL(clicked()), this, SLOT(run())); - QObject::connect(ui->ButtonStepBack, SIGNAL(clicked()), this, SLOT(back())); - QObject::connect(ui->ButtonStepForward, SIGNAL(clicked()), this, SLOT(forward())); - QObject::connect(ui->ButtonStepEnd, SIGNAL(clicked()), this, SLOT(end())); + QObject::connect(ui->ButtonStepStart, &QPushButton::clicked, this, &TrajectorySimulate::start); + QObject::connect(ui->ButtonStepStop, &QPushButton::clicked, this, &TrajectorySimulate::stop); + QObject::connect(ui->ButtonStepRun, &QPushButton::clicked, this, &TrajectorySimulate::run); + QObject::connect(ui->ButtonStepBack, &QPushButton::clicked, this, &TrajectorySimulate::back); + QObject::connect(ui->ButtonStepForward, &QPushButton::clicked, this, &TrajectorySimulate::forward); + QObject::connect(ui->ButtonStepEnd, &QPushButton::clicked, this, &TrajectorySimulate::end); // set up timer timer = new QTimer(this); timer->setInterval(100); - QObject::connect(timer, SIGNAL(timeout()), this, SLOT(timerDone())); - QObject::connect(ui->timeSpinBox, SIGNAL(valueChanged(double)), this, - SLOT(valueChanged(double))); - QObject::connect(ui->timeSlider, SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int))); + QObject::connect(timer, &QTimer::timeout, this, &TrajectorySimulate::timerDone); + QObject::connect(ui->timeSpinBox, qOverload(&QDoubleSpinBox::valueChanged), + this, qOverload(&TrajectorySimulate::valueChanged)); + QObject::connect(ui->timeSlider, qOverload(&QSlider::valueChanged), + this, qOverload(&TrajectorySimulate::valueChanged)); // get the view provider ViewProv = static_cast(Gui::Application::Instance->activeDocument()->getViewProvider(pcRobotObject) );