mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
fix: Prevent crash on cancelling quick refactor via progress widget
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user