1 | // Copyright (C) 2016 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 <qsqldriverplugin.h> |
5 | #include <qstringlist.h> |
6 | #include "qsql_sqlite_p.h" |
7 | |
8 | QT_BEGIN_NAMESPACE |
9 | |
10 | using namespace Qt::StringLiterals; |
11 | |
12 | class QSQLiteDriverPlugin : public QSqlDriverPlugin |
13 | { |
14 | Q_OBJECT |
15 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QSqlDriverFactoryInterface"FILE "sqlite.json") |
16 | |
17 | public: |
18 | QSQLiteDriverPlugin(); |
19 | |
20 | QSqlDriver* create(const QString &) override; |
21 | }; |
22 | |
23 | QSQLiteDriverPlugin::QSQLiteDriverPlugin() |
24 | : QSqlDriverPlugin() |
25 | { |
26 | } |
27 | |
28 | QSqlDriver* QSQLiteDriverPlugin::create(const QString &name) |
29 | { |
30 | if (name == "QSQLITE"_L1) { |
31 | QSQLiteDriver* driver = new QSQLiteDriver(); |
32 | return driver; |
33 | } |
34 | |
35 | return nullptr; |
36 | } |
37 | |
38 | QT_END_NAMESPACE |
39 | |
40 | #include "smain.moc" |
41 |