Home · All Namespaces · All Classes · Main Classes · Grouped Classes · Modules · Functions

QWebDatabase Class Reference
[QtWebKit module]

The QWebDatabase class provides access to HTML 5 databases created with JavaScript. More...

 #include <QWebDatabase>

This class was introduced in Qt 4.5.

Public Functions


Detailed Description

The QWebDatabase class provides access to HTML 5 databases created with JavaScript.

The upcoming HTML 5 standard includes support for SQL databases that web sites can create and access on a local computer through JavaScript. QWebDatabase is the C++ interface to these databases.

For more information refer to the HTML 5 Draft Standard.

See also QWebSecurityOrigin.


Member Function Documentation

QWebDatabase::QWebDatabase ( const QWebDatabase & other )

Constructs a web database from other.

QWebDatabase::~QWebDatabase ()

Destroys the web database object. The data within this database is \b not destroyed.

QString QWebDatabase::absoluteFilePath () const

Returns the path to the web database on disk.

The path can be used to access the database through the QtSql database module, for example:

 QWebDatabase webdb = ...
 QSqlDatabase sqldb = QSqlDatabase::addDatabase("QSQLITE", "myconnection");
 sqldb.setDatabaseName(webdb.absoluteFilePath());
 if (sqldb.open()) {
     QStringList tables = sqldb.tables();
     ...
 }

Note: Concurrent access to a database from multiple threads or processes is not very efficient because Sqlite is used as WebKit's database backend.

QString QWebDatabase::displayName () const

Returns the name of the database as seen by the user.

qint64 QWebDatabase::expectedSize () const

Returns the expected size of the database in bytes as defined by the web author.

QString QWebDatabase::name () const

Returns the name of the database.

QWebSecurityOrigin QWebDatabase::origin () const

Returns the databases's security origin.

void QWebDatabase::remove ()

Removes the database from its security origin. All data stored in this database will be destroyed.

qint64 QWebDatabase::size () const

Returns the current size of the database in bytes.

QWebDatabase & QWebDatabase::operator= ( const QWebDatabase & other )

Assigns the other web database to this.


Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt 4.5.0-beta1