summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qstylehints.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-15 14:23:28 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-16 21:12:49 +0000
commit273114582aaa944b4a22f1782cc5799fdd1e8e7b (patch)
tree9d3f7af5fd6a8bf081185be6b6a9ffd35867a940 /src/gui/kernel/qstylehints.cpp
parenta93ff2c2483b7d2f0c678aa3e52495e4cb36e9e1 (diff)
Add QStyleHints::setTabFocusBehavior() for testing purposes
So far we've been dependent on the focus behavior setting in OS X system preferences. This change allows us to start testing both behaviors on any platform. Change-Id: I9ce004f8b9479f8e722a387b795de16edb166a07 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qstylehints.cpp')
-rw-r--r--src/gui/kernel/qstylehints.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index b295fe986a..e184fed275 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -76,6 +76,7 @@ public:
, m_startDragTime(-1)
, m_keyboardInputInterval(-1)
, m_cursorFlashTime(-1)
+ , m_tabFocusBehavior(-1)
{}
int m_mouseDoubleClickInterval;
@@ -84,6 +85,7 @@ public:
int m_startDragTime;
int m_keyboardInputInterval;
int m_cursorFlashTime;
+ int m_tabFocusBehavior;
};
/*!
@@ -416,7 +418,25 @@ bool QStyleHints::setFocusOnTouchRelease() const
Qt::TabFocusBehavior QStyleHints::tabFocusBehavior() const
{
- return Qt::TabFocusBehavior(themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt());
+ Q_D(const QStyleHints);
+ return Qt::TabFocusBehavior(d->m_tabFocusBehavior >= 0 ?
+ d->m_tabFocusBehavior :
+ themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt());
+}
+
+/*!
+ Sets the \a tabFocusBehavior.
+ \internal
+ \sa tabFocusBehavior()
+ \since 5.7
+*/
+void QStyleHints::setTabFocusBehavior(Qt::TabFocusBehavior tabFocusBehavior)
+{
+ Q_D(QStyleHints);
+ if (d->m_tabFocusBehavior == tabFocusBehavior)
+ return;
+ d->m_tabFocusBehavior = tabFocusBehavior;
+ emit tabFocusBehaviorChanged(tabFocusBehavior);
}
/*!