Commit 1b5648b5 authored by Aurindam Jana's avatar Aurindam Jana
Browse files

CrumblePath: Fix Crash



QWidget::mousePressEvent() closes the widget if the position is
not within the rect. A subsequent call to update() amounts to
accessing potentially corrupt memory. Hence call update() before
calling QWidget::mousePressEvent().

Change-Id: I850471d3a1dfdb0a4f0541a69fd2f239dbf8b5fa
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent 30fc5d56
......@@ -173,34 +173,34 @@ void CrumblePathButton::tintImages()
void CrumblePathButton::leaveEvent(QEvent *e)
{
QPushButton::leaveEvent(e);
m_isHovering = false;
update();
QPushButton::leaveEvent(e);
}
void CrumblePathButton::mouseMoveEvent(QMouseEvent *e)
{
if (!isEnabled())
return;
QPushButton::mouseMoveEvent(e);
m_isHovering = true;
update();
QPushButton::mouseMoveEvent(e);
}
void CrumblePathButton::mousePressEvent(QMouseEvent *e)
{
if (!isEnabled())
return;
QPushButton::mousePressEvent(e);
m_isPressed = true;
update();
QPushButton::mousePressEvent(e);
}
void CrumblePathButton::mouseReleaseEvent(QMouseEvent *e)
{
QPushButton::mouseReleaseEvent(e);
m_isPressed = false;
update();
QPushButton::mouseReleaseEvent(e);
}
void CrumblePathButton::changeEvent(QEvent *e)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment