Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: update state panel plugin #8846

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ void SpeedLimitDisplay::drawSpeedLimitIndicator(
painter.setRenderHint(QPainter::Antialiasing, true);
QColor colorFromHSV;
colorFromHSV.setHsv(bg_color.hue(), bg_color.saturation(), bg_color.value());
colorFromHSV.setAlphaF(bg_alpha);
painter.setBrush(colorFromHSV);
painter.drawEllipse(innerCircleRect);

Expand Down
64 changes: 48 additions & 16 deletions common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@
CustomSlider * pub_velocity_limit_slider_ = new CustomSlider(Qt::Horizontal);
pub_velocity_limit_slider_->setRange(0, 100);
pub_velocity_limit_slider_->setValue(0);
pub_velocity_limit_slider_->setMaximumWidth(300);

connect(pub_velocity_limit_slider_, &QSlider::sliderPressed, this, [this]() {
sliderIsDragging = true; // User starts dragging the handle
Expand Down Expand Up @@ -455,7 +454,13 @@
connect(emergency_button_ptr_, SIGNAL(clicked()), this, SLOT(onClickEmergencyButton()));
auto * utility_layout = new QVBoxLayout;
auto * velocity_limit_layout = new QHBoxLayout;
QLabel * velocity_limit_label = new QLabel("km/h");
auto * velocity_limit_label = new QLabel("km/h");

Check warning on line 457 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L457

Added line #L457 was not covered by tests

QFontMetrics fm(velocity_limit_value_label_->font());
int width = fm.horizontalAdvance("999");

Check warning on line 460 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L459-L460

Added lines #L459 - L460 were not covered by tests

// Set the fixed width for the label
velocity_limit_value_label_->setFixedWidth(width);

Check warning on line 463 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L463

Added line #L463 was not covered by tests

velocity_limit_layout->addWidget(pub_velocity_limit_slider_);
velocity_limit_layout->addSpacing(5);
Expand Down Expand Up @@ -558,19 +563,20 @@
routing_icon->updateStyle(state, bgColor);
routing_label_ptr_->setText(route_state);

clear_route_button_ptr_->updateStyle(

Check warning on line 566 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L566

Added line #L566 was not covered by tests
"Clear Route",
QColor(autoware::state_rviz_plugin::colors::default_colors.surface_container_low.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.primary.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.surface_container_low_hover.c_str()),
QColor(

Check warning on line 571 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L568-L571

Added lines #L568 - L571 were not covered by tests
autoware::state_rviz_plugin::colors::default_colors.surface_container_low_pressed.c_str()),
QColor(

Check warning on line 573 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L573

Added line #L573 was not covered by tests
autoware::state_rviz_plugin::colors::default_colors.surface_container_low_pressed.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.disabled_button_bg.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.disabled_button_text.c_str()));

Check warning on line 576 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L575-L576

Added lines #L575 - L576 were not covered by tests
if (msg->state == RouteState::SET) {
activateButton(clear_route_button_ptr_);
} else {

Check warning on line 579 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Code Duplication

The module contains 4 functions with similar structure: AutowareStatePanel::makeLocalizationGroup,AutowareStatePanel::makeMotionGroup,AutowareStatePanel::onMotion,AutowareStatePanel::onRoute. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
clear_route_button_ptr_->setStyleSheet(
QString("QPushButton {"
"background-color: %1;color: %2;"
"border: 2px solid %3;"
"font-weight: bold;"
"}")
.arg(autoware::state_rviz_plugin::colors::default_colors.surface_container_highest.c_str())
.arg(autoware::state_rviz_plugin::colors::default_colors.outline.c_str())
.arg(
autoware::state_rviz_plugin::colors::default_colors.surface_container_highest.c_str()));
deactivateButton(clear_route_button_ptr_);
}
}
Expand Down Expand Up @@ -608,6 +614,17 @@

localization_icon->updateStyle(state, bgColor);
localization_label_ptr_->setText(localization_state);
init_by_gnss_button_ptr_->updateStyle(

Check warning on line 617 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L617

Added line #L617 was not covered by tests
"Initialize with GNSS",
QColor(autoware::state_rviz_plugin::colors::default_colors.surface_container_low.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.primary.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.surface_container_low_hover.c_str()),
QColor(

Check warning on line 622 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L619-L622

Added lines #L619 - L622 were not covered by tests
autoware::state_rviz_plugin::colors::default_colors.surface_container_low_pressed.c_str()),
QColor(

Check warning on line 624 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L624

Added line #L624 was not covered by tests
autoware::state_rviz_plugin::colors::default_colors.surface_container_low_pressed.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.disabled_button_bg.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.disabled_button_text.c_str()));

Check warning on line 627 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L626-L627

Added lines #L626 - L627 were not covered by tests
}

void AutowareStatePanel::onMotion(const MotionState::ConstSharedPtr msg)
Expand Down Expand Up @@ -644,6 +661,17 @@
motion_icon->updateStyle(state, bgColor);
motion_label_ptr_->setText(motion_state);

accept_start_button_ptr_->updateStyle(

Check warning on line 664 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L664

Added line #L664 was not covered by tests
"Accept Start",
QColor(autoware::state_rviz_plugin::colors::default_colors.surface_container_low.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.primary.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.surface_container_low_hover.c_str()),
QColor(

Check warning on line 669 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L666-L669

Added lines #L666 - L669 were not covered by tests
autoware::state_rviz_plugin::colors::default_colors.surface_container_low_pressed.c_str()),
QColor(

Check warning on line 671 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L671

Added line #L671 was not covered by tests
autoware::state_rviz_plugin::colors::default_colors.surface_container_low_pressed.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.disabled_button_bg.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.disabled_button_text.c_str()));

Check warning on line 674 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L673-L674

Added lines #L673 - L674 were not covered by tests
if (msg->state == MotionState::STARTING) {
activateButton(accept_start_button_ptr_);
} else {
Expand Down Expand Up @@ -746,16 +774,20 @@
emergency_button_ptr_->updateStyle(
"Clear Emergency",
QColor(autoware::state_rviz_plugin::colors::default_colors.error_container.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.error.c_str()),

Check warning on line 777 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L777

Added line #L777 was not covered by tests
QColor(autoware::state_rviz_plugin::colors::default_colors.on_error_container.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.on_error.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.on_error_container.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.error_press.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.error_press.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.error_container.c_str()),

Check warning on line 781 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L779-L781

Added lines #L779 - L781 were not covered by tests
QColor(autoware::state_rviz_plugin::colors::default_colors.error_container.c_str()));
} else {
emergency_button_ptr_->updateStyle(
"Set Emergency", QColor(autoware::state_rviz_plugin::colors::default_colors.primary.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.on_primary.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.on_primary_container.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.on_primary.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.hover_button_bg.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.pressed_button_bg.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.checked_button_bg.c_str()),
QColor(autoware::state_rviz_plugin::colors::default_colors.error_container.c_str()),

Check warning on line 790 in common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/autoware_state_panel.cpp#L787-L790

Added lines #L787 - L790 were not covered by tests
QColor(autoware::state_rviz_plugin::colors::default_colors.surface_tint.c_str()));
}
}
Expand Down
49 changes: 38 additions & 11 deletions common/tier4_state_rviz_plugin/src/custom_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@

CustomElevatedButton::CustomElevatedButton(
const QString & text, const QColor & bgColor, const QColor & textColor, const QColor & hoverColor,
const QColor & disabledBgColor, const QColor & disabledTextColor, QWidget * parent)
const QColor & pressedColor, const QColor & checkedColor, const QColor & disabledBgColor,
const QColor & disabledTextColor, QWidget * parent)

Check warning on line 21 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L21

Added line #L21 was not covered by tests
: QPushButton(text, parent),
backgroundColor(bgColor),
textColor(textColor),
hoverColor(hoverColor),
pressedColor(pressedColor),
checkedColor(checkedColor),
disabledBgColor(disabledBgColor),
disabledTextColor(disabledTextColor)
{
Expand Down Expand Up @@ -63,12 +66,15 @@
// cppcheck-suppress unusedFunction
void CustomElevatedButton::updateStyle(
const QString & text, const QColor & bgColor, const QColor & textColor, const QColor & hoverColor,
const QColor & disabledBgColor, const QColor & disabledTextColor)
const QColor & pressedColor, const QColor & checkedColor, const QColor & disabledBgColor,
const QColor & disabledTextColor)
{
setText(text);
backgroundColor = bgColor;
this->textColor = textColor;
this->hoverColor = hoverColor;
this->pressedColor = pressedColor;
this->checkedColor = checkedColor;

Check notice on line 77 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Excess Number of Function Arguments

CustomElevatedButton::updateStyle increases from 6 to 8 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 77 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L76-L77

Added lines #L76 - L77 were not covered by tests
this->disabledBgColor = disabledBgColor;
this->disabledTextColor = disabledTextColor;
update(); // Force repaint
Expand All @@ -89,10 +95,16 @@
if (!isEnabled()) {
buttonColor = disabledBgColor;
currentTextColor = disabledTextColor;
} else if (isHovered) {
buttonColor = hoverColor;
} else {
buttonColor = backgroundColor;
if (isPressed) {
buttonColor = pressedColor;

Check warning on line 100 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L100

Added line #L100 was not covered by tests
} else if (isChecked) {
buttonColor = checkedColor;

Check warning on line 102 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L102

Added line #L102 was not covered by tests
} else if (isHovered) {
buttonColor = hoverColor;

Check warning on line 104 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L104

Added line #L104 was not covered by tests
} else {
buttonColor = backgroundColor;

Check warning on line 106 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L106

Added line #L106 was not covered by tests
}
}

int cornerRadius = height() / 2; // Making the corner radius proportional to the height
Expand All @@ -101,19 +113,14 @@
QPainterPath backgroundPath;
backgroundPath.addRoundedRect(r, cornerRadius, cornerRadius);
if (!isEnabled()) {
painter.setBrush(
QColor(autoware::state_rviz_plugin::colors::default_colors.on_surface.c_str()));
painter.setOpacity(0.12);
painter.setBrush(disabledBgColor);

Check warning on line 116 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L116

Added line #L116 was not covered by tests
} else {
painter.setBrush(buttonColor);
}
painter.setPen(Qt::NoPen);
painter.drawPath(backgroundPath);

// Draw button text
if (!isEnabled()) {
painter.setOpacity(0.38);
}
painter.setPen(currentTextColor);
painter.drawText(r, Qt::AlignCenter, text());
}
Expand All @@ -131,3 +138,23 @@
update();
QPushButton::leaveEvent(event);
}

void CustomElevatedButton::mousePressEvent(QMouseEvent * event)

Check warning on line 142 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L142

Added line #L142 was not covered by tests
{
isPressed = true;
update();
QPushButton::mousePressEvent(event);

Check warning on line 146 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L144-L146

Added lines #L144 - L146 were not covered by tests
}

void CustomElevatedButton::mouseReleaseEvent(QMouseEvent * event)

Check warning on line 149 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L149

Added line #L149 was not covered by tests
{
isPressed = false;
update();
QPushButton::mouseReleaseEvent(event);

Check warning on line 153 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L151-L153

Added lines #L151 - L153 were not covered by tests
}

void CustomElevatedButton::setChecked(bool checked)

Check warning on line 156 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L156

Added line #L156 was not covered by tests
{
isChecked = checked;
update();

Check warning on line 159 in common/tier4_state_rviz_plugin/src/custom_button.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_button.cpp#L158-L159

Added lines #L158 - L159 were not covered by tests
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@

CustomSegmentedButtonItem::CustomSegmentedButtonItem(const QString & text, QWidget * parent)
: QPushButton(text, parent),
bgColor(
QColor(autoware::state_rviz_plugin::colors::default_colors.surface_container_low.c_str())),
bgColor(QColor(autoware::state_rviz_plugin::colors::default_colors.surface.c_str())),

Check warning on line 18 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L18

Added line #L18 was not covered by tests
checkedBgColor(
QColor(autoware::state_rviz_plugin::colors::default_colors.secondary_container.c_str())),
QColor(autoware::state_rviz_plugin::colors::default_colors.on_secondary_fixed_variant.c_str())),
hoverColor(autoware::state_rviz_plugin::colors::default_colors.on_surface_hover_bg.c_str()),
pressedColor(autoware::state_rviz_plugin::colors::default_colors.on_surface_pressed_bg.c_str()),

Check warning on line 22 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L21-L22

Added lines #L21 - L22 were not covered by tests
inactiveTextColor(QColor(autoware::state_rviz_plugin::colors::default_colors.on_surface.c_str())),
activeTextColor(
QColor(autoware::state_rviz_plugin::colors::default_colors.on_secondary_container.c_str())),
disabledBgColor(autoware::state_rviz_plugin::colors::default_colors.surface.c_str()),
disabledTextColor(

Check warning on line 27 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L26-L27

Added lines #L26 - L27 were not covered by tests
autoware::state_rviz_plugin::colors::default_colors.on_surface_disabled.c_str()),
isHovered(false),
isActivated(false),
isDisabled(false)

isDisabled(false),
isPressed(false)

Check warning on line 32 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L31-L32

Added lines #L31 - L32 were not covered by tests
{
setCheckable(true);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
Expand Down Expand Up @@ -92,6 +96,8 @@
QColor buttonColor;
if (isDisabled) {
buttonColor = disabledBgColor;
} else if (isPressed) {
buttonColor = pressedColor;

Check notice on line 100 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Complex Method

CustomSegmentedButtonItem::paintEvent increases in cyclomatic complexity from 14 to 15, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 100 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L100

Added line #L100 was not covered by tests
} else if (isHovered && !isChecked() && isCheckable()) {
buttonColor = hoverColor;
} else if (isActivated) {
Expand Down Expand Up @@ -177,3 +183,21 @@
}
QPushButton::leaveEvent(event);
}

void CustomSegmentedButtonItem::mousePressEvent(QMouseEvent * event)

Check warning on line 187 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L187

Added line #L187 was not covered by tests
{
if (event->button() == Qt::LeftButton && !isDisabled) {
isPressed = true;
update();

Check warning on line 191 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L190-L191

Added lines #L190 - L191 were not covered by tests
}
QPushButton::mousePressEvent(event);

Check warning on line 193 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L193

Added line #L193 was not covered by tests
}

void CustomSegmentedButtonItem::mouseReleaseEvent(QMouseEvent * event)

Check warning on line 196 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L196

Added line #L196 was not covered by tests
{
if (event->button() == Qt::LeftButton && !isDisabled) {
isPressed = false;
update();

Check warning on line 200 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L199-L200

Added lines #L199 - L200 were not covered by tests
}
QPushButton::mouseReleaseEvent(event);

Check warning on line 202 in common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp#L202

Added line #L202 was not covered by tests
}
Loading
Loading