Skip to content

Commit

Permalink
Maintain compatibility to Qt 5.12 (for Focal) (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke authored Nov 10, 2022
1 parent 2099b0c commit 745d220
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions visualization/motion_planning_tasks/src/task_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ TaskPanel::TaskPanel(QWidget* parent) : rviz_common::Panel(parent), d_ptr(new Ta
Q_D(TaskPanel);

// sync checked tool button with displayed widget
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(d->tool_buttons_group, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::idClicked), d->stackedWidget,
[d](int index) { d->stackedWidget->setCurrentIndex(index); });
#else
connect(d->tool_buttons_group, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
d->stackedWidget, [d](int index) { d->stackedWidget->setCurrentIndex(index); });
#endif
connect(d->stackedWidget, &QStackedWidget::currentChanged, d->tool_buttons_group,
[d](int index) { d->tool_buttons_group->button(index)->setChecked(true); });

Expand Down

0 comments on commit 745d220

Please sign in to comment.