Akonadi

smain.cpp
1 /****************************************************************************
2 **
3 ** SPDX-FileCopyrightText: 2009 Nokia Corporation and /or its subsidiary(-ies).
4 ** Contact: Nokia Corporation ([email protected])
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** SPDX-FileCopyrightText: LGPL-2.1-only WITH Qt-LGPL-exception-1.1 OR GPL-3.0-only
9 **
10 ****************************************************************************/
11 
12 #include <QtCore/QStringList>
13 #include <QtSql/QSqlDriverPlugin>
14 
15 #include "qsql_sqlite.h"
16 
17 QT_BEGIN_NAMESPACE
18 
19 class QSQLiteDriverPlugin : public QSqlDriverPlugin
20 {
21  Q_OBJECT
22  Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QSqlDriverFactoryInterface" FILE "sqlite3.json")
23 
24 public:
25  QSQLiteDriverPlugin();
26 
27  QSqlDriver *create(const QString &) override;
28 };
29 
30 QSQLiteDriverPlugin::QSQLiteDriverPlugin()
32 {
33 }
34 
35 QSqlDriver *QSQLiteDriverPlugin::create(const QString &name)
36 {
37  if (name == QLatin1String("QSQLITE3")) {
38  auto driver = new QSQLiteDriver();
39  return driver;
40  }
41  return nullptr;
42 }
43 
44 #include "smain.moc"
45 
46 QT_END_NAMESPACE
Q_OBJECTQ_OBJECT
virtual QSqlDriver * create(const QString &key)=0
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jun 30 2022 03:51:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.