MauiKit Accounts

accounts_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 AccountsPlugin : public QQmlExtensionPlugin
11{
13 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
14public:
15 void registerTypes(const char *uri) override;
16
17private:
18 void initializeEngine(QQmlEngine *engine, const char *uri) override;
19 QUrl componentUrl(const QString &fileName) const;
20
21 QString resolveFileUrl(const QString &filePath) const
22 {
23#if defined(Q_OS_ANDROID)
24 return QStringLiteral(":/qt/qml/org/mauikit/accounts/") + filePath;
25#else
26 return baseUrl().toString() + QLatin1Char('/') + filePath;
27#endif
28 }
29};
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.