From 42b69b1383375a52818758bf89198e8dc97902d3 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 9 Mar 2010 15:39:40 +0100 Subject: Cursor would remain in a non-focused QLineEdit after clearing its selection QLineEditPrivate::_q_selectionChanged() did not take into account whether the widget had focus. Reviewed-by: Olivier Task-number: QTBUG-8634 --- src/gui/widgets/qlineedit_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp index 2c76a5c..468c111 100644 --- a/src/gui/widgets/qlineedit_p.cpp +++ b/src/gui/widgets/qlineedit_p.cpp @@ -134,7 +134,7 @@ void QLineEditPrivate::_q_selectionChanged() q->initStyleOption(&opt); bool showCursor = control->hasSelectedText() ? q->style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, q): - true; + q->hasFocus(); setCursorVisible(showCursor); } -- cgit v0.12 From 95dd8a45b0da50fb32843dd275b2028ce77b2492 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 9 Mar 2010 17:16:02 +0100 Subject: Memory leak! Multiple insertions of the same (key, value) pair in a QMultiHash. Reviewed-by: Olivier Task-number: QTBUG-8862 --- src/gui/text/qtextformat.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index dca2da5..140cf43 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -3085,7 +3085,8 @@ int QTextFormatCollection::indexForFormat(const QTextFormat &format) f.d = new QTextFormatPrivate; f.d->resolveFont(defaultFnt); - hashes.insert(hash, idx); + if (!hashes.contains(hash, idx)) + hashes.insert(hash, idx); } QT_CATCH(...) { formats.pop_back(); -- cgit v0.12