summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Portale <aportale@trolltech.com>2009-10-03 14:39:14 (GMT)
committerAlessandro Portale <aportale@trolltech.com>2009-10-03 14:39:14 (GMT)
commit34a1438c4184afecc237fe0177ed4a536b2d5e43 (patch)
tree5acfba6f1c66fdc994110b55b507e798e723297d
parent610427e8849c0c81c5f8658d24278edb199f68a3 (diff)
downloadQt-34a1438c4184afecc237fe0177ed4a536b2d5e43.zip
Qt-34a1438c4184afecc237fe0177ed4a536b2d5e43.tar.gz
Qt-34a1438c4184afecc237fe0177ed4a536b2d5e43.tar.bz2
Adding comments.
-rw-r--r--src/gui/kernel/qwidget.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index f62240a..2359812 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -11453,14 +11453,23 @@ QWidget *QWidgetPrivate::widgetInNavigationDirection(Direction direction)
if (targetCandidate->focusProxy() || targetCandidateRect.isEmpty())
continue;
+ // Only navigate to a target widget that...
if ( targetCandidate != sourceWidget
+ // ...takes the focus,
&& targetCandidate->focusPolicy() & Qt::TabFocus
+ // ...is above if DirectionNorth,
&& !(direction == DirectionNorth && targetCandidateRect.bottom() > sourceRect.top())
+ // ...is on the right if DirectionEast,
&& !(direction == DirectionEast && targetCandidateRect.left() < sourceRect.right())
+ // ...is below if DirectionSouth,
&& !(direction == DirectionSouth && targetCandidateRect.top() < sourceRect.bottom())
+ // ...is on the left if DirectionWest,
&& !(direction == DirectionWest && targetCandidateRect.right() > sourceRect.left())
+ // ...is enabled,
&& targetCandidate->isEnabled()
+ // ...is visible,
&& targetCandidate->isVisible()
+ // ...is in the same window,
&& targetCandidate->window() == sourceWindow) {
const int targetCandidateDistance = pointToRect(sourcePoint, targetCandidateRect);
if (targetCandidateDistance < shortestDistance) {