summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-10-20 14:18:25 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-10-20 14:18:25 (GMT)
commit9bdc0a2d18bcc4938d79079e184a05acd5f43b22 (patch)
treeb4cff4d92d9239cc30c2c9bbf040b2493af66b26 /src/gui/kernel/qapplication.cpp
parent147c524e703d4727d03c5f2ea3f98ace25905b73 (diff)
parent76ef766a32cdcfd9cd64cf1d288c92a2b2040c15 (diff)
downloadQt-9bdc0a2d18bcc4938d79079e184a05acd5f43b22.zip
Qt-9bdc0a2d18bcc4938d79079e184a05acd5f43b22.tar.gz
Qt-9bdc0a2d18bcc4938d79079e184a05acd5f43b22.tar.bz2
Merge commit 'qt/4.6' into mmfphonon
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r--src/gui/kernel/qapplication.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 6f6d706..f48c551 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -68,9 +68,6 @@
#include "private/qstylesheetstyle_p.h"
#include "private/qstyle_p.h"
#include "qmessagebox.h"
-#include "qlineedit.h"
-#include "qlistview.h"
-#include "qtextedit.h"
#include <QtGui/qgraphicsproxywidget.h>
#include "qinputcontext.h"
@@ -2501,6 +2498,8 @@ void QApplication::setActiveWindow(QWidget* act)
*/
QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool next)
{
+ uint focus_flag = qt_tab_all_widgets ? Qt::TabFocus : Qt::StrongFocus;
+
QWidget *f = toplevel->focusWidget();
if (!f)
f = toplevel;
@@ -2508,22 +2507,11 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool
QWidget *w = f;
QWidget *test = f->d_func()->focus_next;
while (test && test != f) {
- if ((test->focusPolicy() & Qt::TabFocus)
+ if ((test->focusPolicy() & focus_flag) == focus_flag
&& !(test->d_func()->extra && test->d_func()->extra->focus_proxy)
&& test->isVisibleTo(toplevel) && test->isEnabled()
&& !(w->windowType() == Qt::SubWindow && !w->isAncestorOf(test))
- && (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test))
- && (qt_tab_all_widgets
-#ifndef QT_NO_LINEEDIT
- || qobject_cast<QLineEdit*>(test)
-#endif
-#ifndef QT_NO_TEXTEDIT
- || qobject_cast<QTextEdit*>(test)
-#endif
-#ifndef QT_NO_ITEMVIEWS
- || qobject_cast<QListView*>(test)
-#endif
- )) {
+ && (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test))) {
w = test;
if (next)
break;
@@ -2662,7 +2650,10 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) {
if (!isAlien(w))
break;
if (w->testAttribute(Qt::WA_SetCursor)) {
- parentOfLeavingCursor = w->parentWidget();
+ QWidget *parent = w->parentWidget();
+ while (parent && parent->d_func()->data.in_destructor)
+ parent = parent->parentWidget();
+ parentOfLeavingCursor = parent;
//continue looping, we need to find the downest alien widget with a cursor.
// (downest on the screen)
}