aboutsummaryrefslogtreecommitdiffstats
path: root/src/universalinput/qjoystickinputfactory.cpp
blob: 99e77546e1a5398465491815c7d58d052d03a51e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "qjoystickinputfactory_p.h"
#include "qjoystickinputplugin_p.h"
#include "qjoystickinput_p.h"

#include <QtCore/private/qfactoryloader_p.h>

QT_BEGIN_NAMESPACE

Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QJoystickInputFactoryInterface_iid, QLatin1String("/joystickinputs"), Qt::CaseInsensitive))

QStringList QJoystickInputFactory::keys()
{
    return loader->keyMap().values();
}

QJoystickInput *QJoystickInputFactory::create(const QString &key, const QStringList &paramList)
{
    return qLoadPlugin<QJoystickInput, QJoystickInputPlugin>(loader(), key, paramList);
}

QT_END_NAMESPACE