summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-09 16:54:16 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-09 16:54:16 (GMT)
commit5af931da6da229ba79a99758921d44adafafbbeb (patch)
tree417de36d6a0539172dedb98ddb8552ce3d316127 /src/gui
parentd1cc1db7f8c050ab254263babb287fb37d5ef52f (diff)
parent95dd8a45b0da50fb32843dd275b2028ce77b2492 (diff)
downloadQt-5af931da6da229ba79a99758921d44adafafbbeb.zip
Qt-5af931da6da229ba79a99758921d44adafafbbeb.tar.gz
Qt-5af931da6da229ba79a99758921d44adafafbbeb.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Memory leak! Cursor would remain in a non-focused QLineEdit after clearing its selection
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextformat.cpp3
-rw-r--r--src/gui/widgets/qlineedit_p.cpp2
2 files changed, 3 insertions, 2 deletions
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();
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);
}