Skip to content

Commit

Permalink
Move xmllistmodel to xmlpatterns
Browse files Browse the repository at this point in the history
Change-Id: Ida2a23ae93b8625638397ee7ae10f32b9dcd2043
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
  • Loading branch information
gladhorn committed Aug 28, 2018
1 parent b9b9419 commit 8c6e243
Show file tree
Hide file tree
Showing 27 changed files with 2,977 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/imports/imports.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TEMPLATE = subdirs

qtHaveModule(qml): SUBDIRS += xmllistmodel
67 changes: 67 additions & 0 deletions src/imports/xmllistmodel/plugin.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtQml 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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

#include <QtQml/qqmlextensionplugin.h>
#include <QtQml/qqml.h>

#include "qqmlxmllistmodel_p.h"

QT_BEGIN_NAMESPACE

class QmlXmlListModelPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)

public:
QmlXmlListModelPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { }
void registerTypes(const char *uri) override
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.XmlListModel"));
qmlRegisterType<QQuickXmlListModel>(uri,2,0,"XmlListModel");
qmlRegisterType<QQuickXmlListModelRole>(uri,2,0,"XmlRole");

// Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward
qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
}
};

QT_END_NAMESPACE

#include "plugin.moc"
59 changes: 59 additions & 0 deletions src/imports/xmllistmodel/plugins.qmltypes
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import QtQuick.tooling 1.2

// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump -nonrelocatable QtQuick.XmlListModel 2.0'

Module {
dependencies: ["QtQuick 2.8"]
Component {
name: "QQuickXmlListModel"
defaultProperty: "roles"
prototype: "QAbstractListModel"
exports: ["QtQuick.XmlListModel/XmlListModel 2.0"]
exportMetaObjectRevisions: [0]
Enum {
name: "Status"
values: {
"Null": 0,
"Ready": 1,
"Loading": 2,
"Error": 3
}
}
Property { name: "status"; type: "Status"; isReadonly: true }
Property { name: "progress"; type: "double"; isReadonly: true }
Property { name: "source"; type: "QUrl" }
Property { name: "xml"; type: "string" }
Property { name: "query"; type: "string" }
Property { name: "namespaceDeclarations"; type: "string" }
Property { name: "roles"; type: "QQuickXmlListModelRole"; isList: true; isReadonly: true }
Property { name: "count"; type: "int"; isReadonly: true }
Signal {
name: "statusChanged"
Parameter { type: "QQuickXmlListModel::Status" }
}
Signal {
name: "progressChanged"
Parameter { name: "progress"; type: "double" }
}
Method { name: "reload" }
Method {
name: "get"
type: "QQmlV4Handle"
Parameter { name: "index"; type: "int" }
}
Method { name: "errorString"; type: "string" }
}
Component {
name: "QQuickXmlListModelRole"
prototype: "QObject"
exports: ["QtQuick.XmlListModel/XmlRole 2.0"]
exportMetaObjectRevisions: [0]
Property { name: "name"; type: "string" }
Property { name: "query"; type: "string" }
Property { name: "isKey"; type: "bool" }
}
}
5 changes: 5 additions & 0 deletions src/imports/xmllistmodel/qmldir
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module QtQuick.XmlListModel
plugin qmlxmllistmodelplugin
classname QmlXmlListModelPlugin
typeinfo plugins.qmltypes
designersupported
Loading

0 comments on commit 8c6e243

Please sign in to comment.