Settings to connect to a database. Settings can be loaded and saved from/to a QSettings.
More...
#include <qttools/sql/database_settings.h>
Settings to connect to a database. Settings can be loaded and saved from/to a QSettings.
qtsql::DatabaseSettings::DatabaseSettings |
( |
| ) |
|
void qtsql::DatabaseSettings::applyTo |
( |
QSqlDatabase * |
db | ) |
const |
Apply the current settings to a QSqlDatabase instance.
- Note
- It does not close/open the connection of
db
QString qtsql::DatabaseSettings::databaseName |
( |
| ) |
const |
- See also
- QSqlDatabase::databaseName()
const QString & qtsql::DatabaseSettings::host |
( |
| ) |
const |
- See also
- QSqlDatabase::hostName()
Load settings from the persistent storage.
- Parameters
-
pwdCipherFunc | Function used to decrypt the password. If null then the default password is returned (see parameter defValues ) |
defValues | Default values when all or some persistent settings could not be retrieved |
const QString & qtsql::DatabaseSettings::password |
( |
| ) |
const |
- See also
- QSqlDatabase::password()
int qtsql::DatabaseSettings::port |
( |
| ) |
const |
- See also
- QSqlDatabase::port()
void qtsql::DatabaseSettings::setDatabaseName |
( |
const QString & |
dbName | ) |
|
- See also
- QSqlDatabase::setDatabaseName()
void qtsql::DatabaseSettings::setHost |
( |
const QString & |
host | ) |
|
- See also
- QSqlDatabase::setHostName()
void qtsql::DatabaseSettings::setPassword |
( |
const QString & |
password | ) |
|
- See also
- QSqlDatabase::setPassword()
void qtsql::DatabaseSettings::setPort |
( |
int |
port | ) |
|
- See also
- QSqlDatabase::setPort()
void qtsql::DatabaseSettings::setUserName |
( |
const QString & |
userName | ) |
|
- See also
- QSqlDatabase::setUserName()
const QString & qtsql::DatabaseSettings::userName |
( |
| ) |
const |
- See also
- QSqlDatabase::userName()
void qtsql::DatabaseSettings::write |
( |
QSettings * |
settings, |
|
|
CipherFunction && |
pwdCipherFunc |
|
) |
| const |
Write settings to persistent storage.
- Parameters
-
pwdCipherFunc | Function used to encrypt the password. If null then an empty password is stored. Otherwise the password() is reprensented as a UTF-8 byte array and passed to pwdCipherFunc |
The documentation for this class was generated from the following files: