QWebDatabase Class Reference |
QWebDatabase ( const QWebDatabase & other ) | |
~QWebDatabase () | |
QString | displayName () const |
qint64 | expectedSize () const |
QString | fileName () const |
QString | name () const |
QWebSecurityOrigin | origin () const |
qint64 | size () const |
QWebDatabase & | operator= ( const QWebDatabase & other ) |
void | removeAllDatabases () |
void | removeDatabase ( const QWebDatabase & db ) |
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.
To get access to all databases defined by a security origin, use QWebSecurityOrigin::databases(). Each database has an internal name(), as well as a user-friendly name, provided by displayName().
WebKit uses SQLite to create and access the local SQL databases. The location of the database file in the local file system is returned by fileName(). You can access the database directly through the QtSql database module.
For each database the web site can define an expectedSize(). The current size of the database in bytes is returned by size().
For more information refer to the HTML 5 Draft Standard.
See also QWebSecurityOrigin.
Constructs a web database from other.
Destroys the web database object. The data within this database is \b not destroyed.
Returns the name of the database as seen by the user.
Returns the expected size of the database in bytes as defined by the web author.
Returns the file name of the web database.
The name 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.fileName()); 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.
Returns the name of the database.
Returns the databases's security origin.
Deletes all web databases in the configured offline storage path.
This function was introduced in Qt 4.6.
See also QWebSettings::setOfflineStoragePath().
Removes the database db from its security origin. All data stored in the database db will be destroyed.
Returns the current size of the database in bytes.
Assigns the other web database to this.
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.6-snapshot | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com