KQuickImageEditor

kquickimageeditor_plugin.h
1 // SPDX-FileCopyrightText: 2020 Carl Schwan <[email protected]>
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 
5 #pragma once
6 
7 #include <QDir>
8 #include <QQmlExtensionPlugin>
9 
10 class KQuickImageEditorPlugin : public QQmlExtensionPlugin
11 {
12  Q_OBJECT
13  Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
14 public:
15  void registerTypes(const char *uri) override;
16 
17 private:
18  QString resolveFilePath(const QString &path) const
19  {
20 #if defined(Q_OS_ANDROID)
21  return QStringLiteral(":/android_rcc_bundle/qml/org/kde/kquickimageeditor/") + path;
22 #else
23  return baseUrl().toLocalFile() + QLatin1Char('/') + path;
24 #endif
25  }
26  QString resolveFileUrl(const QString &filePath) const
27  {
28 #if defined(Q_OS_ANDROID)
29  return QStringLiteral("qrc:/android_rcc_bundle/qml/org/kde/kquickimageeditor/") + filePath;
30 #else
31  return baseUrl().toString() + QLatin1Char('/') + filePath;
32 #endif
33  }
34 };
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 18 2021 23:08:19 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.