summaryrefslogtreecommitdiff
path: root/examples/triage/byte.cpp
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2019-05-25 14:44:12 -0400
committerBrian Potchik <brian@vector35.com>2019-05-25 14:44:12 -0400
commita3b1547175eb776498f15ff662ecf309a7af8009 (patch)
tree7c7d2cd962a13f2e9ef6fe54f5de4433a68495f5 /examples/triage/byte.cpp
parent42b86fa6d2d7b03ac8e6cec6df02e0dc2707ac8d (diff)
Fix remaining button state tracking bugs.
Diffstat (limited to 'examples/triage/byte.cpp')
-rw-r--r--examples/triage/byte.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/examples/triage/byte.cpp b/examples/triage/byte.cpp
index b1ff46fd..cac2c587 100644
--- a/examples/triage/byte.cpp
+++ b/examples/triage/byte.cpp
@@ -44,7 +44,6 @@ ByteView::ByteView(QWidget* parent, BinaryViewRef data): QAbstractScrollArea(par
m_selectionVisible = false;
m_caretVisible = false;
m_caretBlink = true;
- m_leftButtonDown = false;
m_cols = 128;
m_updatesRequired = false;
m_visibleRows = 1;
@@ -783,7 +782,6 @@ void ByteView::focusInEvent(QFocusEvent*)
void ByteView::focusOutEvent(QFocusEvent*)
{
m_caretVisible = false;
- m_leftButtonDown = false;
updateCaret();
}
@@ -1069,13 +1067,12 @@ void ByteView::mousePressEvent(QMouseEvent* event)
repositionCaret();
if ((event->modifiers() & Qt::ShiftModifier) != 0)
viewport()->update();
- m_leftButtonDown = true;
}
void ByteView::mouseMoveEvent(QMouseEvent* event)
{
- if (!m_leftButtonDown)
+ if (event->buttons() != Qt::LeftButton)
return;
int x = (event->x() - 2) / m_render.getFontWidth() - ((int)m_addrWidth + 2);
int y = (event->y() - 2) / m_render.getFontHeight();
@@ -1089,14 +1086,6 @@ void ByteView::mouseMoveEvent(QMouseEvent* event)
}
-void ByteView::mouseReleaseEvent(QMouseEvent* event)
-{
- if (event->button() != Qt::LeftButton)
- return;
- m_leftButtonDown = false;
-}
-
-
ByteViewType::ByteViewType(): ViewType("Bytes", "Byte Overview")
{
}