summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-06-30 20:50:48 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-06-30 20:50:48 (GMT)
commit436a71e8950ea5a050f95b5889b85e5fafb2e716 (patch)
treea54c8a03bd98015ae26adc59ae36bd64213b6fc3 /src
parent7e91986c352677d4c0456d30e1cb5fc3179e28c3 (diff)
downloadQt-436a71e8950ea5a050f95b5889b85e5fafb2e716.zip
Qt-436a71e8950ea5a050f95b5889b85e5fafb2e716.tar.gz
Qt-436a71e8950ea5a050f95b5889b85e5fafb2e716.tar.bz2
Set the focus to a child widget when set on a QGroupBox
When the focus is set on a QGroupBox with the policy NoFocus, the focus should be propagated to one of the child if it accepts the focus. This was failing because QWidget::focusWidget() returns the QGroupBox itself. Task-number: 257158 Reviewed-by: Denis
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/qgroupbox.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/widgets/qgroupbox.cpp b/src/gui/widgets/qgroupbox.cpp
index 0bfa8c0..2380e78 100644
--- a/src/gui/widgets/qgroupbox.cpp
+++ b/src/gui/widgets/qgroupbox.cpp
@@ -431,7 +431,7 @@ void QGroupBoxPrivate::_q_fixFocus(Qt::FocusReason reason)
{
Q_Q(QGroupBox);
QWidget *fw = q->focusWidget();
- if (!fw) {
+ if (!fw || fw == q) {
QWidget * best = 0;
QWidget * candidate = 0;
QWidget * w = q;
@@ -449,8 +449,7 @@ void QGroupBoxPrivate::_q_fixFocus(Qt::FocusReason reason)
}
if (best)
fw = best;
- else
- if (candidate)
+ else if (candidate)
fw = candidate;
}
if (fw)