KDeclarative

kquickcontrolsaddonsplugin.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Alan Alpert <[email protected]>
3  SPDX-FileCopyrightText: 2010 Ménard Alexis <[email protected]>
4  SPDX-FileCopyrightText: 2010 Marco Martin <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #include "kquickcontrolsaddonsplugin.h"
10 #include "config-kquickcontrolsaddons.h"
11 
12 
13 #include "qpixmapitem.h"
14 #include "qimageitem.h"
15 #include "qiconitem.h"
16 #include "mouseeventlistener.h"
17 #include "columnproxymodel.h"
18 #include "clipboard.h"
19 #include "fallbacktaphandler.h"
20 #include "mimedatabase.h"
21 #include "kcmshell.h"
22 #include "icondialog.h"
23 #include "eventgenerator.h"
24 
25 #if HAVE_EPOXY
26 #include "plotter.h"
27 #endif
28 
29 static QObject *kcmshell_singleton_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
30 {
31  Q_UNUSED(engine);
32  Q_UNUSED(scriptEngine);
33 
34  return new KCMShell();
35 }
36 
37 void KQuickControlsAddonsPlugin::registerTypes(const char *uri)
38 {
39  Q_ASSERT(QString::fromLatin1(uri) == QLatin1String("org.kde.kquickcontrolsaddons"));
40 
41  qmlRegisterType<QPixmapItem>(uri, 2, 0, "QPixmapItem");
42  qmlRegisterType<QImageItem>(uri, 2, 0, "QImageItem");
43  qmlRegisterType<QIconItem>(uri, 2, 0, "QIconItem");
44  qmlRegisterType<MouseEventListener>(uri, 2, 0, "MouseEventListener");
45  qmlRegisterType<ColumnProxyModel>(uri, 2, 0, "ColumnProxyModel");
46  qmlRegisterType<Clipboard>(uri, 2, 0, "Clipboard");
47  qmlRegisterType<MimeDatabase>(uri, 2, 0, "MimeDatabase");
48  qmlRegisterSingletonType<KCMShell>(uri, 2, 0, "KCMShell", kcmshell_singleton_provider);
49  qmlRegisterType<IconDialog>(uri, 2, 0, "IconDialog");
50  qmlRegisterType<EventGenerator>(uri, 2, 0, "EventGenerator");
51  qmlRegisterUncreatableType<FallbackTapHandlerMouseEvent>(uri, 2, 1, "FallbackTapHandlerMouseEvent", QStringLiteral("Cannot create items of type FallbackTapHandlerMouseEvent"));
52  qmlRegisterType<FallbackTapHandler>(uri, 2, 1, "FallbackTapHandler");
53 
54 #if HAVE_EPOXY
55  qmlRegisterType<PlotData>(uri, 2, 0, "PlotData");
56  qmlRegisterType<Plotter>(uri, 2, 0, "Plotter");
57 #endif
58  qmlRegisterAnonymousType<QAbstractItemModel>(uri, 1);
59  qRegisterMetaType<QModelIndex>("QModelIndex");
60 }
61 
62 
63 
QString fromLatin1(const char *str, int size)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.