summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-10-20 09:08:04 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-10-20 09:08:04 (GMT)
commit3d4804a229e6cb869aa03481dd871e756ffa35ae (patch)
treedd9d7fb8c12358216066940e48b6e8d31eabf75f
parent1a11cc88e8516097e73d7aefc44c9a97ea0b5aef (diff)
downloadQt-3d4804a229e6cb869aa03481dd871e756ffa35ae.zip
Qt-3d4804a229e6cb869aa03481dd871e756ffa35ae.tar.gz
Qt-3d4804a229e6cb869aa03481dd871e756ffa35ae.tar.bz2
Revert "Change the way we handle KeyboardUIMode on Mac"
This will be handled differently (QTBUG-4751) This reverts commit b12fb5861ce09539c04cd51db12a9bfbe32a4774.
-rw-r--r--src/corelib/global/qnamespace.qdoc4
-rw-r--r--src/gui/kernel/qapplication.cpp20
2 files changed, 7 insertions, 17 deletions
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index ba05b00..e8d6df0 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1827,7 +1827,9 @@
\value TabFocus the widget accepts focus by tabbing.
\value ClickFocus the widget accepts focus by clicking.
\value StrongFocus the widget accepts focus by both tabbing
- and clicking.
+ and clicking. On Mac OS X this will also
+ be indicate that the widget accepts tab focus
+ when in 'Text/List focus mode'.
\value WheelFocus like Qt::StrongFocus plus the widget accepts
focus by using the mouse wheel.
\value NoFocus the widget does not accept focus.
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 41d8098..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;