Skip to content

Commit

Permalink
Fix sendEvent calls
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoomen committed Oct 30, 2023
1 parent cc947bf commit 0e42a77
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions tesseract_rviz/src/environment_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ void EnvironmentDisplay::update(float wall_dt, float ros_dt)
Display::update(wall_dt, ros_dt);

if (data_->widget != nullptr)
QApplication::sendEvent(qApp,
new tesseract_gui::events::PreRender(data_->widget->getComponentInfo()->getSceneName()));
{
tesseract_gui::events::PreRender event(data_->widget->getComponentInfo()->getSceneName());
QApplication::sendEvent(qApp, &event);
}
}

void EnvironmentDisplay::onEnable()
Expand Down
6 changes: 4 additions & 2 deletions tesseract_rviz/src/joint_trajectory_monitor_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ struct JointTrajectoryMonitorProperties::Implementation
tesseract_common::JointTrajectorySet trajectory_set(initial_state);
tesseract_common::JointTrajectory joint_trajectory = tesseract_rosutils::fromMsg(*msg);
trajectory_set.appendJointTrajectory(joint_trajectory);
QApplication::sendEvent(qApp, new tesseract_gui::events::JointTrajectoryAdd(component_info, trajectory_set));
tesseract_gui::events::JointTrajectoryAdd event(component_info, trajectory_set);
QApplication::sendEvent(qApp, &event);
}

void tesseractJointTrajectoryCallback(const tesseract_msgs::msg::Trajectory::ConstSharedPtr msg)
Expand Down Expand Up @@ -97,7 +98,8 @@ struct JointTrajectoryMonitorProperties::Implementation
{
tesseract_common::JointTrajectory joint_trajectory = tesseract_rosutils::fromMsg(joint_trajectory_msg);
trajectory_set.appendJointTrajectory(joint_trajectory);
QApplication::sendEvent(qApp, new tesseract_gui::events::JointTrajectoryAdd(component_info, trajectory_set));
tesseract_gui::events::JointTrajectoryAdd event(component_info, trajectory_set);
QApplication::sendEvent(qApp, &event);
}
}
catch (...)
Expand Down
6 changes: 4 additions & 2 deletions tesseract_rviz/src/workbench_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ void WorkbenchDisplay::update(float wall_dt, float ros_dt)
Display::update(wall_dt, ros_dt);

if (data_->widget != nullptr)
QApplication::sendEvent(qApp,
new tesseract_gui::events::PreRender(data_->widget->getComponentInfo()->getSceneName()));
{
tesseract_gui::events::PreRender event(data_->widget->getComponentInfo()->getSceneName());
QApplication::sendEvent(qApp, &event);
}
}

void WorkbenchDisplay::onEnableChanged()
Expand Down

0 comments on commit 0e42a77

Please sign in to comment.