diff options
author | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2012-10-09 11:27:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-10 13:15:57 +0200 |
commit | 06332df7438c8d2215b02f1e01ce2ed28a49a320 (patch) | |
tree | 3d8b8ad1896d611b349717b80f5b33464653fa9b /src/widgets/kernel | |
parent | 571545590149fe9bb3cce308490d66ac2c3f1318 (diff) |
Mac: Bring back "Text boxes and list only" tab navigation
Added ThemeHint::TabAllWidgets as a mean to access that platform
specific bool. The default implementation returns always true when
querying QPlatformTheme::themeHint().
Several auto-tests had to be updated to reflect for qt_tab_all_widgets'
type change. One XFAIL removed from tst_QApplication::focusChanged().
Task-number: QTBUG-24372
Change-Id: Ie1f0486c19898fe54c53aa4a27e378485075e512
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 68d7ee3378..86a27b2574 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -397,7 +397,6 @@ QWidget *QApplicationPrivate::active_window = 0; // toplevel with keyboar #ifndef QT_NO_WHEELEVENT int QApplicationPrivate::wheel_scroll_lines; // number of lines to scroll #endif -bool Q_WIDGETS_EXPORT qt_tab_all_widgets = true; bool qt_in_tab_key_event = false; int qt_antialiasing_threshold = -1; QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut @@ -416,6 +415,13 @@ inline bool QApplicationPrivate::isAlien(QWidget *widget) return widget && !widget->isWindow(); } +bool Q_WIDGETS_EXPORT qt_tab_all_widgets() +{ + if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) + return theme->themeHint(QPlatformTheme::TabAllWidgets).toBool(); + return true; +} + // ######## move to QApplicationPrivate // Default application palettes and fonts (per widget type) Q_GLOBAL_STATIC(PaletteHash, app_palettes) @@ -2080,7 +2086,7 @@ void QApplication::setActiveWindow(QWidget* act) */ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool next) { - uint focus_flag = qt_tab_all_widgets ? Qt::TabFocus : Qt::StrongFocus; + uint focus_flag = qt_tab_all_widgets() ? Qt::TabFocus : Qt::StrongFocus; QWidget *f = toplevel->focusWidget(); if (!f) |