| 435 | } |
| 436 | |
| 437 | void IdealButtonBarWidget::removeAction(QAction* widgetAction) |
| 438 | { |
| 439 | const QScopeGuard emptyChangedGuard([this] { |
| 440 | if (isEmpty()) { |
| 441 | emit emptyChanged(); |
| 442 | } |
| 443 | }); |
| 444 | |
| 445 | QWidget::removeAction(widgetAction); |
| 446 | |
| 447 | auto* const action = qobject_cast<ToolViewAction*>(widgetAction); |
| 448 | if (!action) { |
| 449 | return; |
| 450 | } |
| 451 | |
| 452 | m_lastCheckedActionsTracker->aboutToDestroy(action); |
| 453 | delete action->button(); |
| 454 | delete action; |
| 455 | } |
| 456 | |
| 457 | bool IdealButtonBarWidget::isEmpty() const |
| 458 | { |
no test coverage detected