diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-02-13 12:51:04 +0100 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-04-12 07:58:48 +0000 |
commit | 5e1a4a444e9d059fb0b97671220ce80f9a477681 (patch) | |
tree | cc6baa4a95d7a9c4f215d5a9e80c413c30dc1bdb /src/imports | |
parent | cd14f003990194a9f5dd77f10e62cab2b7ce7d6b (diff) |
QQuickTableView: add new class: QQuickTableView
Task-number: QTBUG-51710
Change-Id: I8827a9c80bfa1ed3b9116c7625b74e3c5b12bfce
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/imports.pro | 3 | ||||
-rw-r--r-- | src/imports/tableview/plugin.cpp | 64 | ||||
-rw-r--r-- | src/imports/tableview/plugins.qmltypes | 33 | ||||
-rw-r--r-- | src/imports/tableview/qmldir | 5 | ||||
-rw-r--r-- | src/imports/tableview/tableview.pro | 10 |
5 files changed, 114 insertions, 1 deletions
diff --git a/src/imports/imports.pro b/src/imports/imports.pro index 3263774fd5..190fb57553 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -18,7 +18,8 @@ qtHaveModule(quick) { layouts \ qtquick2 \ window \ - testlib + testlib \ + tableview qtConfig(systemsemaphore): SUBDIRS += sharedimage qtConfig(quick-particles): \ diff --git a/src/imports/tableview/plugin.cpp b/src/imports/tableview/plugin.cpp new file mode 100644 index 0000000000..3bd9b72a8d --- /dev/null +++ b/src/imports/tableview/plugin.cpp @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins 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 <QtQuick/private/qquicktableview_p.h> + +QT_BEGIN_NAMESPACE + +//![class decl] +class QtQuickTableViewPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) +public: + QtQuickTableViewPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) + {} + + void registerTypes(const char *uri) override + { + Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.tableview")); + qmlRegisterType<QQuickTableView>(uri, 1, 0, "TableView"); + } +}; +//![class decl] + +QT_END_NAMESPACE + +#include "plugin.moc" diff --git a/src/imports/tableview/plugins.qmltypes b/src/imports/tableview/plugins.qmltypes new file mode 100644 index 0000000000..8510b698a9 --- /dev/null +++ b/src/imports/tableview/plugins.qmltypes @@ -0,0 +1,33 @@ +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 Qt.labs.tableview 1.0' + +Module { + dependencies: ["QtQuick 2.8"] + Component { + name: "QQuickTableView" + defaultProperty: "flickableData" + prototype: "QQuickFlickable" + exports: ["Qt.labs.tableview/TableView 1.0"] + exportMetaObjectRevisions: [0] + attachedType: "QQuickTableViewAttached" + Property { name: "rows"; type: "int"; isReadonly: true } + Property { name: "columns"; type: "int"; isReadonly: true } + Property { name: "rowSpacing"; type: "double" } + Property { name: "columnSpacing"; type: "double" } + Property { name: "cacheBuffer"; type: "int" } + Property { name: "model"; type: "QVariant" } + Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } + } + Component { + name: "QQuickTableViewAttached" + prototype: "QObject" + Property { name: "tableView"; type: "QQuickTableView"; isReadonly: true; isPointer: true } + Property { name: "row"; type: "int"; isReadonly: true } + Property { name: "column"; type: "int"; isReadonly: true } + } +} diff --git a/src/imports/tableview/qmldir b/src/imports/tableview/qmldir new file mode 100644 index 0000000000..dac976794a --- /dev/null +++ b/src/imports/tableview/qmldir @@ -0,0 +1,5 @@ +module Qt.labs.tableview +plugin tableviewplugin +classname QtQuickTableViewPlugin +typeinfo plugins.qmltypes + diff --git a/src/imports/tableview/tableview.pro b/src/imports/tableview/tableview.pro new file mode 100644 index 0000000000..97ced65e6b --- /dev/null +++ b/src/imports/tableview/tableview.pro @@ -0,0 +1,10 @@ +CXX_MODULE = qml +TARGET = tableviewplugin +TARGETPATH = Qt/labs/tableview +IMPORT_VERSION = 1.0 + +SOURCES += $$PWD/plugin.cpp + +QT += quick-private qml-private + +load(qml_plugin) |