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