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_mysql_p.h" |
7 | |
8 | QT_BEGIN_NAMESPACE |
9 | |
10 | using namespace Qt::StringLiterals; |
11 | |
12 | class QMYSQLDriverPlugin : public QSqlDriverPlugin |
13 | { |
14 | Q_OBJECT |
15 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QSqlDriverFactoryInterface"FILE "mysql.json") |
16 | |
17 | public: |
18 | QMYSQLDriverPlugin(); |
19 | |
20 | QSqlDriver* create(const QString &) override; |
21 | }; |
22 | |
23 | QMYSQLDriverPlugin::QMYSQLDriverPlugin() |
24 | : QSqlDriverPlugin() |
25 | { |
26 | } |
27 | |
28 | QSqlDriver* QMYSQLDriverPlugin::create(const QString &name) |
29 | { |
30 | if (name == "QMYSQL"_L1|| name == "QMARIADB"_L1) { |
31 | QMYSQLDriver* driver = new QMYSQLDriver(); |
32 | return driver; |
33 | } |
34 | return 0; |
35 | } |
36 | |
37 | QT_END_NAMESPACE |
38 | |
39 | #include "main.moc" |
40 |