mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-09 21:24:04 +00:00
So far methods like escapeHtml were available via backend, creating unnecessary dependency on backing in UI components.
48 lines
1.7 KiB
C++
48 lines
1.7 KiB
C++
#include <QtQml/QQmlExtensionPlugin>
|
|
|
|
#include <QZXing.h>
|
|
#include <qqmlsortfilterproxymodeltypes.h>
|
|
|
|
#include "StatusQ/QClipboardProxy.h"
|
|
#include "StatusQ/modelutilsinternal.h"
|
|
#include "StatusQ/permissionutilsinternal.h"
|
|
#include "StatusQ/rxvalidator.h"
|
|
#include "StatusQ/statussyntaxhighlighter.h"
|
|
#include "StatusQ/statuswindow.h"
|
|
#include "StatusQ/stringutilsinternal.h"
|
|
|
|
class StatusQPlugin : public QQmlExtensionPlugin {
|
|
Q_OBJECT
|
|
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
|
|
public:
|
|
void registerTypes(const char* uri) override
|
|
{
|
|
Q_ASSERT(uri == QLatin1String("StatusQ"));
|
|
|
|
qmlRegisterType<StatusWindow>("StatusQ", 0, 1, "StatusWindow");
|
|
qmlRegisterType<StatusSyntaxHighlighter>("StatusQ", 0, 1, "StatusSyntaxHighlighter");
|
|
qmlRegisterType<RXValidator>("StatusQ", 0, 1, "RXValidator");
|
|
|
|
qmlRegisterSingletonType<QClipboardProxy>("StatusQ", 0, 1, "QClipboardProxy", &QClipboardProxy::qmlInstance);
|
|
|
|
qmlRegisterSingletonType<ModelUtilsInternal>(
|
|
"StatusQ.Internal", 0, 1, "ModelUtils", &ModelUtilsInternal::qmlInstance);
|
|
qmlRegisterSingletonType<StringUtilsInternal>(
|
|
"StatusQ.Internal", 0, 1, "StringUtils", &StringUtilsInternal::qmlInstance);
|
|
|
|
qmlRegisterSingletonType<PermissionUtilsInternal>("StatusQ.Internal", 0, 1, "PermissionUtils", [](QQmlEngine *, QJSEngine *) {
|
|
return new PermissionUtilsInternal;
|
|
});
|
|
|
|
QZXing::registerQMLTypes();
|
|
qqsfpm::registerTypes();
|
|
}
|
|
|
|
void initializeEngine(QQmlEngine* engine, const char* uri) override
|
|
{
|
|
QQmlExtensionPlugin::initializeEngine(engine, uri);
|
|
}
|
|
};
|
|
|
|
#include "plugin.moc"
|