1/*
2 SPDX-FileCopyrightText: 2019 David Edmundson <davidedmundson@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "plugin.h"
8
9#include <QDebug>
10#include <QQmlContext>
11
12#include "kdescendantsproxymodel_qml.h"
13#include "krolenames.h"
14#include "ksortfilterproxymodel.h"
15#include <KColumnHeadersModel>
16#include <KDescendantsProxyModel>
17#include <KNumberModel>
18
19using namespace Qt::StringLiterals;
20
21void Plugin::initializeEngine(QQmlEngine *engine, const char *uri)
22{
23 Q_UNUSED(engine);
24 Q_UNUSED(uri);
25}
26
27void Plugin::registerTypes(const char *uri)
28{
29 qmlRegisterAnonymousType<QAbstractItemModel>(uri, 1);
30
31 // 1.0
32 qmlRegisterType<KDescendantsProxyModelQml>(uri, 1, 0, "KDescendantsProxyModel");
33 qmlRegisterType<KNumberModel>(uri, 1, 0, "KNumberModel");
34 qmlRegisterType<KColumnHeadersModel>(uri, 1, 0, "KColumnHeadersModel");
35 qmlRegisterType<KSortFilterProxyModel>(uri, 1, 0, "KSortFilterProxyModel");
36
37 // 1.1
38 qmlRegisterUncreatableType<KRoleNames>(uri, 1, 1, "KRoleNames", u"KRoleNames can only be used as an attached property"_s);
39}
40
41#include "moc_plugin.cpp"
42

source code of kitemmodels/src/qml/plugin.cpp