Maintain compatibility to Qt 5.12 (for Focal) (#392)

This commit is contained in:
Robert Haschke 2022-11-10 08:00:03 +01:00 committed by GitHub
parent 2099b0cb0b
commit 745d220efd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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); });