diff options
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 774ec23..2ad89a2 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -68,6 +68,9 @@ #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" @@ -2487,8 +2490,6 @@ 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; @@ -2496,11 +2497,22 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool QWidget *w = f; QWidget *test = f->d_func()->focus_next; while (test && test != f) { - if ((test->focusPolicy() & focus_flag) == focus_flag + if ((test->focusPolicy() & Qt::TabFocus) && !(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))) { + && (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 + )) { w = test; if (next) break; |