summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-10-02 10:34:28 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-10-02 10:34:28 (GMT)
commitaf6a5c509390ee6a1b5022d81fd4660999550332 (patch)
tree276af1bcba8bdd7b5f5282b946c322a455780ff9
parent13a1cc06e9c65205d4485091c97800a7eea68cc6 (diff)
parentcbb94c29b065222e7cd8a5b55b018f14d3b79984 (diff)
downloadQt-af6a5c509390ee6a1b5022d81fd4660999550332.zip
Qt-af6a5c509390ee6a1b5022d81fd4660999550332.tar.gz
Qt-af6a5c509390ee6a1b5022d81fd4660999550332.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r--src/gui/widgets/qlabel.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp
index 5ff323a..5ba0571 100644
--- a/src/gui/widgets/qlabel.cpp
+++ b/src/gui/widgets/qlabel.cpp
@@ -886,7 +886,18 @@ void QLabel::focusInEvent(QFocusEvent *ev)
void QLabel::focusOutEvent(QFocusEvent *ev)
{
Q_D(QLabel);
- d->sendControlEvent(ev);
+ if (d->control) {
+ d->sendControlEvent(ev);
+ QTextCursor cursor = d->control->textCursor();
+ Qt::FocusReason reason = ev->reason();
+ if (reason != Qt::ActiveWindowFocusReason
+ && reason != Qt::PopupFocusReason
+ && cursor.hasSelection()) {
+ cursor.clearSelection();
+ d->control->setTextCursor(cursor);
+ }
+ }
+
QFrame::focusOutEvent(ev);
}