MauiKit TextEditor

texteditor_plugin.cpp
1// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#include <QQmlEngine>
6#include <QResource>
7
8#include "texteditor_plugin.h"
9#include "documenthandler.h"
10#include "colorschemesmodel.h"
11#include "linenumbermodel.h"
12
13void TextEditorPlugin::registerTypes(const char *uri)
14{
15#if defined(Q_OS_ANDROID)
16 QResource::registerResource(QStringLiteral("assets:/android_rcc_bundle.rcc"));
17#endif
18
19 qmlRegisterType<DocumentHandler>(uri, 1, 0, "DocumentHandler");
20 qmlRegisterType<ColorSchemesModel>(uri, 1, 0, "ColorSchemesModel");
21 qmlRegisterType<LineNumberModel>(uri, 1, 0, "LineNumberModel");
22 qmlRegisterType(componentUrl(QStringLiteral("TextEditor.qml")), uri, 1, 0, "TextEditor");
23 qmlRegisterType(componentUrl(QStringLiteral("ColorSchemesPage.qml")), uri, 1, 0, "ColorSchemesPage");
24}
25
26QUrl TextEditorPlugin::componentUrl(const QString &fileName) const
27{
28 return QUrl(resolveFileUrl(fileName));
29}
bool registerResource(const QString &rccFileName, const QString &mapRoot)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.