diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-02-10 10:04:29 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-02-10 10:04:29 (GMT) |
commit | 7651a4bacf8f34f3700853f147093a073f0472ab (patch) | |
tree | d47559d6b0c6fc78b091095bbd8b8350c880e91b /src/gui/widgets/qlinecontrol.cpp | |
parent | 175605f736ce76a9c0296aa607a6a82ea6675542 (diff) | |
parent | f57a2756ebfb48c2fad94c0c319fa181d2af4dfd (diff) | |
download | Qt-7651a4bacf8f34f3700853f147093a073f0472ab.zip Qt-7651a4bacf8f34f3700853f147093a073f0472ab.tar.gz Qt-7651a4bacf8f34f3700853f147093a073f0472ab.tar.bz2 |
Merge remote branch 'remotes/qt/4.6' into lighthouse
Conflicts:
configure
tests/auto/qwidget/tst_qwidget.cpp
Diffstat (limited to 'src/gui/widgets/qlinecontrol.cpp')
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index b7ff1ee..9ab4569 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -510,10 +510,12 @@ void QLineControl::draw(QPainter *painter, const QPoint &offset, const QRect &cl o.format.setForeground(m_palette.brush(QPalette::HighlightedText)); } else { // mask selection - o.start = m_cursor; - o.length = 1; - o.format.setBackground(m_palette.brush(QPalette::Text)); - o.format.setForeground(m_palette.brush(QPalette::Window)); + if(!m_blinkPeriod || m_blinkStatus){ + o.start = m_cursor; + o.length = 1; + o.format.setBackground(m_palette.brush(QPalette::Text)); + o.format.setForeground(m_palette.brush(QPalette::Window)); + } } selections.append(o); } @@ -522,8 +524,11 @@ void QLineControl::draw(QPainter *painter, const QPoint &offset, const QRect &cl m_textLayout.draw(painter, offset, selections, clip); if (flags & DrawCursor){ + int cursor = m_cursor; + if (m_preeditCursor != -1) + cursor += m_preeditCursor; if(!m_blinkPeriod || m_blinkStatus) - m_textLayout.drawCursor(painter, offset, m_cursor, m_cursorWidth); + m_textLayout.drawCursor(painter, offset, cursor, m_cursorWidth); } } |