fix: Prevent crash on cancelling quick refactor via progress widget

This commit is contained in:
Petr Mironychev
2026-05-28 16:00:18 +02:00
parent 33321b2499
commit bfcd8dc1fb
2 changed files with 21 additions and 19 deletions

View File

@@ -142,10 +142,12 @@ void ProgressWidget::leaveEvent(QEvent *event)
void ProgressWidget::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton && m_isHovered) {
event->accept();
auto callback = m_cancelCallback;
emit cancelRequested();
if (m_cancelCallback) {
m_cancelCallback();
}
if (callback)
callback();
return;
}
QWidget::mousePressEvent(event);
}