1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include <qpa/qplatforminputcontextplugin_p.h>
5
6#include <QtCore/QStringList>
7
8#include "qcomposeplatforminputcontext.h"
9
10QT_BEGIN_NAMESPACE
11
12using namespace Qt::StringLiterals;
13
14class QComposePlatformInputContextPlugin : public QPlatformInputContextPlugin
15{
16 Q_OBJECT
17 Q_PLUGIN_METADATA(IID QPlatformInputContextFactoryInterface_iid FILE "compose.json")
18
19public:
20 QComposeInputContext *create(const QString &, const QStringList &) override;
21};
22
23QComposeInputContext *QComposePlatformInputContextPlugin::create(const QString &system, const QStringList &paramList)
24{
25 Q_UNUSED(paramList);
26
27 if (system.compare(s1: system, s2: "compose"_L1, cs: Qt::CaseInsensitive) == 0
28 || system.compare(s1: system, s2: "xim"_L1, cs: Qt::CaseInsensitive) == 0)
29 return new QComposeInputContext;
30 return nullptr;
31}
32
33QT_END_NAMESPACE
34
35#include "qcomposeplatforminputcontextmain.moc"
36

source code of qtbase/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp