\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()
*/
return QVariant(int(0));
case SpellCheckUnderlineStyle:
return QVariant(int(QTextCharFormat::SpellCheckUnderline));
+ case TabAllWidgets:
+ return QVariant(true);
}
return QVariant();
}
UseFullScreenForPopupMenu,
KeyboardScheme,
UiEffects,
- SpellCheckUnderlineStyle
+ SpellCheckUnderlineStyle,
+ TabAllWidgets
};
enum DialogType {
**
****************************************************************************/
+#import <Cocoa/Cocoa.h>
+
#include "qcocoatheme.h"
#include <QtCore/QVariant>
return QVariant(1); // QDialogButtonBox::MacLayout
case KeyboardScheme:
return QVariant(int(MacKeyboardScheme));
+ case TabAllWidgets:
+ return QVariant(bool([[NSApplication sharedApplication] isFullKeyboardAccessEnabled]));
default:
break;
}
*/
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
}
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)
#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
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)
*/
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)
#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
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);
}
QT_BEGIN_NAMESPACE
-extern bool Q_GUI_EXPORT qt_tab_all_widgets; // qapplication.cpp
+extern bool Q_GUI_EXPORT qt_tab_all_widgets(); // qapplication.cpp
QT_END_NAMESPACE
void tst_QTableView::tabFocus()
{
- if (!qt_tab_all_widgets)
+ if (!qt_tab_all_widgets())
QSKIP("This test requires full keyboard control to be enabled.");
// QTableView enables tabKeyNavigation by default, but you should be able
-extern bool Q_GUI_EXPORT qt_tab_all_widgets; // from qapplication.cpp
+extern bool Q_GUI_EXPORT qt_tab_all_widgets(); // from qapplication.cpp
QT_END_NAMESPACE
class tst_QApplication : public QObject
QSettings appleSettings(QLatin1String("apple.com"));
QVariant appleValue = appleSettings.value(QLatin1String("AppleKeyboardUIMode"), 0);
tabAllControls = (appleValue.toInt() & 0x2);
- if (!tabAllControls) {
- QEXPECT_FAIL("", "QTBUG-24372 Mac tab key \"Text boxes and lists only\" vs "
- "\"All controls\" setting is not respected in Qt5", Abort);
- }
#endif
// make sure Qt's idea of tabbing between widgets matches what we think it should
- QCOMPARE(qt_tab_all_widgets, tabAllControls);
+ QCOMPARE(qt_tab_all_widgets(), tabAllControls);
tab.simulate(now);
if (!tabAllControls) {
}
QT_BEGIN_NAMESPACE
-extern bool Q_GUI_EXPORT qt_tab_all_widgets;
+extern bool Q_GUI_EXPORT qt_tab_all_widgets();
QT_END_NAMESPACE
void tst_QButtonGroup::arrowKeyNavigation()
{
- if (!qt_tab_all_widgets)
+ if (!qt_tab_all_widgets())
QSKIP("This test requires full keyboard control to be enabled.");
QDialog dlg(0);
QT_BEGIN_NAMESPACE
#if !defined(Q_WS_WIN)
-extern bool qt_tab_all_widgets;
+extern bool qt_tab_all_widgets();
#endif
QT_END_NAMESPACE
{
#if !defined(Q_OS_WIN)
if (qApp->style()->inherits("QMacStyle"))
- return qt_tab_all_widgets;
+ return qt_tab_all_widgets();
#endif
return true;
}
#ifdef Q_OS_MAC
QT_BEGIN_NAMESPACE
- extern bool qt_tab_all_widgets; // from qapplication.cpp
+extern bool qt_tab_all_widgets(); // from qapplication.cpp
QT_END_NAMESPACE
#endif
menu.addAction("Three");
#ifdef Q_OS_MAC
- if (!qt_tab_all_widgets)
+ if (!qt_tab_all_widgets())
QSKIP("Computer is currently set up to NOT tab to all widgets,"
" this test assumes you can tab to all widgets");
#endif