MauiKit Image Tools

imagetools_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 ImageToolsPlugin : public QQmlExtensionPlugin
11{
13 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
14public:
15 void registerTypes(const char *uri) override;
16private:
17 QUrl componentUrl(const QString &fileName) const;
18
19 QString resolveFileUrl(const QString &filePath) const
20 {
21#if defined(Q_OS_ANDROID)
22 return QStringLiteral(":/qt/qml/org/mauikit/imagetools/") + filePath;
23#else
24 return baseUrl().toString() + QLatin1Char('/') + filePath;
25#endif
26 }
27};
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:32:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.