The QSqlDriverPlugin class provides an abstract base for custom QSqlDriver 插件。 更多...
| 頭: | #include <QSqlDriverPlugin> |
| 繼承: | QObject |
| QSqlDriverPlugin (QObject * parent = 0) | |
| ~QSqlDriverPlugin () |
| virtual QSqlDriver * | create (const QString & key ) = 0 |
| virtual QStringList | keys () const = 0 |
The QSqlDriverPlugin class provides an abstract base for custom QSqlDriver 插件。
The SQL driver plugin is a simple plugin interface that makes it easy to create your own SQL driver plugins that can be loaded dynamically by Qt.
Writing a SQL plugin is achieved by subclassing this base class, reimplementing the pure virtual functions
keys
() 和
create
(),和導齣類采用
Q_EXPORT_PLUGIN2
() macro. See the SQL plugins that come with Qt for example implementations (in the
plugins/src/sqldrivers
subdirectory of the source distribution).
另請參閱 如何創建 Qt 插件 .
Constructs a SQL driver plugin and sets the parent to parent . This is invoked automatically by the Q_EXPORT_PLUGIN2 () 宏。
Destroys the SQL driver plugin.
從不需要明確調用這。Qt 自動銷毀插件當不再使用時。
[pure virtual]
QSqlDriver
* QSqlDriverPlugin::
create
(const
QString
&
key
)
創建並返迴 QSqlDriver object for the driver called key . The driver key is usually the class name of the required driver. Keys are case sensitive.
另請參閱 keys ().
[pure virtual]
QStringList
QSqlDriverPlugin::
keys
() const
Returns the list of drivers (keys) this plugin supports.
These keys are usually the class names of the custom drivers that are implemented in the plugin.
另請參閱 create ().