diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qplatformtheme.cpp | 5 | ||||
-rw-r--r-- | src/gui/kernel/qplatformtheme.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoatheme.mm | 4 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsproxywidget.cpp | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 10 | ||||
-rw-r--r-- | src/widgets/widgets/qabstractbutton.cpp | 4 |
6 files changed, 23 insertions, 7 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index c35b534473..b91d3d0281 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -129,6 +129,9 @@ QT_BEGIN_NAMESPACE \value SpellCheckUnderlineStyle (int) A QTextCharFormat::UnderlineStyle specifying the underline style used misspelled words when spell checking. + \value TabAllWidgets (bool) Whether tab navigation should go through all the widgets or components, + or just through text boxes and list views. This is mostly a Mac feature. + \sa themeHint(), QStyle::pixelMetric() */ @@ -218,6 +221,8 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) return QVariant(int(0)); case SpellCheckUnderlineStyle: return QVariant(int(QTextCharFormat::SpellCheckUnderline)); + case TabAllWidgets: + return QVariant(true); } return QVariant(); } diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 417b4eda4d..398339255c 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -96,7 +96,8 @@ public: UseFullScreenForPopupMenu, KeyboardScheme, UiEffects, - SpellCheckUnderlineStyle + SpellCheckUnderlineStyle, + TabAllWidgets }; enum DialogType { diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 3e2515d5f4..ddb550dd5f 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -39,6 +39,8 @@ ** ****************************************************************************/ +#import <Cocoa/Cocoa.h> + #include "qcocoatheme.h" #include <QtCore/QVariant> @@ -142,6 +144,8 @@ QVariant QCocoaTheme::themeHint(ThemeHint hint) const return QVariant(1); // QDialogButtonBox::MacLayout case KeyboardScheme: return QVariant(int(MacKeyboardScheme)); + case TabAllWidgets: + return QVariant(bool([[NSApplication sharedApplication] isFullKeyboardAccessEnabled])); default: break; } diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index a0b3f99d5d..6dd03e76b0 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -190,7 +190,7 @@ QT_BEGIN_NAMESPACE */ extern bool qt_sendSpontaneousEvent(QObject *, QEvent *); -Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets; +Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets(); /*! \internal @@ -357,7 +357,7 @@ QWidget *QGraphicsProxyWidgetPrivate::findFocusChild(QWidget *child, bool next) } QWidget *oldChild = child; - uint focus_flag = qt_tab_all_widgets ? Qt::TabFocus : Qt::StrongFocus; + uint focus_flag = qt_tab_all_widgets() ? Qt::TabFocus : Qt::StrongFocus; do { if (child->isEnabled() && child->isVisibleTo(widget) 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) diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index 451a7d3a96..5d879c8930 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE #define AUTO_REPEAT_DELAY 300 #define AUTO_REPEAT_INTERVAL 100 -Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets; +Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets(); /*! \class QAbstractButton @@ -385,7 +385,7 @@ void QAbstractButtonPrivate::moveFocus(int key) int bestScore = -1; QRect target = f->rect().translated(f->mapToGlobal(QPoint(0,0))); QPoint goal = target.center(); - uint focus_flag = qt_tab_all_widgets ? Qt::TabFocus : Qt::StrongFocus; + uint focus_flag = qt_tab_all_widgets() ? Qt::TabFocus : Qt::StrongFocus; for (int i = 0; i < buttonList.count(); ++i) { QAbstractButton *button = buttonList.at(i); |