summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-15 14:41:45 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-27 19:31:50 +0100
commit079aaa9b0754db9b7b2a97cb2ea22042c6f50738 (patch)
treea5e6f9d745114546cece44ef4540e98e2a5bc82b /src
parent245352fa45f4913716d23d98fa099097357beff1 (diff)
downloadqtdeclarative-079aaa9b0754db9b7b2a97cb2ea22042c6f50738.tar.gz
qtdeclarative-079aaa9b0754db9b7b2a97cb2ea22042c6f50738.tar.bz2
qtdeclarative-079aaa9b0754db9b7b2a97cb2ea22042c6f50738.zip
Accessibility: Use factory function instead of plugin
[ChangeLog][QtQuick] Accessibility for Qt Quick is now included in the qtquick library instead of being a separate plugin. Change-Id: I26a7ed14b8a387662cea8f89218485be50033e34 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/accessible/accessible.pro2
-rw-r--r--src/plugins/accessible/quick/accessible.json3
-rw-r--r--src/plugins/accessible/quick/quick.pro22
-rw-r--r--src/plugins/accessible/shared/qaccessiblebase.pri3
-rw-r--r--src/plugins/plugins.pro3
-rw-r--r--src/quick/accessible/accessible.pri16
-rw-r--r--src/quick/accessible/qaccessiblequickitem.cpp (renamed from src/plugins/accessible/quick/qaccessiblequickitem.cpp)4
-rw-r--r--src/quick/accessible/qaccessiblequickitem_p.h (renamed from src/plugins/accessible/quick/qaccessiblequickitem.h)4
-rw-r--r--src/quick/accessible/qaccessiblequickview.cpp (renamed from src/plugins/accessible/quick/qaccessiblequickview.cpp)8
-rw-r--r--src/quick/accessible/qaccessiblequickview_p.h (renamed from src/plugins/accessible/quick/qaccessiblequickview.h)2
-rw-r--r--src/quick/accessible/qqmlaccessible.cpp (renamed from src/plugins/accessible/shared/qqmlaccessible.cpp)6
-rw-r--r--src/quick/accessible/qqmlaccessible_p.h (renamed from src/plugins/accessible/shared/qqmlaccessible.h)0
-rw-r--r--src/quick/accessible/qquickaccessiblefactory.cpp (renamed from src/plugins/accessible/quick/main.cpp)51
-rw-r--r--src/quick/accessible/qquickaccessiblefactory_p.h55
-rw-r--r--src/quick/qtquick2.cpp5
-rw-r--r--src/quick/quick.pro3
16 files changed, 98 insertions, 89 deletions
diff --git a/src/plugins/accessible/accessible.pro b/src/plugins/accessible/accessible.pro
deleted file mode 100644
index b97d323a0..000000000
--- a/src/plugins/accessible/accessible.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-qtHaveModule(quick): SUBDIRS += quick
diff --git a/src/plugins/accessible/quick/accessible.json b/src/plugins/accessible/quick/accessible.json
deleted file mode 100644
index b21218f19..000000000
--- a/src/plugins/accessible/quick/accessible.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "Keys": [ "QQuickWindow", "QQuickItem" ]
-}
diff --git a/src/plugins/accessible/quick/quick.pro b/src/plugins/accessible/quick/quick.pro
deleted file mode 100644
index eeececae8..000000000
--- a/src/plugins/accessible/quick/quick.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-TARGET = qtaccessiblequick
-
-PLUGIN_TYPE = accessible
-PLUGIN_CLASS_NAME = AccessibleQuickFactory
-load(qt_plugin)
-
-include ($$PWD/../shared/qaccessiblebase.pri)
-
-QT += core-private gui-private qml-private quick-private
-
-#DEFINES+=Q_ACCESSIBLE_QUICK_ITEM_ENABLE_DEBUG_DESCRIPTION
-
-SOURCES += \
- main.cpp \
- qaccessiblequickview.cpp \
- qaccessiblequickitem.cpp
-
-HEADERS += \
- qaccessiblequickview.h \
- qaccessiblequickitem.h
-
-OTHERFILES += accessible.json
diff --git a/src/plugins/accessible/shared/qaccessiblebase.pri b/src/plugins/accessible/shared/qaccessiblebase.pri
deleted file mode 100644
index 827df0f13..000000000
--- a/src/plugins/accessible/shared/qaccessiblebase.pri
+++ /dev/null
@@ -1,3 +0,0 @@
-INCLUDEPATH += $$PWD
-SOURCES += $$PWD/qqmlaccessible.cpp
-HEADERS += $$PWD/qqmlaccessible.h
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 9ef8c7ab7..664a45760 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -1,5 +1,2 @@
TEMPLATE = subdirs
SUBDIRS += qmltooling
-contains(QT_CONFIG, accessibility) {
- SUBDIRS += accessible
-}
diff --git a/src/quick/accessible/accessible.pri b/src/quick/accessible/accessible.pri
new file mode 100644
index 000000000..88ff74748
--- /dev/null
+++ b/src/quick/accessible/accessible.pri
@@ -0,0 +1,16 @@
+
+QT += core-private gui-private qml-private
+
+#DEFINES+=Q_ACCESSIBLE_QUICK_ITEM_ENABLE_DEBUG_DESCRIPTION
+
+SOURCES += \
+ $$PWD/qqmlaccessible.cpp \
+ $$PWD/qaccessiblequickview.cpp \
+ $$PWD/qaccessiblequickitem.cpp \
+ $$PWD/qquickaccessiblefactory.cpp \
+
+HEADERS += \
+ $$PWD/qqmlaccessible_p.h \
+ $$PWD/qaccessiblequickview_p.h \
+ $$PWD/qaccessiblequickitem_p.h \
+ $$PWD/qquickaccessiblefactory_p.h \
diff --git a/src/plugins/accessible/quick/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp
index 4b6857414..bc2b4de86 100644
--- a/src/plugins/accessible/quick/qaccessiblequickitem.cpp
+++ b/src/quick/accessible/qaccessiblequickitem.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtQml module of the Qt Toolkit.
+** This file is part of the QtQuick module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qaccessiblequickitem.h"
+#include "qaccessiblequickitem_p.h"
#include <QtGui/qtextdocument.h>
diff --git a/src/plugins/accessible/quick/qaccessiblequickitem.h b/src/quick/accessible/qaccessiblequickitem_p.h
index d9eb65203..354e0bf9f 100644
--- a/src/plugins/accessible/quick/qaccessiblequickitem.h
+++ b/src/quick/accessible/qaccessiblequickitem_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtQml module of the Qt Toolkit.
+** This file is part of the QtQuick module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -44,7 +44,7 @@
#include <QtQuick/QQuickItem>
#include <QtQuick/QQuickView>
-#include "qqmlaccessible.h"
+#include <QtQuick/private/qqmlaccessible_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/accessible/quick/qaccessiblequickview.cpp b/src/quick/accessible/qaccessiblequickview.cpp
index 1240b2ef4..05e37d624 100644
--- a/src/plugins/accessible/quick/qaccessiblequickview.cpp
+++ b/src/quick/accessible/qaccessiblequickview.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtQml module of the Qt Toolkit.
+** This file is part of the QtQuick module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -39,15 +39,15 @@
**
****************************************************************************/
-#include "qaccessiblequickview.h"
+#include "qaccessiblequickview_p.h"
#include <QtGui/qguiapplication.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/private/qquickitem_p.h>
-#include "qaccessiblequickitem.h"
-#include "qqmlaccessible.h"
+#include "qaccessiblequickitem_p.h"
+#include "qqmlaccessible_p.h"
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/plugins/accessible/quick/qaccessiblequickview.h b/src/quick/accessible/qaccessiblequickview_p.h
index 41c34c543..f14d4c958 100644
--- a/src/plugins/accessible/quick/qaccessiblequickview.h
+++ b/src/quick/accessible/qaccessiblequickview_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtQml module of the Qt Toolkit.
+** This file is part of the QtQuick module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/plugins/accessible/shared/qqmlaccessible.cpp b/src/quick/accessible/qqmlaccessible.cpp
index ecf4e56ac..abe94537a 100644
--- a/src/plugins/accessible/shared/qqmlaccessible.cpp
+++ b/src/quick/accessible/qqmlaccessible.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include <qnamespace.h>
-#include "qqmlaccessible.h"
+#include "qqmlaccessible_p.h"
#ifndef QT_NO_ACCESSIBILITY
@@ -148,8 +148,8 @@ void QQmlAccessible::doAction(const QString &actionName)
{
// Look for and call the accessible[actionName]Action() function on the item.
// This allows for overriding the default action handling.
- const QByteArray functionName = "accessible" + actionName.toLatin1() + "Action";
- if (object()->metaObject()->indexOfMethod(functionName + "()") != -1) {
+ const QByteArray functionName = QByteArrayLiteral("accessible") + actionName.toLatin1() + QByteArrayLiteral("Action");
+ if (object()->metaObject()->indexOfMethod(QByteArray(functionName + QByteArrayLiteral("()"))) != -1) {
QMetaObject::invokeMethod(object(), functionName);
return;
}
diff --git a/src/plugins/accessible/shared/qqmlaccessible.h b/src/quick/accessible/qqmlaccessible_p.h
index b6da016b2..b6da016b2 100644
--- a/src/plugins/accessible/shared/qqmlaccessible.h
+++ b/src/quick/accessible/qqmlaccessible_p.h
diff --git a/src/plugins/accessible/quick/main.cpp b/src/quick/accessible/qquickaccessiblefactory.cpp
index 6c7be155c..d0e7f0f5e 100644
--- a/src/plugins/accessible/quick/main.cpp
+++ b/src/quick/accessible/qquickaccessiblefactory.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtQml module of the Qt Toolkit.
+** This file is part of the QtQuick module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -39,50 +39,16 @@
**
****************************************************************************/
+#include "qquickaccessiblefactory_p.h"
-#include "qqmlaccessible.h"
-#include "qaccessiblequickview.h"
-#include "qaccessiblequickitem.h"
-
-#include <QtQuick/QQuickWindow>
-#include <QtQuick/QQuickItem>
+#include "qaccessiblequickview_p.h"
+#include "qaccessiblequickitem_p.h"
#include <QtQuick/private/qquickitem_p.h>
-#include <QtQuick/private/qquickaccessibleattached_p.h>
-
-#include <qaccessibleplugin.h>
-#include <qvariant.h>
-#include <qplugin.h>
-#include <qaccessible.h>
-
-#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
-class AccessibleQuickFactory : public QAccessiblePlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QAccessibleFactoryInterface" FILE "accessible.json")
-
-public:
- AccessibleQuickFactory();
-
- QStringList keys() const;
- QAccessibleInterface *create(const QString &classname, QObject *object);
-};
-
-AccessibleQuickFactory::AccessibleQuickFactory()
-{
-}
-
-QStringList AccessibleQuickFactory::keys() const
-{
- QStringList list;
- list << QLatin1String("QQuickWindow");
- list << QLatin1String("QQuickItem");
- return list;
-}
-
-QAccessibleInterface *AccessibleQuickFactory::create(const QString &classname, QObject *object)
+QAccessibleInterface *qQuickAccessibleFactory(const QString &classname, QObject *object)
{
if (classname == QLatin1String("QQuickWindow")) {
return new QAccessibleQuickWindow(qobject_cast<QQuickWindow *>(object));
@@ -98,8 +64,5 @@ QAccessibleInterface *AccessibleQuickFactory::create(const QString &classname, Q
return 0;
}
+#endif
QT_END_NAMESPACE
-
-#include "main.moc"
-
-#endif // QT_NO_ACCESSIBILITY
diff --git a/src/quick/accessible/qquickaccessiblefactory_p.h b/src/quick/accessible/qquickaccessiblefactory_p.h
new file mode 100644
index 000000000..792364b7f
--- /dev/null
+++ b/src/quick/accessible/qquickaccessiblefactory_p.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQuick module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKACCESSIBLEFACTORY_H
+#define QQUICKACCESSIBLEFACTORY_H
+
+#include <QtGui/qaccessible.h>
+
+QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
+QAccessibleInterface *qQuickAccessibleFactory(const QString &classname, QObject *object);
+
+#endif
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp
index 9d2a0b0f7..fe24c2512 100644
--- a/src/quick/qtquick2.cpp
+++ b/src/quick/qtquick2.cpp
@@ -44,6 +44,7 @@
#include <private/qquickutilmodule_p.h>
#include <private/qquickvaluetypes_p.h>
#include <private/qquickitemsmodule_p.h>
+#include <private/qquickaccessiblefactory_p.h>
#include <private/qqmlenginedebugservice_p.h>
#include <private/qqmldebugstatesdelegate_p.h>
@@ -190,6 +191,10 @@ void QQmlQtQuick2Module::defineModule()
QQuickValueTypes::registerValueTypes();
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessible::installFactory(&qQuickAccessibleFactory);
+#endif
+
if (QQmlDebugService::isDebuggingEnabled()) {
QQmlEngineDebugService::instance()->setStatesDelegate(
new QQmlQtQuick2DebugStatesDelegate);
diff --git a/src/quick/quick.pro b/src/quick/quick.pro
index 38e743cc5..6e08662e6 100644
--- a/src/quick/quick.pro
+++ b/src/quick/quick.pro
@@ -29,6 +29,9 @@ include(util/util.pri)
include(scenegraph/scenegraph.pri)
include(items/items.pri)
include(designer/designer.pri)
+contains(QT_CONFIG, accessibility) {
+ include(accessible/accessible.pri)
+}
HEADERS += \
qtquickglobal.h \