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

Provided by KDAB

Privacy Policy
Start learning QML with our Intro Training
Find out more

source code of qtbase/src/plugins/sqldrivers/sqlite/smain.cpp