Qt 4.8
Classes | Functions | Variables
qsqldatabase.cpp File Reference
#include "qsqldatabase.h"
#include "qsqlquery.h"
#include "qdebug.h"
#include "qcoreapplication.h"
#include "qreadwritelock.h"
#include "qsqlresult.h"
#include "qsqldriver.h"
#include "qsqldriverplugin.h"
#include "qsqlindex.h"
#include "private/qfactoryloader_p.h"
#include "private/qsqlnulldriver_p.h"
#include "qmutex.h"
#include "qhash.h"
#include <stdlib.h>

Go to the source code of this file.

Classes

class  QConnectionDict
 
class  QSqlDatabasePrivate
 

Functions

static void cleanDriverDict ()
 
QDebug operator<< (QDebug dbg, const QSqlDatabase &d)
 

Variables

Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,(QSqlDriverFactoryInterface_iid, QLatin1String("/sqldrivers"))) QT_STATIC_CONST_IMPL char *QSqlDatabase typedef QHash< QString, QSqlDriverCreatorBase * > DriverDict
 
static bool qDriverDictInit = false
 

Function Documentation

◆ cleanDriverDict()

static void cleanDriverDict ( )
static

Definition at line 207 of file qsqldatabase.cpp.

Referenced by QSqlDatabasePrivate::driverDict().

208 {
212  qDriverDictInit = false;
213 }
static bool qDriverDictInit
static DriverDict & driverDict()
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319
static void cleanConnections()

◆ operator<<()

QDebug operator<< ( QDebug  dbg,
const QSqlDatabase d 
)

Definition at line 1567 of file qsqldatabase.cpp.

1568 {
1569  if (!d.isValid()) {
1570  dbg.nospace() << "QSqlDatabase(invalid)";
1571  return dbg.space();
1572  }
1573 
1574  dbg.nospace() << "QSqlDatabase(driver=\"" << d.driverName() << "\", database=\""
1575  << d.databaseName() << "\", host=\"" << d.hostName() << "\", port=" << d.port()
1576  << ", user=\"" << d.userName() << "\", open=" << d.isOpen() << ")";
1577  return dbg.space();
1578 }
QString userName() const
Returns the connection&#39;s user name; it may be empty.
bool isOpen() const
Returns true if the database connection is currently open; otherwise returns false.
QDebug & nospace()
Clears the stream&#39;s internal flag that records whether the last character was a space and returns a r...
Definition: qdebug.h:92
bool isValid() const
Returns true if the QSqlDatabase has a valid driver.
int port() const
Returns the connection&#39;s port number.
QString databaseName() const
Returns the connection&#39;s database name, which may be empty.
QString driverName() const
Returns the connection&#39;s driver name.
QString hostName() const
Returns the connection&#39;s host name; it may be empty.
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
Definition: qdebug.h:91

Variable Documentation

◆ DriverDict

Q_GLOBAL_STATIC_WITH_ARGS (QFactoryLoader, loader, (QSqlDriverFactoryInterface_iid, QLatin1String("/sqldrivers"))) QT_STATIC_CONST_IMPL char *QSqlDatabase typedef QHash<QString, QSqlDriverCreatorBase*> DriverDict

Definition at line 105 of file qsqldatabase.cpp.

◆ qDriverDictInit

bool qDriverDictInit = false
static

Definition at line 206 of file qsqldatabase.cpp.