From 4db18745b6d13703b53e4189eeaa8b98ef2245ba Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Wed, 15 Dec 2010 14:08:25 +0100
Subject: [PATCH] bineditor: don't draw blinking cursor when we have a
 selection

Reviewed-by: ck
---
 src/plugins/bineditor/bineditor.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/plugins/bineditor/bineditor.cpp b/src/plugins/bineditor/bineditor.cpp
index dc796bad386..e557ce8c14c 100644
--- a/src/plugins/bineditor/bineditor.cpp
+++ b/src/plugins/bineditor/bineditor.cpp
@@ -871,6 +871,7 @@ void BinEditor::paintEvent(QPaintEvent *e)
         }
 
         int x = -xoffset +  m_margin + m_labelWidth;
+        bool cursorWanted = m_cursorPosition == m_anchorPosition;
 
         if (isFullySelected) {
             painter.save();
@@ -893,7 +894,7 @@ void BinEditor::paintEvent(QPaintEvent *e)
         }
 
 
-        if (cursor >= 0) {
+        if (cursor >= 0 && cursorWanted) {
             int w = fm.boundingRect(itemString.mid(cursor*3, 2)).width();
             QRect cursorRect(x + cursor * m_columnWidth, y - m_ascent, w + 1, m_lineHeight);
             painter.save();
@@ -933,7 +934,7 @@ void BinEditor::paintEvent(QPaintEvent *e)
             }
         }
 
-        if (cursor >= 0 && !printable.isEmpty()) {
+        if (cursor >= 0 && !printable.isEmpty() && cursorWanted) {
             QRect cursorRect(text_x + fm.width(printable.left(cursor)),
                              y-m_ascent,
                              fm.width(printable.at(cursor)),
-- 
GitLab