diff options
author | Charles Yin <charles.yin@nokia.com> | 2011-11-16 17:58:19 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-01 02:40:06 +0100 |
commit | 44d8691745ee9e8f927bdcd493f26b759c77d71c (patch) | |
tree | 03c45294a3ae6d199bd25aec25158f37a03d2fd9 /src/imports/xmllistmodel/plugin.cpp | |
parent | 5b949572aa56c5bce087fb0c023af7c96c40f139 (diff) |
Move XmlListModel to seperate plugin
XmlListModel is the only feature inside QtDeclarative which depends on
the QtXmlPatterns module, move this item to a separate plugin can reduce
the unnecessary dependency in most use cases.
To use the new XmlListModel, an additional "import QtQuick.xmllistmodel 2.0" is
needed.
Task-number:QTBUG-22158
Change-Id: I9e19eb6cbba46cd40fb7ffcdbd741f346779a54d
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src/imports/xmllistmodel/plugin.cpp')
-rw-r--r-- | src/imports/xmllistmodel/plugin.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/imports/xmllistmodel/plugin.cpp b/src/imports/xmllistmodel/plugin.cpp new file mode 100644 index 0000000000..4e25470734 --- /dev/null +++ b/src/imports/xmllistmodel/plugin.cpp @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtDeclarative/qdeclarativeextensionplugin.h> +#include <QtDeclarative/qdeclarative.h> + +#include "qdeclarativexmllistmodel_p.h" + +QT_BEGIN_NAMESPACE + +class QmlXmlListModelPlugin : public QDeclarativeExtensionPlugin +{ + Q_OBJECT +public: + virtual void registerTypes(const char *uri) + { + Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.XmlListModel")); + qmlRegisterType<QDeclarativeXmlListModel>(uri,2,0,"XmlListModel"); + qmlRegisterType<QDeclarativeXmlListModelRole>(uri,2,0,"XmlRole"); + } +}; + +QT_END_NAMESPACE + +#include "plugin.moc" + +Q_EXPORT_PLUGIN2(qmlxmllistmodelplugin, QT_PREPEND_NAMESPACE(QmlXmlListModelPlugin)); |