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