| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2023 Alexander Lohnau <alexander.lohnau@gmx.de> |
| 3 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 4 | */ |
| 5 | |
| 6 | #ifndef KQUICKCONFIGMODULELOADER_H |
| 7 | #define KQUICKCONFIGMODULELOADER_H |
| 8 | |
| 9 | #include "kcmutilsquick_export.h" |
| 10 | |
| 11 | #include <KPluginFactory> |
| 12 | #include <memory> |
| 13 | |
| 14 | class QQmlEngine; |
| 15 | class KQuickConfigModule; |
| 16 | |
| 17 | /*! |
| 18 | \namespace KQuickConfigModuleLoader |
| 19 | \inmodule KCMUtilsQuick |
| 20 | */ |
| 21 | namespace KQuickConfigModuleLoader |
| 22 | { |
| 23 | /*! |
| 24 | * \inmodule KCMUtilsQuick |
| 25 | * \brief Loads a QML KCM from the given plugin \a metaData as a child of \a parent with the given \a args. |
| 26 | * |
| 27 | * \a engine The QQmlEngine to use. If not set, an internal engine will be created. If your application has an existing engine, this must be passed in. |
| 28 | */ |
| 29 | KCMUTILSQUICK_EXPORT KPluginFactory::Result<KQuickConfigModule> |
| 30 | loadModule(const KPluginMetaData &metaData, QObject *parent = nullptr, const QVariantList &args = {}, const std::shared_ptr<QQmlEngine> &engine = {}); |
| 31 | } |
| 32 | #endif |
| 33 | |