MauiKit Image Tools

imagetools_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 "picinfomodel.h"
9#include "imagetools_plugin.h"
10
11#ifndef Q_OS_ANDROID
12#include <ocs.h>
13#endif
14
15void ImageToolsPlugin::registerTypes(const char *uri)
16{
17#if defined(Q_OS_ANDROID)
18 QResource::registerResource(QStringLiteral("assets:/android_rcc_bundle.rcc"));
19#endif
20
21 Q_ASSERT(QLatin1String(uri) == QLatin1String("org.mauikit.imagetools"));
22
23 qmlRegisterType(componentUrl(QStringLiteral("ImageViewer.qml")), uri, 1, 0, "ImageViewer");
24 qmlRegisterType(componentUrl(QStringLiteral("ImageEditor.qml")), uri, 1, 0, "ImageEditor");
25
26 qmlRegisterType<PicInfoModel>(uri, 1, 3, "PicInfoModel");
27 qmlRegisterType(componentUrl(QStringLiteral("ImageInfoDialog.qml")), uri, 1, 3, "ImageInfoDialog");
28 qmlRegisterType(componentUrl(QStringLiteral("MetadataEditor.qml")), uri, 1, 3, "MetadataEditor");
29
30#ifndef Q_OS_ANDROID
31 qmlRegisterType<OCS>(uri, 1, 3, "OCR");
32 qmlRegisterType(componentUrl(QStringLiteral("image2text/OCRPage.qml")), uri, 1, 3, "OCRPage");
33#endif
34}
35
36QUrl ImageToolsPlugin::componentUrl(const QString &fileName) const
37{
38 return QUrl(resolveFileUrl(fileName));
39}
40
41#include "imagetools_plugin.moc"
42#include "moc_imagetools_plugin.cpp"
43
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 Fri Jul 26 2024 11:53:30 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.