summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-02-04 10:37:08 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-02-13 08:12:23 +0000
commitd28a02aec9a1632f2263d9276099454b33fb6741 (patch)
treec52ae2dadcb1873d7e65ed0d1312970048f58699
parent1a5413df3d9a0602f074562e2e92751df369d016 (diff)
downloadqtquickcontrols-d28a02aec9a1632f2263d9276099454b33fb6741.tar.gz
Use TabFocusBehavior in QStyleHints in QtQuick.Controls
The all usages of qt_tab_all_widgets in test were updated. Change-Id: I35393c67f183c4e0695e869553007ea00d38c06a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r--tests/auto/activeFocusOnTab/tst_activeFocusOnTab.cpp6
-rw-r--r--tests/auto/controls/data/tst_button.qml2
-rw-r--r--tests/auto/controls/data/tst_checkbox.qml2
-rw-r--r--tests/auto/controls/data/tst_combobox.qml2
-rw-r--r--tests/auto/controls/data/tst_groupbox.qml2
-rw-r--r--tests/auto/controls/data/tst_label.qml2
-rw-r--r--tests/auto/controls/data/tst_progressbar.qml2
-rw-r--r--tests/auto/controls/data/tst_radiobutton.qml2
-rw-r--r--tests/auto/controls/data/tst_scrollview.qml2
-rw-r--r--tests/auto/controls/data/tst_slider.qml2
-rw-r--r--tests/auto/controls/data/tst_statusbar.qml2
-rw-r--r--tests/auto/controls/data/tst_switch.qml2
-rw-r--r--tests/auto/controls/data/tst_tableview.qml2
-rw-r--r--tests/auto/controls/data/tst_toolbar.qml2
-rw-r--r--tests/auto/controls/data/tst_toolbutton.qml2
-rw-r--r--tests/auto/testplugin/testcppmodels.h24
-rw-r--r--tests/auto/testplugin/testplugin.cpp1
17 files changed, 16 insertions, 43 deletions
diff --git a/tests/auto/activeFocusOnTab/tst_activeFocusOnTab.cpp b/tests/auto/activeFocusOnTab/tst_activeFocusOnTab.cpp
index f91e1842..9f202b34 100644
--- a/tests/auto/activeFocusOnTab/tst_activeFocusOnTab.cpp
+++ b/tests/auto/activeFocusOnTab/tst_activeFocusOnTab.cpp
@@ -42,7 +42,7 @@
#include <QtQuick/qquickview.h>
#include <QtQuick/private/qquickitem_p.h>
#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/qpa/qplatformtheme.h>
+#include <QtGui/qstylehints.h>
#include "../shared/util.h"
#include "../shared/visualtestutil.h"
@@ -63,9 +63,7 @@ private slots:
private:
QQmlEngine engine;
bool qt_tab_all_widgets() {
- if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
- return theme->themeHint(QPlatformTheme::TabAllWidgets).toBool();
- return true;
+ return QGuiApplication::styleHints()->tabFocusBehavior() == Qt::TabFocusAllControls;
}
};
diff --git a/tests/auto/controls/data/tst_button.qml b/tests/auto/controls/data/tst_button.qml
index 1f956ebe..abff5bdf 100644
--- a/tests/auto/controls/data/tst_button.qml
+++ b/tests/auto/controls/data/tst_button.qml
@@ -119,7 +119,7 @@ TestCase {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_checkbox.qml b/tests/auto/controls/data/tst_checkbox.qml
index 620ed41e..89663624 100644
--- a/tests/auto/controls/data/tst_checkbox.qml
+++ b/tests/auto/controls/data/tst_checkbox.qml
@@ -274,7 +274,7 @@ Item {
checkBox.destroy()
wait(0) //QTBUG-30523 so processEvents is called
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index dc5c3c7d..521af9d3 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -412,7 +412,7 @@ TestCase {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_groupbox.qml b/tests/auto/controls/data/tst_groupbox.qml
index 33ef2b69..45591302 100644
--- a/tests/auto/controls/data/tst_groupbox.qml
+++ b/tests/auto/controls/data/tst_groupbox.qml
@@ -138,7 +138,7 @@ TestCase {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var component = Qt.createComponent("groupbox/gb_activeFocusOnTab.qml")
diff --git a/tests/auto/controls/data/tst_label.qml b/tests/auto/controls/data/tst_label.qml
index 093fc9c5..5ee8c4ea 100644
--- a/tests/auto/controls/data/tst_label.qml
+++ b/tests/auto/controls/data/tst_label.qml
@@ -56,7 +56,7 @@ TestCase {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_progressbar.qml b/tests/auto/controls/data/tst_progressbar.qml
index 776241e5..2dd90b96 100644
--- a/tests/auto/controls/data/tst_progressbar.qml
+++ b/tests/auto/controls/data/tst_progressbar.qml
@@ -127,7 +127,7 @@ TestCase {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_radiobutton.qml b/tests/auto/controls/data/tst_radiobutton.qml
index 6842d2e6..05b45b4d 100644
--- a/tests/auto/controls/data/tst_radiobutton.qml
+++ b/tests/auto/controls/data/tst_radiobutton.qml
@@ -188,7 +188,7 @@ Item {
radioButton.destroy()
wait(0) //QTBUG-30523 so processEvents is called
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_scrollview.qml b/tests/auto/controls/data/tst_scrollview.qml
index 44fa7f3e..f6f65d56 100644
--- a/tests/auto/controls/data/tst_scrollview.qml
+++ b/tests/auto/controls/data/tst_scrollview.qml
@@ -175,7 +175,7 @@ TestCase {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml
index 5acab82c..26847fb8 100644
--- a/tests/auto/controls/data/tst_slider.qml
+++ b/tests/auto/controls/data/tst_slider.qml
@@ -172,7 +172,7 @@ Item {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_statusbar.qml b/tests/auto/controls/data/tst_statusbar.qml
index 64be9aea..202b4d8d 100644
--- a/tests/auto/controls/data/tst_statusbar.qml
+++ b/tests/auto/controls/data/tst_statusbar.qml
@@ -56,7 +56,7 @@ TestCase {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_switch.qml b/tests/auto/controls/data/tst_switch.qml
index 60a2d7d9..2ab0b6e1 100644
--- a/tests/auto/controls/data/tst_switch.qml
+++ b/tests/auto/controls/data/tst_switch.qml
@@ -210,7 +210,7 @@ Item {
aSwitch.destroy()
wait(0) //QTBUG-30523 so processEvents is called
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_tableview.qml b/tests/auto/controls/data/tst_tableview.qml
index b149e76b..75ad7aea 100644
--- a/tests/auto/controls/data/tst_tableview.qml
+++ b/tests/auto/controls/data/tst_tableview.qml
@@ -971,7 +971,7 @@ TestCase {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var component = Qt.createComponent("tableview/table_activeFocusOnTab.qml")
diff --git a/tests/auto/controls/data/tst_toolbar.qml b/tests/auto/controls/data/tst_toolbar.qml
index 1a49cd67..71fc31f6 100644
--- a/tests/auto/controls/data/tst_toolbar.qml
+++ b/tests/auto/controls/data/tst_toolbar.qml
@@ -56,7 +56,7 @@ TestCase {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/controls/data/tst_toolbutton.qml b/tests/auto/controls/data/tst_toolbutton.qml
index 70a0bbc5..90c5970d 100644
--- a/tests/auto/controls/data/tst_toolbutton.qml
+++ b/tests/auto/controls/data/tst_toolbutton.qml
@@ -69,7 +69,7 @@ TestCase {
}
function test_activeFocusOnTab() {
- if (!SystemInfo.tabAllWidgets)
+ if (Qt.styleHints.tabFocusBehavior != Qt.TabFocusAllControls)
skip("This function doesn't support NOT iterating all.")
var test_control = 'import QtQuick 2.2; \
diff --git a/tests/auto/testplugin/testcppmodels.h b/tests/auto/testplugin/testcppmodels.h
index 4a74e2de..f5cc6298 100644
--- a/tests/auto/testplugin/testcppmodels.h
+++ b/tests/auto/testplugin/testcppmodels.h
@@ -40,33 +40,9 @@
#include <QAbstractListModel>
#include <QVariant>
#include <QtGui/private/qguiapplication_p.h>
-#include <qpa/qplatformtheme.h>
#include <QtQml/QQmlEngine>
#include <QtQml/QJSEngine>
-class SystemInfo : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(bool tabAllWidgets READ tabAllWidgets CONSTANT)
-
-public:
- SystemInfo() {}
- bool tabAllWidgets() const {
- if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
- return theme->themeHint(QPlatformTheme::TabAllWidgets).toBool();
- return true;
- }
-};
-
-static QObject *systeminfo_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
-{
- Q_UNUSED(engine)
- Q_UNUSED(scriptEngine)
-
- SystemInfo *systemInfo = new SystemInfo();
- return systemInfo;
-}
-
class TestObject : public QObject
{
Q_OBJECT
diff --git a/tests/auto/testplugin/testplugin.cpp b/tests/auto/testplugin/testplugin.cpp
index 884f2477..cece3939 100644
--- a/tests/auto/testplugin/testplugin.cpp
+++ b/tests/auto/testplugin/testplugin.cpp
@@ -46,7 +46,6 @@ void TestPlugin::registerTypes(const char *uri)
// cpp models
qmlRegisterType<TestObject>(uri, 1, 0, "TestObject");
qmlRegisterType<TestItemModel>(uri, 1, 0, "TestItemModel");
- qmlRegisterSingletonType<SystemInfo>(uri, 1, 0, "SystemInfo", systeminfo_provider);
}
void TestPlugin::initializeEngine(QQmlEngine *engine, const char * /*uri*/)