MauiKit TextEditor

texteditor_plugin.h
1// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#pragma once
6
7#include <QDir>
8#include <QQmlExtensionPlugin>
9
10class TextEditorPlugin : public QQmlExtensionPlugin
11{
13 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
14public:
15 void registerTypes(const char *uri) override;
16
17private:
18 QUrl componentUrl(const QString &fileName) const;
19
20 QString resolveFileUrl(const QString &filePath) const
21 {
22#if defined(Q_OS_ANDROID)
23 return QStringLiteral(":/qt/qml/org/mauikit/texteditor/") + filePath;
24#else
25 return baseUrl().toString() + QLatin1Char('/') + filePath;
26#endif
27 }
28};
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.