本文整理汇总了C++中DriverDict::constEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ DriverDict::constEnd方法的具体用法?C++ DriverDict::constEnd怎么用?C++ DriverDict::constEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DriverDict
的用法示例。
在下文中一共展示了DriverDict::constEnd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drivers
QStringList QSqlDatabase::drivers()
{
QStringList list;
#ifdef QT_SQL_PSQL
list << QLatin1String("QPSQL7");
list << QLatin1String("QPSQL");
#endif
#ifdef QT_SQL_MYSQL
list << QLatin1String("QMYSQL3");
list << QLatin1String("QMYSQL");
#endif
#ifdef QT_SQL_ODBC
list << QLatin1String("QODBC3");
list << QLatin1String("QODBC");
#endif
#ifdef QT_SQL_OCI
list << QLatin1String("QOCI8");
list << QLatin1String("QOCI");
#endif
#ifdef QT_SQL_TDS
list << QLatin1String("QTDS7");
list << QLatin1String("QTDS");
#endif
#ifdef QT_SQL_DB2
list << QLatin1String("QDB2");
#endif
#ifdef QT_SQL_SQLITE
list << QLatin1String("QSQLITE");
#endif
#ifdef QT_SQL_SQLITE2
list << QLatin1String("QSQLITE2");
#endif
#ifdef QT_SQL_IBASE
list << QLatin1String("QIBASE");
#endif
#ifndef QT_NO_LIBRARY
if (QFactoryLoader *fl = loader()) {
typedef QMultiMap<int, QString> PluginKeyMap;
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
const PluginKeyMap keyMap = fl->keyMap();
const PluginKeyMapConstIterator cend = keyMap.constEnd();
for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it)
if (!list.contains(it.value()))
list << it.value();
}
#endif
DriverDict dict = QSqlDatabasePrivate::driverDict();
for (DriverDict::const_iterator i = dict.constBegin(); i != dict.constEnd(); ++i) {
if (!list.contains(i.key()))
list << i.key();
}
return list;
}
示例2: drivers
QStringList QSqlDatabase::drivers()
{
QStringList list;
#ifdef QT_SQL_PSQL
list << QLatin1String("QPSQL7");
list << QLatin1String("QPSQL");
#endif
#ifdef QT_SQL_MYSQL
list << QLatin1String("QMYSQL3");
list << QLatin1String("QMYSQL");
#endif
#ifdef QT_SQL_ODBC
list << QLatin1String("QODBC3");
list << QLatin1String("QODBC");
#endif
#ifdef QT_SQL_OCI
list << QLatin1String("QOCI8");
list << QLatin1String("QOCI");
#endif
#ifdef QT_SQL_TDS
list << QLatin1String("QTDS7");
list << QLatin1String("QTDS");
#endif
#ifdef QT_SQL_DB2
list << QLatin1String("QDB2");
#endif
#ifdef QT_SQL_SQLITE
list << QLatin1String("QSQLITE");
#endif
#ifdef QT_SQL_SQLITE2
list << QLatin1String("QSQLITE2");
#endif
#ifdef QT_SQL_IBASE
list << QLatin1String("QIBASE");
#endif
#ifndef QT_NO_LIBRARY
if (QFactoryLoader *fl = loader()) {
QStringList keys = fl->keys();
for (QStringList::const_iterator i = keys.constBegin(); i != keys.constEnd(); ++i) {
if (!list.contains(*i))
list << *i;
}
}
#endif
DriverDict dict = QSqlDatabasePrivate::driverDict();
for (DriverDict::const_iterator i = dict.constBegin(); i != dict.constEnd(); ++i) {
if (!list.contains(i.key()))
list << i.key();
}
return list;
}
示例3: init
void QSqlDatabasePrivate::init(const QString &type)
{
drvName = type;
if (!driver) {
#ifdef QT_SQL_PSQL
if (type == QLatin1String("QPSQL") || type == QLatin1String("QPSQL7"))
driver = new QPSQLDriver();
#endif
#ifdef QT_SQL_MYSQL
if (type == QLatin1String("QMYSQL") || type == QLatin1String("QMYSQL3"))
driver = new QMYSQLDriver();
#endif
#ifdef QT_SQL_ODBC
if (type == QLatin1String("QODBC") || type == QLatin1String("QODBC3"))
driver = new QODBCDriver();
#endif
#ifdef QT_SQL_OCI
if (type == QLatin1String("QOCI") || type == QLatin1String("QOCI8"))
driver = new QOCIDriver();
#endif
#ifdef QT_SQL_TDS
if (type == QLatin1String("QTDS") || type == QLatin1String("QTDS7"))
driver = new QTDSDriver();
#endif
#ifdef QT_SQL_DB2
if (type == QLatin1String("QDB2"))
driver = new QDB2Driver();
#endif
#ifdef QT_SQL_SQLITE
if (type == QLatin1String("QSQLITE"))
driver = new QSQLiteDriver();
#endif
#ifdef QT_SQL_SQLITE2
if (type == QLatin1String("QSQLITE2"))
driver = new QSQLite2Driver();
#endif
#ifdef QT_SQL_IBASE
if (type == QLatin1String("QIBASE"))
driver = new QIBaseDriver();
#endif
}
if (!driver) {
DriverDict dict = QSqlDatabasePrivate::driverDict();
for (DriverDict::const_iterator it = dict.constBegin();
it != dict.constEnd() && !driver; ++it) {
if (type == it.key()) {
driver = ((QSqlDriverCreatorBase*)(*it))->createObject();
}
}
}
#ifndef QT_NO_LIBRARY
if (!driver && loader()) {
if (QSqlDriverFactoryInterface *factory = qobject_cast<QSqlDriverFactoryInterface*>(loader()->instance(type)))
driver = factory->create(type);
}
#endif // QT_NO_LIBRARY
if (!driver) {
qWarning("QSqlDatabase: %s driver not loaded", type.toLatin1().data());
qWarning("QSqlDatabase: available drivers: %s",
QSqlDatabase::drivers().join(QLatin1String(" ")).toLatin1().data());
if (QCoreApplication::instance() == 0)
qWarning("QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins");
driver = shared_null()->driver;
}
}